Rename la_get_symbol_name_match_p into la_get_symbol_name_cmp

The la_get_symbol_name_match_p language hook was poorly named, as
it suggested that the function should return nonzero if the names
match, whereas it is the exact opposite.  This patch therefore
renames the hook and associated typedef, as well some of the code
that uses that hook.

gdb/ChangeLog:

        * language.h (symbol_name_cmp_ftype): Renames
        symbol_name_match_p_ftype.
        (struct language_defn)[la_get_symbol_name_cmp]: Renames
        la_get_symbol_name_match_p.
        * ada-lang.c (ada_get_symbol_name_cmp): Renames
        ada_get_symbol_name_match_p.  Update comment.
        (ada_language_defn)[la_get_symbol_name_cmp]: Update value.
        * linespec.c (struct symbol_matcher_data)[symbol_name_cmp]:
        Renames symbol_name_match_p.  Update field type.
        (iterate_name_matcher, iterate_over_all_matching_symtabs): Adjust.
        * c-lang.c, d-lang.c, f-lang.c, jv-lang.c, m2-lang.c, objc-lang.c,
        opencl-lang.c, p-lang.c: Replace "la_get_symbol_name_match_p" by
        "la_get_symbol_name_cmp" in comments.
        * language.c: Likewise.
This commit is contained in:
Joel Brobecker 2012-02-08 19:54:37 +00:00
parent 97298d2971
commit 1a119f3613
13 changed files with 42 additions and 26 deletions

View file

@ -1,3 +1,20 @@
2012-02-08 Joel Brobecker <brobecker@adacore.com>
* language.h (symbol_name_cmp_ftype): Renames
symbol_name_match_p_ftype.
(struct language_defn)[la_get_symbol_name_cmp]: Renames
la_get_symbol_name_match_p.
* ada-lang.c (ada_get_symbol_name_cmp): Renames
ada_get_symbol_name_match_p. Update comment.
(ada_language_defn)[la_get_symbol_name_cmp]: Update value.
* linespec.c (struct symbol_matcher_data)[symbol_name_cmp]:
Renames symbol_name_match_p. Update field type.
(iterate_name_matcher, iterate_over_all_matching_symtabs): Adjust.
* c-lang.c, d-lang.c, f-lang.c, jv-lang.c, m2-lang.c, objc-lang.c,
opencl-lang.c, p-lang.c: Replace "la_get_symbol_name_match_p" by
"la_get_symbol_name_cmp" in comments.
* language.c: Likewise.
2012-02-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* amd64-sol2-tdep.c (amd64_sol2_gregset_reg_offset): Correct

View file

@ -12322,11 +12322,11 @@ static const struct exp_descriptor ada_exp_descriptor = {
ada_evaluate_subexp
};
/* Implement the "la_get_symbol_name_match_p" language_defn method
/* Implement the "la_get_symbol_name_cmp" language_defn method
for Ada. */
static symbol_name_match_p_ftype
ada_get_symbol_name_match_p (const char *lookup_name)
static symbol_name_cmp_ftype
ada_get_symbol_name_cmp (const char *lookup_name)
{
if (should_use_wild_match (lookup_name))
return wild_match;
@ -12370,7 +12370,7 @@ const struct language_defn ada_language_defn = {
ada_print_array_index,
default_pass_by_reference,
c_get_string,
ada_get_symbol_name_match_p, /* la_get_symbol_name_match_p */
ada_get_symbol_name_cmp, /* la_get_symbol_name_cmp */
ada_iterate_over_symbols,
LANG_MAGIC
};

View file

@ -863,7 +863,7 @@ const struct language_defn c_language_defn =
default_print_array_index,
default_pass_by_reference,
c_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
LANG_MAGIC
};
@ -986,7 +986,7 @@ const struct language_defn cplus_language_defn =
default_print_array_index,
cp_pass_by_reference,
c_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
LANG_MAGIC
};
@ -1027,7 +1027,7 @@ const struct language_defn asm_language_defn =
default_print_array_index,
default_pass_by_reference,
c_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
LANG_MAGIC
};
@ -1073,7 +1073,7 @@ const struct language_defn minimal_language_defn =
default_print_array_index,
default_pass_by_reference,
c_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
LANG_MAGIC
};

