aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-05-08 14:21:22 -0600
committerTom Tromey <tromey@adacore.com>2020-05-08 14:21:22 -0600
commit94c93c35b50d0783fdfda277508d0ae6c3e372fb (patch)
treee7df63b540b33dc1f070c3394b1ad942121470eb /gdb/linespec.c
parenta1fd1ac9def557cbb7570cf90178a00cb26e7fef (diff)
downloadgdb-94c93c35b50d0783fdfda277508d0ae6c3e372fb.zip
gdb-94c93c35b50d0783fdfda277508d0ae6c3e372fb.tar.gz
gdb-94c93c35b50d0783fdfda277508d0ae6c3e372fb.tar.bz2
Remove ALL_PSPACES
This removes the ALL_PSPACES macro. In this case it seemed cleanest to change how program spaces are stored -- instead of using a linked list, they are now stored in a std::vector. gdb/ChangeLog 2020-05-08 Tom Tromey <tom@tromey.com> * symtab.c (set_symbol_cache_size) (maintenance_print_symbol_cache, maintenance_flush_symbol_cache) (maintenance_print_symbol_cache_statistics): Update. * symmisc.c (print_symbol_bcache_statistics) (print_objfile_statistics, maintenance_print_objfiles) (maintenance_info_symtabs, maintenance_check_symtabs) (maintenance_expand_symtabs, maintenance_info_line_tables): Update. * symfile-debug.c (set_debug_symfile): Update. * source.c (forget_cached_source_info): Update. * python/python.c (gdbpy_progspaces): Update. * psymtab.c (maintenance_info_psymtabs): Update. * probe.c (parse_probes): Update. * linespec.c (iterate_over_all_matching_symtabs) (collect_symtabs_from_filename, search_minsyms_for_name): Update. * guile/scm-progspace.c (gdbscm_progspaces): Update. * exec.c (exec_target::close): Update. * ada-tasks.c (ada_tasks_new_objfile_observer): Update. * breakpoint.c (print_one_breakpoint_location) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint): Update. * progspace.c (program_spaces): Now a std::vector. (maybe_new_address_space): Update. (add_program_space): Remove. (program_space::program_space): Update. (remove_program_space): Update. (number_of_program_spaces): Remove. (print_program_space, update_address_spaces): Update. * progspace.h (program_spaces): Change type. (ALL_PSPACES): Remove. (number_of_program_spaces): Don't declare. (struct program_space) <next>: Remove.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c136
1 files changed, 65 insertions, 71 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 6007cd2..1f28987 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -1133,58 +1133,56 @@ iterate_over_all_matching_symtabs
struct program_space *search_pspace, bool include_inline,
gdb::function_view<symbol_found_callback_ftype> callback)
{
- struct program_space *pspace;
-
- ALL_PSPACES (pspace)
- {
- if (search_pspace != NULL && search_pspace != pspace)
- continue;
- if (pspace->executing_startup)
- continue;
+ for (struct program_space *pspace : program_spaces)
+ {
+ if (search_pspace != NULL && search_pspace != pspace)
+ continue;
+ if (pspace->executing_startup)
+ continue;
- set_current_program_space (pspace);
+ set_current_program_space (pspace);
- for (objfile *objfile : current_program_space->objfiles ())
- {
- if (objfile->sf)
- objfile->sf->qf->expand_symtabs_matching (objfile,
- NULL,
- &lookup_name,
- NULL, NULL,
- search_domain);
-
- for (compunit_symtab *cu : objfile->compunits ())
- {
- struct symtab *symtab = COMPUNIT_FILETABS (cu);
+ for (objfile *objfile : current_program_space->objfiles ())
+ {
+ if (objfile->sf)
+ objfile->sf->qf->expand_symtabs_matching (objfile,
+ NULL,
+ &lookup_name,
+ NULL, NULL,
+ search_domain);
+
+ for (compunit_symtab *cu : objfile->compunits ())
+ {
+ struct symtab *symtab = COMPUNIT_FILETABS (cu);
- iterate_over_file_blocks (symtab, lookup_name, name_domain,
- callback);
+ iterate_over_file_blocks (symtab, lookup_name, name_domain,
+ callback);
- if (include_inline)
- {
- const struct block *block;
- int i;
+ if (include_inline)
+ {
+ const struct block *block;
+ int i;
- for (i = FIRST_LOCAL_BLOCK;
- i < BLOCKVECTOR_NBLOCKS (SYMTAB_BLOCKVECTOR (symtab));
- i++)
- {
- block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab), i);
- state->language->la_iterate_over_symbols
- (block, lookup_name, name_domain,
- [&] (block_symbol *bsym)
- {
- /* Restrict calls to CALLBACK to symbols
- representing inline symbols only. */
- if (SYMBOL_INLINED (bsym->symbol))
- return callback (bsym);
- return true;
- });
- }
- }
- }
- }
- }
+ for (i = FIRST_LOCAL_BLOCK;
+ i < BLOCKVECTOR_NBLOCKS (SYMTAB_BLOCKVECTOR (symtab));
+ i++)
+ {
+ block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab), i);
+ state->language->la_iterate_over_symbols
+ (block, lookup_name, name_domain,
+ [&] (block_symbol *bsym)
+ {
+ /* Restrict calls to CALLBACK to symbols
+ representing inline symbols only. */
+ if (SYMBOL_INLINED (bsym->symbol))
+ return callback (bsym);
+ return true;
+ });
+ }
+ }
+ }
+ }
+ }
}
/* Returns the block to be used for symbol searches from
@@ -3786,9 +3784,7 @@ collect_symtabs_from_filename (const char *file,
/* Find that file's data. */
if (search_pspace == NULL)
{
- struct program_space *pspace;
-
- ALL_PSPACES (pspace)
+ for (struct program_space *pspace : program_spaces)
{
if (pspace->executing_startup)
continue;
@@ -4335,29 +4331,27 @@ search_minsyms_for_name (struct collect_info *info,
if (symtab == NULL)
{
- struct program_space *pspace;
-
- ALL_PSPACES (pspace)
- {
- if (search_pspace != NULL && search_pspace != pspace)
- continue;
- if (pspace->executing_startup)
- continue;
+ for (struct program_space *pspace : program_spaces)
+ {
+ if (search_pspace != NULL && search_pspace != pspace)
+ continue;
+ if (pspace->executing_startup)
+ continue;
- set_current_program_space (pspace);
+ set_current_program_space (pspace);
- for (objfile *objfile : current_program_space->objfiles ())
- {
- iterate_over_minimal_symbols (objfile, name,
- [&] (struct minimal_symbol *msym)
- {
- add_minsym (msym, objfile, nullptr,
- info->state->list_mode,
- &minsyms);
- return false;
- });
- }
- }
+ for (objfile *objfile : current_program_space->objfiles ())
+ {
+ iterate_over_minimal_symbols (objfile, name,
+ [&] (struct minimal_symbol *msym)
+ {
+ add_minsym (msym, objfile, nullptr,
+ info->state->list_mode,
+ &minsyms);
+ return false;
+ });
+ }
+ }
}
else
{