diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-05-01 22:12:12 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-06-02 13:53:10 +0100 |
commit | 54f4ca4610893424746e56997115b71bc31ffd8a (patch) | |
tree | 4a660e5bde10957e3f8a5b2a2225c41a60e5a5e7 /gdb | |
parent | 1fb314aaa3142711e452e66c2dced781a4d1ef87 (diff) | |
download | gdb-54f4ca4610893424746e56997115b71bc31ffd8a.zip gdb-54f4ca4610893424746e56997115b71bc31ffd8a.tar.gz gdb-54f4ca4610893424746e56997115b71bc31ffd8a.tar.bz2 |
gdb: Convert language la_lookup_transparent_type field to a method
This commit changes the language_data::la_lookup_transparent_type
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_language_data): Delete
la_lookup_transparent_type initializer.
* c-lang.c (c_language_data): Likewise.
(cplus_language_data): Likewise.
(cplus_language::lookup_transparent_type): New member function.
(asm_language_data): Delete la_lookup_transparent_type
initializer.
(minimal_language_data): Likewise.
* d-lang.c (d_language_data): Likewise.
* f-lang.c (f_language_data): Likewise.
* go-lang.c (go_language_data): Likewise.
* language.c (unknown_language_data): Likewise.
(auto_language_data): Likewise.
* language.h (struct language_data): Delete
la_lookup_transparent_type field.
(language_defn::lookup_transparent_type): New member function.
* m2-lang.c (m2_language_data): Delete la_lookup_transparent_type
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 (symbol_matches_domain): Update call.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 26 | ||||
-rw-r--r-- | gdb/ada-lang.c | 1 | ||||
-rw-r--r-- | gdb/c-lang.c | 10 | ||||
-rw-r--r-- | gdb/d-lang.c | 1 | ||||
-rw-r--r-- | gdb/f-lang.c | 1 | ||||
-rw-r--r-- | gdb/go-lang.c | 1 | ||||
-rw-r--r-- | gdb/language.c | 2 | ||||
-rw-r--r-- | gdb/language.h | 10 | ||||
-rw-r--r-- | gdb/m2-lang.c | 1 | ||||
-rw-r--r-- | gdb/objc-lang.c | 1 | ||||
-rw-r--r-- | gdb/opencl-lang.c | 1 | ||||
-rw-r--r-- | gdb/p-lang.c | 1 | ||||
-rw-r--r-- | gdb/rust-lang.c | 1 | ||||
-rw-r--r-- | gdb/symtab.c | 2 |
14 files changed, 40 insertions, 19 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4a0dbd1..d10a0db 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,31 @@ 2020-06-02 Andrew Burgess <andrew.burgess@embecosm.com> + * ada-lang.c (ada_language_data): Delete + la_lookup_transparent_type initializer. + * c-lang.c (c_language_data): Likewise. + (cplus_language_data): Likewise. + (cplus_language::lookup_transparent_type): New member function. + (asm_language_data): Delete la_lookup_transparent_type + initializer. + (minimal_language_data): Likewise. + * d-lang.c (d_language_data): Likewise. + * f-lang.c (f_language_data): Likewise. + * go-lang.c (go_language_data): Likewise. + * language.c (unknown_language_data): Likewise. + (auto_language_data): Likewise. + * language.h (struct language_data): Delete + la_lookup_transparent_type field. + (language_defn::lookup_transparent_type): New member function. + * m2-lang.c (m2_language_data): Delete la_lookup_transparent_type + 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 (symbol_matches_domain): Update call. + +2020-06-02 Andrew Burgess <andrew.burgess@embecosm.com> + * ada-lang.c (ada_language_arch_info): Delete function, move implementation to... (ada_language::language_arch_info): ...here, a new member diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index a1cd04b..7d23fd5 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -13988,7 +13988,6 @@ extern const struct language_data ada_language_data = NULL, /* name_of_this */ true, /* la_store_sym_names_in_linkage_form_p */ ada_lookup_symbol_nonlocal, /* Looking up non-local symbols. */ - basic_lookup_transparent_type, /* lookup_transparent_type */ ada_la_decode, /* Language specific symbol demangler */ ada_sniff_from_mangled_name, NULL, /* Language specific diff --git a/gdb/c-lang.c b/gdb/c-lang.c index e82d058..aa1efa0 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -911,7 +911,6 @@ extern const struct language_data c_language_data = NULL, /* name_of_this */ true, /* la_store_sym_names_in_linkage_form_p */ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ - basic_lookup_transparent_type,/* lookup_transparent_type */ NULL, /* Language specific symbol demangler */ NULL, NULL, /* Language specific @@ -1012,7 +1011,6 @@ extern const struct language_data cplus_language_data = "this", /* name_of_this */ false, /* la_store_sym_names_in_linkage_form_p */ cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ - cp_lookup_transparent_type, /* lookup_transparent_type */ gdb_demangle, /* Language specific symbol demangler */ gdb_sniff_from_mangled_name, cp_class_name_from_physname, /* Language specific @@ -1112,6 +1110,12 @@ public: lai->bool_type_symbol = "bool"; lai->bool_type_default = builtin->builtin_bool; } + + /* See language.h. */ + struct type *lookup_transparent_type (const char *name) const override + { + return cp_lookup_transparent_type (name); + } }; /* The single instance of the C++ language class. */ @@ -1149,7 +1153,6 @@ extern const struct language_data asm_language_data = NULL, /* name_of_this */ true, /* la_store_sym_names_in_linkage_form_p */ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ - basic_lookup_transparent_type,/* lookup_transparent_type */ NULL, /* Language specific symbol demangler */ NULL, NULL, /* Language specific @@ -1221,7 +1224,6 @@ extern const struct language_data minimal_language_data = NULL, /* name_of_this */ true, /* la_store_sym_names_in_linkage_form_p */ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ - basic_lookup_transparent_type,/* lookup_transparent_type */ NULL, /* Language specific symbol demangler */ NULL, NULL, /* Language specific diff --git a/gdb/d-lang.c b/gdb/d-lang.c index 778d773..8c4ee44 100644 --- a/gdb/d-lang.c +++ b/gdb/d-lang.c @@ -165,7 +165,6 @@ extern const struct language_data d_language_data = "this", false, /* la_store_sym_names_in_linkage_form_p */ d_lookup_symbol_nonlocal, - basic_lookup_transparent_type, d_demangle, /* Language specific symbol demangler. */ d_sniff_from_mangled_name, NULL, /* Language specific diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 1eeb507..32435fa 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -616,7 +616,6 @@ extern const struct language_data f_language_data = NULL, /* name_of_this */ false, /* la_store_sym_names_in_linkage_form_p */ cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ - basic_lookup_transparent_type,/* lookup_transparent_type */ /* We could support demangling here to provide module namespaces also for inferiors with only minimal symbol table (ELF symbols). diff --git a/gdb/go-lang.c b/gdb/go-lang.c index 7340a33..22dd02f 100644 --- a/gdb/go-lang.c +++ b/gdb/go-lang.c @@ -550,7 +550,6 @@ extern const struct language_data go_language_data = NULL, /* name_of_this */ false, /* la_store_sym_names_in_linkage_form_p */ basic_lookup_symbol_nonlocal, - basic_lookup_transparent_type, go_demangle, /* Language specific symbol demangler. */ go_sniff_from_mangled_name, NULL, /* Language specific diff --git a/gdb/language.c b/gdb/language.c index bc714ba..227f26b 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -827,7 +827,6 @@ extern const struct language_data unknown_language_data = "this", /* name_of_this */ true, /* store_sym_names_in_linkage_form_p */ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ - basic_lookup_transparent_type,/* lookup_transparent_type */ unk_lang_demangle, /* Language specific symbol demangler */ NULL, unk_lang_class_name, /* Language specific @@ -895,7 +894,6 @@ extern const struct language_data auto_language_data = "this", /* name_of_this */ false, /* store_sym_names_in_linkage_form_p */ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ - basic_lookup_transparent_type,/* lookup_transparent_type */ unk_lang_demangle, /* Language specific symbol demangler */ NULL, unk_lang_class_name, /* Language specific diff --git a/gdb/language.h b/gdb/language.h index 4cf16c1..505600a 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -315,9 +315,6 @@ struct language_data const struct block *, const domain_enum); - /* Find the definition of the type with the given name. */ - struct type *(*la_lookup_transparent_type) (const char *); - /* Return demangled language symbol, or NULL. */ char *(*la_demangle) (const char *mangled, int options); @@ -504,6 +501,13 @@ struct language_defn : language_data virtual void language_arch_info (struct gdbarch *, struct language_arch_info *) const = 0; + /* Find the definition of the type with the given name. */ + + virtual struct type *lookup_transparent_type (const char *name) const + { + return basic_lookup_transparent_type (name); + } + /* List of all known languages. */ static const struct language_defn *languages[nr_languages]; }; diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index 16738e1..9ce6f2a 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -375,7 +375,6 @@ extern const struct language_data m2_language_data = NULL, /* name_of_this */ false, /* la_store_sym_names_in_linkage_form_p */ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ - basic_lookup_transparent_type,/* lookup_transparent_type */ NULL, /* Language specific symbol demangler */ NULL, NULL, /* Language specific diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 87e5e68..040226c 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -390,7 +390,6 @@ extern const struct language_data objc_language_data = "self", /* name_of_this */ false, /* la_store_sym_names_in_linkage_form_p */ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ - basic_lookup_transparent_type,/* lookup_transparent_type */ objc_demangle, /* Language specific symbol demangler */ objc_sniff_from_mangled_name, NULL, /* Language specific diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index e8e5e8e..1c41ffd 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -1050,7 +1050,6 @@ extern const struct language_data opencl_language_data = NULL, /* name_of_this */ false, /* la_store_sym_names_in_linkage_form_p */ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ - basic_lookup_transparent_type,/* lookup_transparent_type */ NULL, /* Language specific symbol demangler */ NULL, NULL, /* Language specific diff --git a/gdb/p-lang.c b/gdb/p-lang.c index 4c13867..d2d8b5e 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -406,7 +406,6 @@ extern const struct language_data pascal_language_data = "this", /* name_of_this */ false, /* la_store_sym_names_in_linkage_form_p */ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ - basic_lookup_transparent_type,/* lookup_transparent_type */ NULL, /* Language specific symbol demangler */ NULL, NULL, /* Language specific class_name_from_physname */ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index dd8558a..65f2324 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -2082,7 +2082,6 @@ extern const struct language_data rust_language_data = NULL, /* name_of_this */ false, /* la_store_sym_names_in_linkage_form_p */ rust_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ - basic_lookup_transparent_type,/* lookup_transparent_type */ gdb_demangle, /* Language specific symbol demangler */ rust_sniff_from_mangled_name, NULL, /* Language specific diff --git a/gdb/symtab.c b/gdb/symtab.c index 5c4e282..f333ea6 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2722,7 +2722,7 @@ symbol_matches_domain (enum language symbol_language, struct type * lookup_transparent_type (const char *name) { - return current_language->la_lookup_transparent_type (name); + return current_language->lookup_transparent_type (name); } /* A helper for basic_lookup_transparent_type that interfaces with the |