aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.h
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-06-01 14:53:55 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-06-17 09:25:10 +0100
commit7e56227dfffddbbb5b648c386c85345929fa0529 (patch)
tree5485717914f83ebd1764952c7d9bc366c6a5ad5a /gdb/language.h
parent53fc67f8b2663261810353ae8e4f9920ae7a1c56 (diff)
downloadgdb-7e56227dfffddbbb5b648c386c85345929fa0529.zip
gdb-7e56227dfffddbbb5b648c386c85345929fa0529.tar.gz
gdb-7e56227dfffddbbb5b648c386c85345929fa0529.tar.bz2
gdb: Convert language la_collect_symbol_completion_matches field to a method
This commit changes the language_data::la_collect_symbol_completion_matches function pointer member variable into a member function of language_defn. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_collect_symbol_completion_matches): Rename to ada_language::collect_symbol_completion_matches. (ada_language_data): Delete la_collect_symbol_completion_matches initializer. (ada_language::collect_symbol_completion_matches): New member function, implementation from ada_collect_symbol_completion_matches. * c-lang.c (c_language_data): Delete la_collect_symbol_completion_matches initializer. (cplus_language_data): Likewise. (asm_language_data): Likewise. (minimal_language_data): Likewise. * d-lang.c (d_language_data): Likewise. * f-lang.c (f_collect_symbol_completion_matches): Rename to f_language::collect_symbol_completion_matches. (f_language_data): Delete la_collect_symbol_completion_matches initializer. (f_language::collect_symbol_completion_matches) New member function, implementation from f_collect_symbol_completion_matches. * go-lang.c (go_language_data): Delete la_collect_symbol_completion_matches initializer. * language.c (unknown_language_data): Likewise. (auto_language_data): Likewise. * language.h (language_data): Delete la_collect_symbol_completion_matches field. (language_defn::collect_symbol_completion_matches): New member function. * m2-lang.c (m2_language_data): Delete la_collect_symbol_completion_matches initializer. * objc-lang.c (objc_language_data): Likewise. * opencl-lang.c (opencl_language_data): Likewise. * p-lang.c (pascal_language_data): Likewise. * rust-lang.c (rust_language_data): Likewise. * symtab.c (default_collect_symbol_completion_matches): Delete. (collect_symbol_completion_matches): Update call to collect_symbol_completion_matches. (collect_symbol_completion_matches_type): Likewise. * symtab.h (default_collect_symbol_completion_matches): Delete declaration.
Diffstat (limited to 'gdb/language.h')
-rw-r--r--gdb/language.h31
1 files changed, 18 insertions, 13 deletions
diff --git a/gdb/language.h b/gdb/language.h
index 8c6f7e3..5872db3 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -319,19 +319,6 @@ struct language_data
/* Index to use for extracting the first element of a string. */
char string_lower_bound;
- /* Add to the completion tracker all symbols which are possible
- completions for TEXT. WORD is the entire command on which the
- completion is being made. If CODE is TYPE_CODE_UNDEF, then all
- symbols should be examined; otherwise, only STRUCT_DOMAIN
- symbols whose type has a code of CODE should be matched. */
- void (*la_collect_symbol_completion_matches)
- (completion_tracker &tracker,
- complete_symbol_mode mode,
- symbol_name_match_type match_type,
- const char *text,
- const char *word,
- enum type_code code);
-
/* Return an expression that can be used for a location
watchpoint. TYPE is a pointer type that points to the memory
to watch, and ADDR is the address of the watched memory. */
@@ -535,6 +522,24 @@ struct language_defn : language_data
return default_word_break_characters ();
}
+ /* Add to the completion tracker all symbols which are possible
+ completions for TEXT. WORD is the entire command on which the
+ completion is being made. If CODE is TYPE_CODE_UNDEF, then all
+ symbols should be examined; otherwise, only STRUCT_DOMAIN symbols
+ whose type has a code of CODE should be matched. */
+
+ virtual void collect_symbol_completion_matches
+ (completion_tracker &tracker,
+ complete_symbol_mode mode,
+ symbol_name_match_type name_match_type,
+ const char *text,
+ const char *word,
+ enum type_code code) const
+ {
+ return default_collect_symbol_completion_matches_break_on
+ (tracker, mode, name_match_type, text, word, "", code);
+ }
+
/* List of all known languages. */
static const struct language_defn *languages[nr_languages];