Use exact match in get_var_value

get_var_value is only used when an exact match is needed.  This
changes this function to ensure this sort of matching is done.

gdb/ChangeLog
2020-12-14  Tom Tromey  <tromey@adacore.com>

	* ada-lang.c (get_var_value): Only consider exact matches.
This commit is contained in:
Tom Tromey 2020-12-14 08:14:06 -07:00
parent e26624c669
commit 25a1127be7
2 changed files with 9 additions and 3 deletions

View file

@ -11351,14 +11351,16 @@ scan_discrim_bound (const char *str, int k, struct value *dval, LONGEST * px,
return 1;
}
/* Value of variable named NAME in the current environment. If
no such variable found, then if ERR_MSG is null, returns 0, and
/* Value of variable named NAME. Only exact matches are considered.
If no such variable found, then if ERR_MSG is null, returns 0, and
otherwise causes an error with message ERR_MSG. */
static struct value *
get_var_value (const char *name, const char *err_msg)
{
lookup_name_info lookup_name (name, symbol_name_match_type::FULL);
std::string quoted_name = add_angle_brackets (name);
lookup_name_info lookup_name (quoted_name, symbol_name_match_type::FULL);
std::vector<struct block_symbol> syms;
int nsyms = ada_lookup_symbol_list_worker (lookup_name,