diff options
author | Joel Brobecker <brobecker@gnat.com> | 2012-02-08 19:54:37 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2012-02-08 19:54:37 +0000 |
commit | 1a119f3613c3094c82b127b735b9c69648a37387 (patch) | |
tree | 3deed814f0c862ba4f677195a5a6f6e74dc27477 /gdb | |
parent | 97298d2971cc5c8cbe90566171777c660b74642b (diff) | |
download | gdb-1a119f3613c3094c82b127b735b9c69648a37387.zip gdb-1a119f3613c3094c82b127b735b9c69648a37387.tar.gz gdb-1a119f3613c3094c82b127b735b9c69648a37387.tar.bz2 |
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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 17 | ||||
-rw-r--r-- | gdb/ada-lang.c | 8 | ||||
-rw-r--r-- | gdb/c-lang.c | 8 | ||||
-rw-r--r-- | gdb/d-lang.c | 2 | ||||
-rw-r--r-- | gdb/f-lang.c | 2 | ||||
-rw-r--r-- | gdb/jv-lang.c | 2 | ||||
-rw-r--r-- | gdb/language.c | 6 | ||||
-rw-r--r-- | gdb/language.h | 5 | ||||
-rw-r--r-- | gdb/linespec.c | 10 | ||||
-rw-r--r-- | gdb/m2-lang.c | 2 | ||||
-rw-r--r-- | gdb/objc-lang.c | 2 | ||||
-rw-r--r-- | gdb/opencl-lang.c | 2 | ||||
-rw-r--r-- | gdb/p-lang.c | 2 |
13 files changed, 42 insertions, 26 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index eae43c9..f3569fd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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 diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 49178cf..107df93 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -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 }; diff --git a/gdb/c-lang.c b/gdb/c-lang.c index 9e571ea..767d13a 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -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 }; diff --git a/gdb/d-lang.c b/gdb/d-lang.c index 29dcfe4..80504b4 100644 --- a/gdb/d-lang.c +++ b/gdb/d-lang.c @@ -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 }; diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 7f9afb6..805b143 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -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 }; diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index dc50b40..18a7c19 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -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 }; diff --git a/gdb/language.c b/gdb/language.c index d92830f..49ba21a 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -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 }; diff --git a/gdb/language.h b/gdb/language.h index d4cce95..a47a44d 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -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. diff --git a/gdb/linespec.c b/gdb/linespec.c index da88d17..09d62e5 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -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) diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index d7b16f4..9cd27c9 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -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 }; diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index c45f406..76b97ef 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -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 }; diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index d779591..80f978c 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -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 }; diff --git a/gdb/p-lang.c b/gdb/p-lang.c index 6fe19c4..826d24f 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -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 }; |