Ada: allow unqualified function names in linespecs

This is the meat, where we replace the old la_symbol_name_compare
language method with the new ada_get_symbol_name_match_p.
It fixes the problem when trying to insert a breakpoint on "+".

gdb/ChangeLog:

        * language.h (symbol_name_match_p_ftype): New typedef.
        (struct language_defn): Replace field la_symbol_name_compare
        by la_get_symbol_name_match_p.
        * ada-lang.c (ada_get_symbol_name_match_p): New function.
        (ada_language_defn): Use it.
        * linespec.c (struct symbol_matcher_data): New type.
        (iterate_name_matcher): Rewrite.
        (iterate_over_all_matching_symtabs): Pass a pointer to
        a symbol_matcher_data struct to expand_symtabs_matching
        instead of just the lookup name.
        * c-lang.c, d-lang.c, jv-lang.c, m2-lang.c, objc-lang.c,
        opencl-lang.c, p-lang.c, language.c: Delete field
        la_symbol_name_compare, and replace by NULL for new field
        la_get_symbol_name_match_p.
        * symfile.h (struct quick_symbol_functions): Update comment.
This commit is contained in:
Joel Brobecker 2012-01-26 04:20:36 +00:00
parent b8b196db1e
commit 74ccd7f58b
14 changed files with 86 additions and 35 deletions

View file

@ -12319,6 +12319,18 @@ static const struct exp_descriptor ada_exp_descriptor = {
ada_evaluate_subexp
};
/* Implement the "la_get_symbol_name_match_p" language_defn method
for Ada. */
static symbol_name_match_p_ftype
ada_get_symbol_name_match_p (const char *lookup_name)
{
if (should_use_wild_match (lookup_name))
return wild_match;
else
return compare_names;
}
const struct language_defn ada_language_defn = {
"ada", /* Language name */
language_ada,
@ -12355,7 +12367,7 @@ const struct language_defn ada_language_defn = {
ada_print_array_index,
default_pass_by_reference,
c_get_string,
compare_names,
ada_get_symbol_name_match_p, /* la_get_symbol_name_match_p */
ada_iterate_over_symbols,
LANG_MAGIC
};