diff options
author | Tom Tromey <tom@tromey.com> | 2021-04-17 09:35:04 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-04-17 09:35:05 -0600 |
commit | 84d865e39c3739097d7a3481b9c9b6b6fecb2b06 (patch) | |
tree | 564ba47ed285702b5c3a852def5321870287b1c3 /gdb/psymtab.c | |
parent | 3bfa51a75fc18775ea043efb248d0e2c35103202 (diff) | |
download | fsf-binutils-gdb-84d865e39c3739097d7a3481b9c9b6b6fecb2b06.zip fsf-binutils-gdb-84d865e39c3739097d7a3481b9c9b6b6fecb2b06.tar.gz fsf-binutils-gdb-84d865e39c3739097d7a3481b9c9b6b6fecb2b06.tar.bz2 |
Remove quick_symbol_functions::lookup_symbol
This removes quick_symbol_functions, replacing it with calls to
expand_symtabs_matching. Because the replacement is somewhat verbose,
objfile::lookup_symbol is not removed. This consolidates some
duplicated code into this one spot.
gdb/ChangeLog
2021-04-17 Tom Tromey <tom@tromey.com>
* symfile-debug.c (objfile::lookup_symbol): Rewrite.
* quick-symbol.h (struct quick_symbol_functions) <lookup_symbol>:
Remove.
* psymtab.c (psymbol_functions::lookup_symbol): Remove.
* psympriv.h (struct psymbol_functions) <lookup_symbol>: Remove.
* objfiles.h (struct objfile) <lookup_symbol>: Add comment.
* dwarf2/read.c (struct dwarf2_gdb_index) <lookup_symbol>:
Remove.
(struct dwarf2_debug_names_index) <lookup_symbol>: Remove.
(dwarf2_gdb_index::lookup_symbol)
(dwarf2_debug_names_index::lookup_symbol): Remove.
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r-- | gdb/psymtab.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c index c766107..b9b7c7d 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -432,57 +432,6 @@ find_pc_sect_psymbol (struct objfile *objfile, return best; } -/* Psymtab version of lookup_symbol. See its definition in - the definition of quick_symbol_functions in symfile.h. */ - -struct compunit_symtab * -psymbol_functions::lookup_symbol (struct objfile *objfile, - block_enum block_index, const char *name, - const domain_enum domain) -{ - const int psymtab_index = (block_index == GLOBAL_BLOCK ? 1 : 0); - struct compunit_symtab *stab_best = NULL; - - lookup_name_info lookup_name (name, symbol_name_match_type::FULL); - - lookup_name_info psym_lookup_name = lookup_name.make_ignore_params (); - - for (partial_symtab *ps : require_partial_symbols (objfile)) - { - if (!ps->readin_p (objfile) - && lookup_partial_symbol (objfile, ps, psym_lookup_name, - psymtab_index, domain)) - { - struct symbol *sym, *with_opaque = NULL; - struct compunit_symtab *stab = psymtab_to_symtab (objfile, ps); - /* Note: While psymtab_to_symtab can return NULL if the - partial symtab is empty, we can assume it won't here - because lookup_partial_symbol succeeded. */ - const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab); - const struct block *block = BLOCKVECTOR_BLOCK (bv, block_index); - - sym = block_find_symbol (block, name, domain, - block_find_non_opaque_type_preferred, - &with_opaque); - - /* Some caution must be observed with overloaded functions - and methods, since the index will not contain any overload - information (but NAME might contain it). */ - - if (sym != NULL - && SYMBOL_MATCHES_SEARCH_NAME (sym, lookup_name)) - return stab; - if (with_opaque != NULL - && SYMBOL_MATCHES_SEARCH_NAME (with_opaque, lookup_name)) - stab_best = stab; - - /* Keep looking through other psymtabs. */ - } - } - - return stab_best; -} - /* Psymtab version of lookup_global_symbol_language. See its definition in the definition of quick_symbol_functions in symfile.h. */ |