View file

@ -272,7 +272,7 @@ static const struct language_defn d_language_defn =
default_print_array_index,
default_pass_by_reference,
c_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
NULL,
LANG_MAGIC
};

View file

@ -309,7 +309,7 @@ const struct language_defn f_language_defn =
default_print_array_index,
default_pass_by_reference,
default_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
LANG_MAGIC
};

View file

@ -1196,7 +1196,7 @@ const struct language_defn java_language_defn =
default_print_array_index,
default_pass_by_reference,
default_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
LANG_MAGIC
};

View file

@ -933,7 +933,7 @@ const struct language_defn unknown_language_defn =
default_print_array_index,
default_pass_by_reference,
default_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
LANG_MAGIC
};
@ -976,7 +976,7 @@ const struct language_defn auto_language_defn =
default_print_array_index,
default_pass_by_reference,
default_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
LANG_MAGIC
};
@ -1017,7 +1017,7 @@ const struct language_defn local_language_defn =
default_print_array_index,
default_pass_by_reference,
default_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
LANG_MAGIC
};

View file

@ -143,7 +143,7 @@ struct language_arch_info
LOOKUP_NAME should be the name of an entity after it has been
transformed for lookup. */
typedef int (*symbol_name_match_p_ftype) (const char *symbol_search_name,
typedef int (*symbol_name_cmp_ftype) (const char *symbol_search_name,
const char *lookup_name);
/* Structure tying together assorted information about a language. */
@ -334,8 +334,7 @@ struct language_defn
This field may be NULL, in which case strcmp_iw will be used
to perform the matching. */
symbol_name_match_p_ftype (*la_get_symbol_name_match_p)
(const char *lookup_name);
symbol_name_cmp_ftype (*la_get_symbol_name_cmp) (const char *lookup_name);
/* Find all symbols in the current program space matching NAME in
DOMAIN, according to this language's rules.

View file

@ -329,7 +329,7 @@ struct symbol_matcher_data
const char *lookup_name;
/* The routine to be used for comparison. */
symbol_name_match_p_ftype symbol_name_match_p;
symbol_name_cmp_ftype symbol_name_cmp;
};
/* A helper for iterate_over_all_matching_symtabs that is passed as a
@ -340,7 +340,7 @@ iterate_name_matcher (const char *name, void *d)
{
const struct symbol_matcher_data *data = d;
if (data->symbol_name_match_p (name, data->lookup_name) == 0)
if (data->symbol_name_cmp (name, data->lookup_name) == 0)
return 1; /* Expand this symbol's symbol table. */
return 0; /* Skip this symbol. */
}
@ -362,9 +362,9 @@ iterate_over_all_matching_symtabs (const char *name,
struct symbol_matcher_data matcher_data;
matcher_data.lookup_name = name;
matcher_data.symbol_name_match_p =
current_language->la_get_symbol_name_match_p != NULL
? current_language->la_get_symbol_name_match_p (name)
matcher_data.symbol_name_cmp =
current_language->la_get_symbol_name_cmp != NULL
? current_language->la_get_symbol_name_cmp (name)
: strcmp_iw;
ALL_PSPACES (pspace)

View file

@ -401,7 +401,7 @@ const struct language_defn m2_language_defn =
default_print_array_index,
default_pass_by_reference,
default_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
LANG_MAGIC
};

View file

@ -540,7 +540,7 @@ const struct language_defn objc_language_defn = {
default_print_array_index,
default_pass_by_reference,
default_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
LANG_MAGIC
};

View file

@ -1024,7 +1024,7 @@ const struct language_defn opencl_language_defn =
default_print_array_index,
default_pass_by_reference,
c_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
LANG_MAGIC
};

View file

@ -459,7 +459,7 @@ const struct language_defn pascal_language_defn =
default_print_array_index,
default_pass_by_reference,
default_get_string,
NULL, /* la_get_symbol_name_match_p */
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
LANG_MAGIC
};