aboutsummaryrefslogtreecommitdiff
path: root/gdb/quick-symbol.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-04-17 09:35:04 -0600
committerTom Tromey <tom@tromey.com>2021-04-17 09:35:05 -0600
commitdf35e6262da99acc80bb88d669975f0b52e33876 (patch)
treedbef71936b779e3fec07ed64db0a7570186da308 /gdb/quick-symbol.h
parente357e9904cad07ba6aaaa2d1aa06de2c52464486 (diff)
downloadfsf-binutils-gdb-df35e6262da99acc80bb88d669975f0b52e33876.zip
fsf-binutils-gdb-df35e6262da99acc80bb88d669975f0b52e33876.tar.gz
fsf-binutils-gdb-df35e6262da99acc80bb88d669975f0b52e33876.tar.bz2
Let expand_symtabs_matching short-circuit
This changes expand_symtabs_exp_notify_ftype to return bool, and updates all the uses. Now, if the notification function returns false, the call is short-circuited and stops examining symtabs. This is a step toward replacing map_symtabs_matching_filename with expand_symtabs_matching. gdb/ChangeLog 2021-04-17 Tom Tromey <tom@tromey.com> * symtab.c (default_collect_symbol_completion_matches_break_on): Update. * symfile.h (expand_symtabs_matching): Return bool. * symfile.c (expand_symtabs_matching): Return bool. * symfile-debug.c (objfile::expand_symtabs_matching): Return bool. * quick-symbol.h (expand_symtabs_exp_notify_ftype): Return bool. (struct quick_symbol_functions) <expand_symtabs_matching>: Return bool. * psymtab.c (psymbol_functions::expand_symtabs_matching): Return bool. * psympriv.h (struct psymbol_functions) <expand_symtabs_matching>: Return bool. * objfiles.h (struct objfile) <expand_symtabs_matching>: Return bool. * dwarf2/read.c (struct dwarf2_gdb_index) <expand_symtabs_matching>: Return bool. (struct dwarf2_debug_names_index) <expand_symtabs_matching>: Return bool. (dw2_expand_symtabs_matching_symbol): Return bool. (dw2_expand_symtabs_matching_one, dw2_expand_marked_cus) (dw2_expand_symtabs_matching) (dwarf2_gdb_index::expand_symtabs_matching) (dwarf2_debug_names_index::expand_symtabs_matching) (dwarf2_debug_names_index::expand_symtabs_matching): Return bool.
Diffstat (limited to 'gdb/quick-symbol.h')
-rw-r--r--gdb/quick-symbol.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/quick-symbol.h b/gdb/quick-symbol.h
index 7e22108..37601d8 100644
--- a/gdb/quick-symbol.h
+++ b/gdb/quick-symbol.h
@@ -52,9 +52,11 @@ typedef bool (expand_symtabs_file_matcher_ftype) (const char *filename,
typedef bool (expand_symtabs_symbol_matcher_ftype) (const char *name);
/* Callback for quick_symbol_functions->expand_symtabs_matching
- to be called after a symtab has been expanded. */
+ to be called after a symtab has been expanded. If this returns
+ true, more symtabs are checked; if it returns false, iteration
+ stops. */
-typedef void (expand_symtabs_exp_notify_ftype) (compunit_symtab *symtab);
+typedef bool (expand_symtabs_exp_notify_ftype) (compunit_symtab *symtab);
/* The "quick" symbol functions exist so that symbol readers can
avoiding an initial read of all the symbols. For example, symbol
@@ -206,8 +208,12 @@ struct quick_symbol_functions
If SYMBOL_MATCHER returns false, then the symbol is skipped.
- Otherwise, the symbol's symbol table is expanded. */
- virtual void expand_symtabs_matching
+ Otherwise, the symbol's symbol table is expanded and the
+ notification function is called. If the notification function
+ returns false, execution stops and this method returns false.
+ Otherwise, more files are considered. This method will return
+ true if all calls to the notification function return true. */
+ virtual bool expand_symtabs_matching
(struct objfile *objfile,
gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
const lookup_name_info *lookup_name,