aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.h
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-06-01 22:17:59 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-06-17 09:25:12 +0100
commita78a19b15254de31c3d38b7e27469aaef0a30e97 (patch)
tree0fe1497b95f1c0c554eaabbfd170fdd949562a70 /gdb/language.h
parentebe2334ee6cb065d2a86688bc9558d62320dd459 (diff)
downloadgdb-a78a19b15254de31c3d38b7e27469aaef0a30e97.zip
gdb-a78a19b15254de31c3d38b7e27469aaef0a30e97.tar.gz
gdb-a78a19b15254de31c3d38b7e27469aaef0a30e97.tar.bz2
gdb: Convert language la_lookup_symbol_nonlocal field to a method
This commit changes the language_data::la_lookup_symbol_nonlocal 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_lookup_symbol_nonlocal): Rename to ada_language::lookup_symbol_nonlocal. (ada_language_data): Delete la_lookup_symbol_nonlocal initializer. (ada_language::lookup_symbol_nonlocal): New member function, implementation from ada_lookup_symbol_nonlocal. * c-lang.c (c_language_data): Delete la_lookup_symbol_nonlocal initializer. (cplus_language_data): Delete la_lookup_symbol_nonlocal initializer. (cplus_language::lookup_symbol_nonlocal): New member function. (asm_language_data): Delete la_lookup_symbol_nonlocal initializer. (minimal_language_data) Likewise. * cp-namespace.c (cp_lookup_nested_symbol): Update comment. * d-lang.c (d_language_data): Delete la_lookup_symbol_nonlocal initializer. (d_language::lookup_symbol_nonlocal): New member function. * f-lang.c (f_language_data): Delete la_lookup_symbol_nonlocal initializer. (f_language::lookup_symbol_nonlocal): New member function. * go-lang.c (go_language_data): Delete la_lookup_symbol_nonlocal initializer. * language.c (unknown_language_data): Likewise. (auto_language_data): Likewise. * language.h (language_data): Delete la_lookup_symbol_nonlocal field. (language_defn::lookup_symbol_nonlocal): New member function. * m2-lang.c (m2_language_data): Delete la_lookup_symbol_nonlocal 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_lookup_symbol_nonlocal): Rename to rust_language::lookup_symbol_nonlocal. (rust_language_data): Delete la_lookup_symbol_nonlocal initializer. (rust_language::lookup_symbol_nonlocal): New member function, implementation from rust_lookup_symbol_nonlocal. * symtab.c (lookup_symbol_aux): Update call to lookup_symbol_nonlocal. (basic_lookup_symbol_nonlocal): Rename to... (language_defn::lookup_symbol_nonlocal): ...this, and update header comment. Remove language_defn parameter, and replace with uses of `this'. * symtab.h (basic_lookup_symbol_nonlocal): Delete declaration.
Diffstat (limited to 'gdb/language.h')
-rw-r--r--gdb/language.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/gdb/language.h b/gdb/language.h
index 06978d7..2149487 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -285,16 +285,6 @@ struct language_data
const bool la_store_sym_names_in_linkage_form_p;
- /* This is a function that lookup_symbol will call when it gets to
- the part of symbol lookup where C looks up static and global
- variables. */
-
- struct block_symbol (*la_lookup_symbol_nonlocal)
- (const struct language_defn *,
- const char *,
- const struct block *,
- const domain_enum);
-
/* Table for printing expressions. */
const struct op_print *la_op_print_tab;
@@ -522,6 +512,15 @@ struct language_defn : language_data
(tracker, mode, name_match_type, text, word, "", code);
}
+ /* This is a function that lookup_symbol will call when it gets to
+ the part of symbol lookup where C looks up static and global
+ variables. This default implements the basic C lookup rules. */
+
+ virtual struct block_symbol lookup_symbol_nonlocal
+ (const char *name,
+ const struct block *block,
+ const domain_enum domain) const;
+
/* 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. */