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:06 -0600 |
commit | 0b7b2c2adff43d39ee3bd39ebd91a6710d9175e4 (patch) | |
tree | 319e0422ab99a88c82017e660b06e7b0e0f27c41 /gdb/quick-symbol.h | |
parent | 90160b57032ce8c2d12864a53036bab2c5b86682 (diff) | |
download | binutils-gdb-0b7b2c2adff43d39ee3bd39ebd91a6710d9175e4.tar.gz |
Simplify quick_symbol_functions::map_matching_symbols
quick_symbol_functions::map_matching_symbols is only used by the Ada
code. Currently, it both expands certain psymtabs and then walks over
the full symtabs -- including any already-expanded ones -- calling a
callback.
It appears to work lazily as well, in that if the callback returns
false, iteration stops. However, only the psymtab implementation does
this; the DWARF index implementations are not lazy. It turns out,
though, that the only callback that is ever passed here never returns
false.
This patch simplifies this method by removing the callback. The
method is also renamed. In the new scheme, the caller is responsible
for walking the full symtabs, which removes some redundancy as well.
gdb/ChangeLog
2021-04-17 Tom Tromey <tom@tromey.com>
* psymtab.c (psymbol_functions::expand_matching_symbols): Rename
from map_matching_symbols. Change parameters.
* psympriv.h (struct psymbol_functions) <expand_matching_symbols>:
Rename from map_matching_symbols. Change parameters.
* dwarf2/read.c (struct dwarf2_gdb_index)
<expand_matching_symbols>: Rename from map_matching_symbols.
Change parameters.
(struct dwarf2_debug_names_index) <expand_matching_symbols>:
Rename from map_matching_symbols. Change parameters.
(dwarf2_gdb_index::expand_matching_symbols): Rename from
dw2_map_matching_symbols. Change parameters.
(dwarf2_gdb_index::expand_matching_symbols): Remove old
implementation.
(dwarf2_debug_names_index::expand_matching_symbols): Rename from
map_matching_symbols. Change parameters.
* objfiles.h (struct objfile) <expand_matching_symbols>: Rename
from map_matching_symbols. Change parameters.
* symfile-debug.c (objfile::expand_matching_symbols): Rename from
map_matching_symbols. Change parameters.
* ada-lang.c (map_matching_symbols): New function.
(add_nonlocal_symbols): Update.
Diffstat (limited to 'gdb/quick-symbol.h')
-rw-r--r-- | gdb/quick-symbol.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gdb/quick-symbol.h b/gdb/quick-symbol.h index d883d7b0c1b..f06ceff41c2 100644 --- a/gdb/quick-symbol.h +++ b/gdb/quick-symbol.h @@ -120,11 +120,10 @@ struct quick_symbol_functions virtual void expand_all_symtabs (struct objfile *objfile) = 0; /* Find global or static symbols in all tables that are in DOMAIN - and for which MATCH (symbol name, NAME) == 0, passing each to - CALLBACK, reading in partial symbol tables as needed. Look - through global symbols if GLOBAL and otherwise static symbols. - Passes NAME and NAMESPACE to CALLBACK with each symbol - found. After each block is processed, passes NULL to CALLBACK. + and for which MATCH (symbol name, NAME) == 0, reading in partial + symbol tables as needed. Look through global symbols if GLOBAL + and otherwise static symbols. + MATCH must be weaker than strcmp_iw_ordered in the sense that strcmp_iw_ordered(x,y) == 0 --> MATCH(x,y) == 0. ORDERED_COMPARE, if non-null, must be an ordering relation compatible with @@ -133,15 +132,13 @@ struct quick_symbol_functions and strcmp_iw_ordered(x,y) <= 0 --> ORDERED_COMPARE(x,y) <= 0 (allowing strcmp_iw_ordered(x,y) < 0 while ORDERED_COMPARE(x, y) == 0). - CALLBACK returns true to indicate that the scan should continue, or - false to indicate that the scan should be terminated. */ + */ - virtual void map_matching_symbols + virtual void expand_matching_symbols (struct objfile *, const lookup_name_info &lookup_name, domain_enum domain, int global, - gdb::function_view<symbol_found_callback_ftype> callback, symbol_compare_ftype *ordered_compare) = 0; /* Expand all symbol tables in OBJFILE matching some criteria. |