@@ -4922,7 +4922,7 @@ ada_lookup_simple_minsym (const char *name)
symbol_name_matcher_ftype *match_name
= ada_get_symbol_name_matcher (lookup_name);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
@@ -5612,7 +5612,7 @@ add_nonlocal_symbols (struct obstack *obstackp,
bool is_wild_match = lookup_name.ada ().wild_match_p ();
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
data.objfile = objfile;
@@ -5645,7 +5645,7 @@ add_nonlocal_symbols (struct obstack *obstackp,
const char *name = ada_lookup_name (lookup_name);
std::string name1 = std::string ("<_ada_") + name + '>';
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
data.objfile = objfile;
objfile->sf->qf->map_matching_symbols (objfile, name1.c_str (),
@@ -6409,7 +6409,7 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
anything that isn't a text symbol (everything else will be
handled by the psymtab code above). */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
@@ -6465,7 +6465,7 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
/* Go through the symtabs and check the externs and statics for
symbols which match. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (compunit_symtab *s : objfile_compunits (objfile))
{
@@ -6484,7 +6484,7 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
}
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (compunit_symtab *s : objfile_compunits (objfile))
{
@@ -13566,7 +13566,7 @@ ada_add_global_exceptions (compiled_regex *preg,
NULL,
VARIABLES_DOMAIN);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (compunit_symtab *s : objfile_compunits (objfile))
{
@@ -236,7 +236,7 @@ find_pc_partial_function (CORE_ADDR pc, const char **name, CORE_ADDR *address,
goto return_cached_value;
msymbol = lookup_minimal_symbol_by_pc_section (mapped_pc, section);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (objfile->sf)
{
@@ -3205,7 +3205,7 @@ create_overlay_event_breakpoint (void)
{
const char *const func_name = "_ovly_debug_event";
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
struct breakpoint *b;
struct breakpoint_objfile_data *bp_objfile_data;
@@ -3263,7 +3263,7 @@ create_longjmp_master_breakpoint (void)
{
set_current_program_space (pspace);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
int i;
struct gdbarch *gdbarch;
@@ -3366,7 +3366,7 @@ create_std_terminate_master_breakpoint (void)
set_current_program_space (pspace);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
struct breakpoint *b;
struct breakpoint_objfile_data *bp_objfile_data;
@@ -3411,7 +3411,7 @@ create_exception_master_breakpoint (void)
{
const char *const func_name = "_Unwind_DebugHook";
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
struct breakpoint *b;
struct gdbarch *gdbarch;
@@ -82,7 +82,7 @@ do_module_cleanup (void *arg, int registers_valid)
}
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
if ((objfile->flags & OBJF_USERLOADED) == 0
&& (strcmp (objfile_name (objfile), data->objfile_name_string) == 0))
{
@@ -1378,7 +1378,7 @@ add_symbol_overload_list_qualified (const char *func_name,
/* Look through the partial symtabs for all symbols which begin by
matching FUNC_NAME. Make sure we read that symbol table in. */
- for (objfile *objf : all_objfiles (current_program_space))
+ for (objfile *objf : current_program_space->all_objfiles ())
{
if (objf->sf)
objf->sf->qf->expand_symtabs_for_function (objf, func_name);
@@ -1395,7 +1395,7 @@ add_symbol_overload_list_qualified (const char *func_name,
/* Go through the symtabs and check the externs and statics for
symbols which match. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (objfile))
{
@@ -1405,7 +1405,7 @@ add_symbol_overload_list_qualified (const char *func_name,
}
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (objfile))
{
@@ -1662,7 +1662,7 @@ save_gdb_index_command (const char *arg, int from_tty)
if (!*arg)
error (_("usage: save gdb-index [-dwarf-5] DIRECTORY"));
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
struct stat st;
@@ -1702,7 +1702,7 @@ bsearch_fde_cmp (const void *key, const void *element)
static struct dwarf2_fde *
dwarf2_frame_find_fde (CORE_ADDR *pc, CORE_ADDR *out_offset)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
struct dwarf2_fde_table *fde_table;
struct dwarf2_fde **p_fde;
@@ -759,7 +759,7 @@ elf_gnu_ifunc_record_cache (const char *name, CORE_ADDR addr)
static int
elf_gnu_ifunc_resolve_by_cache (const char *name, CORE_ADDR *addr_p)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
htab_t htab;
struct elf_gnu_ifunc_cache *entry_p;
@@ -804,7 +804,7 @@ elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p)
name_got_plt = (char *) alloca (strlen (name) + got_suffix_len + 1);
sprintf (name_got_plt, "%s" SYMBOL_GOT_PLT_SUFFIX, name);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
bfd *obfd = objfile->obfd;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
@@ -426,7 +426,7 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size, int read,
If so, we can avoid copying its contents by clearing SEC_LOAD. */
struct obj_section *objsec;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, objsec)
{
bfd *abfd = objfile->obfd;
@@ -493,7 +493,7 @@ objfile_find_memory_regions (struct target_ops *self,
bfd_vma temp_bottom, temp_top;
/* Call callback function for each objfile section. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, objsec)
{
bfd *ibfd = objfile->obfd;
@@ -370,7 +370,7 @@ gdbscm_objfiles (void)
result = SCM_EOL;
- for (objfile *objf : all_objfiles (current_program_space))
+ for (objfile *objf : current_program_space->all_objfiles ())
{
SCM item = ofscm_scm_from_objfile (objf);
@@ -427,7 +427,7 @@ ppscm_search_pp_list (SCM list, SCM value)
static SCM
ppscm_find_pretty_printer_from_objfiles (SCM value)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
objfile_smob *o_smob = ofscm_objfile_smob_from_objfile (objfile);
SCM pp
@@ -289,7 +289,7 @@ gdbscm_progspace_objfiles (SCM self)
result = SCM_EOL;
- for (objfile *objfile : all_objfiles (p_smob->pspace))
+ for (objfile *objfile : p_smob->pspace->all_objfiles ())
{
if (objfile->separate_debug_objfile_backlink == NULL)
{
@@ -497,7 +497,7 @@ find_unwind_entry (CORE_ADDR pc)
return NULL;
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
struct hppa_unwind_info *ui;
ui = NULL;
@@ -2542,7 +2542,7 @@ hppa_lookup_stub_minimal_symbol (const char *name,
{
struct bound_minimal_symbol result = { NULL, NULL };
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (minimal_symbol *msym : objfile_msymbols (objfile))
{
@@ -984,7 +984,7 @@ jit_unregister_code (struct objfile *objfile)
static struct objfile *
jit_find_objf_with_entry_addr (CORE_ADDR entry_addr)
{
- for (objfile *objf : all_objfiles (current_program_space))
+ for (objfile *objf : current_program_space->all_objfiles ())
{
struct jit_objfile_data *objf_data;
@@ -1141,7 +1141,7 @@ iterate_over_all_matching_symtabs
set_current_program_space (pspace);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (objfile->sf)
objfile->sf->qf->expand_symtabs_matching (objfile,
@@ -4357,7 +4357,7 @@ search_minsyms_for_name (struct collect_info *info,
set_current_program_space (pspace);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
iterate_over_minimal_symbols (objfile, name,
[&] (struct minimal_symbol *msym)
@@ -1056,7 +1056,7 @@ try_thread_db_load_from_pdir (const char *subdir)
if (!auto_load_thread_db)
return 0;
- for (objfile *obj : all_objfiles (current_program_space))
+ for (objfile *obj : current_program_space->all_objfiles ())
if (libpthread_name_p (objfile_name (obj)))
{
if (try_thread_db_load_from_pdir_1 (obj, subdir))
@@ -1165,7 +1165,7 @@ thread_db_load_search (void)
static int
has_libpthread (void)
{
- for (objfile *obj : all_objfiles (current_program_space))
+ for (objfile *obj : current_program_space->all_objfiles ())
if (libpthread_name_p (objfile_name (obj)))
return 1;
@@ -1123,7 +1123,7 @@ captured_main_1 (struct captured_main_args *context)
We wait until now because it is common to add to the source search
path in local_gdbinit. */
global_auto_load = save_auto_load;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
load_auto_scripts_for_objfile (objfile);
/* Process '-x' and '-ex' options. */
@@ -357,7 +357,7 @@ maintenance_info_sections (const char *arg, int from_tty)
if (strcmp (arg, "ALLOBJ") == 0)
arg = NULL;
- for (objfile *ofile : all_objfiles (current_program_space))
+ for (objfile *ofile : current_program_space->all_objfiles ())
{
printf_filtered (_(" Object file: %s\n"),
bfd_get_filename (ofile->obfd));
@@ -447,7 +447,7 @@ maintenance_translate_address (const char *arg, int from_tty)
int arg_len = p - arg;
p = skip_spaces (p + 1);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, sect)
{
if (strncmp (sect->the_bfd_section->name, arg, arg_len) == 0)
@@ -771,7 +771,7 @@ count_symtabs_and_blocks (int *nr_symtabs_ptr, int *nr_compunit_symtabs_ptr,
current_program_space may be NULL. */
if (current_program_space != NULL)
{
- for (objfile *o : all_objfiles (current_program_space))
+ for (objfile *o : current_program_space->all_objfiles ())
{
for (compunit_symtab *cu : objfile_compunits (o))
{
@@ -92,7 +92,7 @@ mi_cmd_file_list_exec_source_files (const char *command, char **argv, int argc)
uiout->begin (ui_out_type_list, "files");
/* Look at all of the file symtabs. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (compunit_symtab *cu : objfile_compunits (objfile))
{
@@ -1492,7 +1492,7 @@ find_solib_trampoline_target (struct frame_info *frame, CORE_ADDR pc)
if (tsymbol != NULL)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
@@ -605,7 +605,7 @@ info_selectors_command (const char *regexp, int from_tty)
}
/* First time thru is JUST to get max length and count. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
@@ -645,7 +645,7 @@ info_selectors_command (const char *regexp, int from_tty)
sym_arr = XALLOCAVEC (struct symbol *, matches);
matches = 0;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
@@ -759,7 +759,7 @@ info_classes_command (const char *regexp, int from_tty)
}
/* First time thru is JUST to get max length and count. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
@@ -786,7 +786,7 @@ info_classes_command (const char *regexp, int from_tty)
regexp ? regexp : "*");
sym_arr = XALLOCAVEC (struct symbol *, matches);
matches = 0;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
@@ -992,7 +992,7 @@ find_methods (char type, const char *theclass, const char *category,
gdb_assert (symbol_names != NULL);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
unsigned int *objc_csym;
@@ -1013,7 +1013,7 @@ objfile_has_symbols (struct objfile *objfile)
int
have_partial_symbols (void)
{
- for (objfile *ofp : all_objfiles (current_program_space))
+ for (objfile *ofp : current_program_space->all_objfiles ())
{
if (objfile_has_partial_symbols (ofp))
return 1;
@@ -1028,7 +1028,7 @@ have_partial_symbols (void)
int
have_full_symbols (void)
{
- for (objfile *ofp : all_objfiles (current_program_space))
+ for (objfile *ofp : current_program_space->all_objfiles ())
{
if (objfile_has_full_symbols (ofp))
return 1;
@@ -1062,7 +1062,7 @@ objfile_purge_solibs (void)
int
have_minimal_symbols (void)
{
- for (objfile *ofp : all_objfiles (current_program_space))
+ for (objfile *ofp : current_program_space->all_objfiles ())
{
if (ofp->per_bfd->minimal_symbol_count > 0)
{
@@ -1133,7 +1133,7 @@ qsort_cmp (const void *a, const void *b)
{
/* Sort on sequence number of the objfile in the chain. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
if (objfile == objfile1)
return -1;
else if (objfile == objfile2)
@@ -1317,7 +1317,7 @@ update_section_map (struct program_space *pspace,
xfree (map);
alloc_size = 0;
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, s)
if (insert_section_p (objfile->obfd, s->the_bfd_section))
alloc_size += 1;
@@ -1333,7 +1333,7 @@ update_section_map (struct program_space *pspace,
map = XNEWVEC (struct obj_section *, alloc_size);
i = 0;
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, s)
if (insert_section_p (objfile->obfd, s->the_bfd_section))
map[i++] = s;
@@ -1477,7 +1477,7 @@ int
shared_objfile_contains_address_p (struct program_space *pspace,
CORE_ADDR address)
{
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->all_objfiles ())
{
if ((objfile->flags & OBJF_SHARED) != 0
&& is_addr_in_objfile (address, objfile))
@@ -1503,7 +1503,7 @@ default_iterate_over_objfiles_in_search_order
{
int stop = 0;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
stop = cb (objfile, cb_data);
if (stop)
@@ -553,21 +553,6 @@ extern void default_iterate_over_objfiles_in_search_order
void *cb_data, struct objfile *current_objfile);
-/* An iterarable object that can be used to iterate over all
- objfiles. The basic use is in a foreach, like:
-
- for (objfile *objf : all_objfiles (pspace)) { ... } */
-
-class all_objfiles : public next_adapter<struct objfile>
-{
-public:
-
- explicit all_objfiles (struct program_space *pspace)
- : next_adapter<struct objfile> (pspace->objfiles)
- {
- }
-};
-
/* An iterarable object that can be used to iterate over all
objfiles. The basic use is in a foreach, like:
@@ -1789,7 +1789,7 @@ static void
ppc_linux_spe_context_inferior_created (struct target_ops *t, int from_tty)
{
ppc_linux_spe_context_lookup (NULL);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
ppc_linux_spe_context_lookup (objfile);
}
@@ -1282,7 +1282,7 @@ info_symbol_command (const char *arg, int from_tty)
error_no_arg (_("address"));
addr = parse_and_eval_address (arg);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, osect)
{
/* Only process each object file once, even if there's a separate
@@ -73,7 +73,7 @@ parse_probes_in_pspace (const static_probe_ops *spops,
const char *name,
std::vector<symtab_and_line> *result)
{
- for (objfile *objfile : all_objfiles (search_pspace))
+ for (objfile *objfile : search_pspace->all_objfiles ())
{
if (!objfile->sf || !objfile->sf->sym_probe_fns)
continue;
@@ -249,7 +249,7 @@ find_probe_by_pc (CORE_ADDR pc)
result.objfile = NULL;
result.prob = NULL;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (!objfile->sf || !objfile->sf->sym_probe_fns
|| objfile->sect_index_text == -1)
@@ -294,7 +294,7 @@ collect_probes (const std::string &objname, const std::string &provider,
obj_pat.emplace (objname.c_str (), REG_NOSUB,
_("Invalid object file regexp"));
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (! objfile->sf || ! objfile->sf->sym_probe_fns)
continue;
@@ -137,6 +137,17 @@ struct program_space
program_space (address_space *aspace_);
~program_space ();
+ typedef next_adapter<struct objfile> all_objfiles_range;
+
+ /* Return an iterarable object that can be used to iterate over all
+ objfiles. The basic use is in a foreach, like:
+
+ for (objfile *objf : pspace->all_objfiles ()) { ... } */
+ all_objfiles_range all_objfiles ()
+ {
+ return all_objfiles_range (objfiles);
+ }
+
/* Pointer to next in linked list. */
struct program_space *next = NULL;
@@ -1942,7 +1942,7 @@ maintenance_print_psymbols (const char *args, int from_tty)
}
found = 0;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
int printed_objfile_header = 0;
int print_for_objfile = 1;
@@ -2035,7 +2035,7 @@ maintenance_info_psymtabs (const char *regexp, int from_tty)
re_comp (regexp);
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->all_objfiles ())
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
@@ -2148,7 +2148,7 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
struct block *b;
int length;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
for (partial_symtab *ps : require_partial_symbols (objfile, 1))
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
@@ -501,7 +501,7 @@ objfpy_build_id_matches (const struct bfd_build_id *build_id,
static struct objfile *
objfpy_lookup_objfile_by_name (const char *name)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
const char *filename;
@@ -527,7 +527,7 @@ objfpy_lookup_objfile_by_name (const char *name)
static struct objfile *
objfpy_lookup_objfile_by_build_id (const char *build_id)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
const struct bfd_build_id *obfd_build_id;
@@ -93,7 +93,7 @@ search_pp_list (PyObject *list, PyObject *value)
static PyObject *
find_pretty_printer_from_objfiles (PyObject *value)
{
- for (objfile *obj : all_objfiles (current_program_space))
+ for (objfile *obj : current_program_space->all_objfiles ())
{
gdbpy_ref<> objf = objfile_to_objfile_object (obj);
if (objf == NULL)
@@ -333,7 +333,7 @@ pspy_get_objfiles (PyObject *self_, PyObject *args)
if (self->pspace != NULL)
{
- for (objfile *objf : all_objfiles (self->pspace))
+ for (objfile *objf : self->pspace->all_objfiles ())
{
gdbpy_ref<> item = objfile_to_objfile_object (objf);
@@ -143,7 +143,7 @@ gdbpy_get_matching_xmethod_workers
/* Gather debug method matchers registered with the object files.
This could be done differently by iterating over each objfile's matcher
list individually, but there's no data yet to show it's needed. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
gdbpy_ref<> py_objfile = objfile_to_objfile_object (objfile);
@@ -102,7 +102,7 @@ append_ocl_sos (struct so_list **link_ptr)
{
CORE_ADDR *ocl_program_addr_base;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
ocl_program_addr_base
= (CORE_ADDR *) objfile_data (objfile, ocl_program_data_key);
@@ -678,7 +678,7 @@ solib_read_symbols (struct so_list *so, symfile_add_flags flags)
{
/* Have we already loaded this shared object? */
so->objfile = nullptr;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (filename_cmp (objfile_name (objfile), so->so_name) == 0
&& objfile->addr_low == so->addr_low)
@@ -269,7 +269,7 @@ select_source_symtab (struct symtab *s)
current_source_line = 1;
- for (objfile *ofp : all_objfiles (current_program_space))
+ for (objfile *ofp : current_program_space->all_objfiles ())
{
for (compunit_symtab *cu : objfile_compunits (ofp))
{
@@ -291,7 +291,7 @@ select_source_symtab (struct symtab *s)
if (current_source_symtab)
return;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (objfile->sf)
s = objfile->sf->qf->find_last_source_symtab (objfile);
@@ -382,7 +382,7 @@ forget_cached_source_info (void)
struct program_space *pspace;
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->all_objfiles ())
{
forget_cached_source_info_for_objfile (objfile);
}
@@ -1883,7 +1883,7 @@ spu_overlay_update (struct obj_section *osect)
/* All sections. */
else
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, osect)
if (section_is_overlay (osect))
spu_overlay_update_osect (osect);
@@ -2003,7 +2003,7 @@ spu_objfile_from_frame (struct frame_info *frame)
if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_spu)
return NULL;
- for (objfile *obj : all_objfiles (current_program_space))
+ for (objfile *obj : current_program_space->all_objfiles ())
{
if (obj->sections != obj->sections_end
&& SPUADDR_SPU (obj_section_addr (obj->sections)) == tdep->id)
@@ -662,7 +662,7 @@ set_debug_symfile (const char *args, int from_tty, struct cmd_list_element *c)
struct program_space *pspace;
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->all_objfiles ())
{
if (debug_symfile)
{
@@ -2351,7 +2351,7 @@ remove_symbol_file_command (const char *args, int from_tty)
addr = parse_and_eval_address (argv[1]);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if ((objfile->flags & OBJF_USERLOADED) != 0
&& (objfile->flags & OBJF_SHARED) != 0
@@ -2372,7 +2372,7 @@ remove_symbol_file_command (const char *args, int from_tty)
gdb::unique_xmalloc_ptr<char> filename (tilde_expand (argv[0]));
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if ((objfile->flags & OBJF_USERLOADED) != 0
&& (objfile->flags & OBJF_SHARED) != 0
@@ -2980,7 +2980,7 @@ overlay_invalidate_all (void)
{
struct obj_section *sect;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, sect)
if (section_is_overlay (sect))
sect->ovly_mapped = -1;
@@ -3158,7 +3158,7 @@ find_pc_overlay (CORE_ADDR pc)
if (overlay_debugging)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, osect)
if (section_is_overlay (osect))
{
@@ -3187,7 +3187,7 @@ find_pc_mapped_section (CORE_ADDR pc)
if (overlay_debugging)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, osect)
if (pc_in_mapped_range (pc, osect) && section_is_mapped (osect))
return osect;
@@ -3207,7 +3207,7 @@ list_overlays_command (const char *args, int from_tty)
if (overlay_debugging)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, osect)
if (section_is_mapped (osect))
{
@@ -3255,7 +3255,7 @@ map_overlay_command (const char *args, int from_tty)
error (_("Argument required: name of an overlay section"));
/* First, find a section matching the user supplied argument. */
- for (objfile *obj_file : all_objfiles (current_program_space))
+ for (objfile *obj_file : current_program_space->all_objfiles ())
ALL_OBJFILE_OSECTIONS (obj_file, sec)
if (!strcmp (bfd_section_name (obj_file->obfd, sec->the_bfd_section),
args))
@@ -3269,7 +3269,7 @@ map_overlay_command (const char *args, int from_tty)
/* Next, make a pass and unmap any sections that are
overlapped by this new section: */
- for (objfile *objfile2 : all_objfiles (current_program_space))
+ for (objfile *objfile2 : current_program_space->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile2, sec2)
if (sec2->ovly_mapped && sec != sec2 && sections_overlap (sec,
sec2))
@@ -3303,7 +3303,7 @@ unmap_overlay_command (const char *args, int from_tty)
error (_("Argument required: name of an overlay section"));
/* First, find a section matching the user supplied argument. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, sec)
if (!strcmp (bfd_section_name (objfile->obfd, sec->the_bfd_section), args))
{
@@ -3574,7 +3574,7 @@ simple_overlay_update (struct obj_section *osect)
return;
/* Now may as well update all sections, even if only one was requested. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, osect)
if (section_is_overlay (osect))
{
@@ -3790,7 +3790,7 @@ expand_symtabs_matching
gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
enum search_domain kind)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (objfile->sf)
objfile->sf->qf->expand_symtabs_matching (objfile, file_matcher,
@@ -3808,7 +3808,7 @@ void
map_symbol_filenames (symbol_filename_ftype *fun, void *data,
int need_fullname)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (objfile->sf)
objfile->sf->qf->map_symbol_filenames (objfile, fun, data,
@@ -64,7 +64,7 @@ print_symbol_bcache_statistics (void)
struct program_space *pspace;
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->all_objfiles ())
{
QUIT;
printf_filtered (_("Byte cache statistics for '%s':\n"),
@@ -86,7 +86,7 @@ print_objfile_statistics (void)
int i, linetables, blockvectors;
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->all_objfiles ())
{
QUIT;
printf_filtered (_("Statistics for '%s':\n"), objfile_name (objfile));
@@ -475,7 +475,7 @@ maintenance_print_symbols (const char *args, int from_tty)
{
int found = 0;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
int print_for_objfile = 1;
@@ -736,7 +736,7 @@ maintenance_print_msymbols (const char *args, int from_tty)
outfile = &arg_outfile;
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
QUIT;
if (objfile_arg == NULL
@@ -756,7 +756,7 @@ maintenance_print_objfiles (const char *regexp, int from_tty)
re_comp (regexp);
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->all_objfiles ())
{
QUIT;
if (! regexp
@@ -778,7 +778,7 @@ maintenance_info_symtabs (const char *regexp, int from_tty)
re_comp (regexp);
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->all_objfiles ())
{
/* We don't want to print anything for this objfile until we
actually find a symtab whose name matches. */
@@ -863,7 +863,7 @@ maintenance_check_symtabs (const char *ignore, int from_tty)
struct program_space *pspace;
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->all_objfiles ())
{
/* We don't want to print anything for this objfile until we
actually find something worth printing. */
@@ -929,7 +929,7 @@ maintenance_expand_symtabs (const char *args, int from_tty)
re_comp (regexp);
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->all_objfiles ())
{
if (objfile->sf)
{
@@ -1030,7 +1030,7 @@ maintenance_info_line_tables (const char *regexp, int from_tty)
re_comp (regexp);
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->all_objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (objfile))
{
@@ -473,7 +473,7 @@ iterate_over_symtabs (const char *name,
gdb_assert (IS_ABSOLUTE_PATH (real_path.get ()));
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (iterate_over_some_symtabs (name, real_path.get (),
objfile->compunit_symtabs, NULL,
@@ -484,7 +484,7 @@ iterate_over_symtabs (const char *name,
/* Same search rules as above apply here, but now we look thru the
psymtabs. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (objfile->sf
&& objfile->sf->qf->map_symtabs_matching_filename (objfile,
@@ -1010,7 +1010,7 @@ matching_obj_sections (struct obj_section *obj_first,
/* Otherwise check that they are in corresponding objfiles. */
struct objfile *obj = NULL;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
if (objfile->obfd == first->owner)
{
obj = objfile;
@@ -1047,7 +1047,7 @@ expand_symtab_containing_pc (CORE_ADDR pc, struct obj_section *section)
|| MSYMBOL_TYPE (msymbol.minsym) == mst_file_bss))
return;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
struct compunit_symtab *cust = NULL;
@@ -2169,7 +2169,7 @@ lookup_objfile_from_block (const struct block *block)
block = block_global_block (block);
/* Look through all blockvectors. */
- for (objfile *obj : all_objfiles (current_program_space))
+ for (objfile *obj : current_program_space->all_objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (obj))
if (block == BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust),
@@ -2588,7 +2588,7 @@ lookup_static_symbol (const char *name, const domain_enum domain)
return result;
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
result = lookup_symbol_in_objfile (objfile, STATIC_BLOCK, name, domain);
if (result.symbol != NULL)
@@ -2795,14 +2795,14 @@ basic_lookup_transparent_type (const char *name)
of the desired name as a global, then do psymtab-to-symtab
conversion on the fly and return the found symbol. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
t = basic_lookup_transparent_type_1 (objfile, GLOBAL_BLOCK, name);
if (t)
return t;
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
t = basic_lookup_transparent_type_quick (objfile, GLOBAL_BLOCK, name);
if (t)
@@ -2816,14 +2816,14 @@ basic_lookup_transparent_type (const char *name)
of the desired name as a file-level static, then do psymtab-to-symtab
conversion on the fly and return the found symbol. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
t = basic_lookup_transparent_type_1 (objfile, STATIC_BLOCK, name);
if (t)
return t;
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
t = basic_lookup_transparent_type_quick (objfile, STATIC_BLOCK, name);
if (t)
@@ -2902,7 +2902,7 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section)
It also happens for objfiles that have their functions reordered.
For these, the symtab we are looking for is not necessarily read in. */
- for (objfile *obj_file : all_objfiles (current_program_space))
+ for (objfile *obj_file : current_program_space->all_objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (obj_file))
{
@@ -2964,7 +2964,7 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section)
/* Not found in symtabs, search the "quick" symtabs (e.g. psymtabs). */
- for (objfile *objf : all_objfiles (current_program_space))
+ for (objfile *objf : current_program_space->all_objfiles ())
{
struct compunit_symtab *result;
@@ -2996,7 +2996,7 @@ find_pc_compunit_symtab (CORE_ADDR pc)
struct symbol *
find_symbol_at_address (CORE_ADDR address)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (objfile->sf == NULL
|| objfile->sf->qf->find_compunit_symtab_by_address == NULL)
@@ -3351,14 +3351,14 @@ find_line_symtab (struct symtab *sym_tab, int line,
else
best = 0;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (objfile->sf)
objfile->sf->qf->expand_symtabs_with_fullname
(objfile, symtab_to_fullname (sym_tab));
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (compunit_symtab *cu : objfile_compunits (objfile))
{
@@ -4198,7 +4198,7 @@ info_sources_command (const char *ignore, int from_tty)
printf_filtered ("Source files for which symbols have been read in:\n\n");
data.first = 1;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (compunit_symtab *cu : objfile_compunits (objfile))
{
@@ -4453,7 +4453,7 @@ search_symbols (const char *regexp, enum search_domain kind,
if (nfiles == 0 && (kind == VARIABLES_DOMAIN || kind == FUNCTIONS_DOMAIN))
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
@@ -4490,7 +4490,7 @@ search_symbols (const char *regexp, enum search_domain kind,
}
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (objfile))
{
@@ -4556,7 +4556,7 @@ search_symbols (const char *regexp, enum search_domain kind,
if ((found_misc || (nfiles == 0 && kind != FUNCTIONS_DOMAIN))
&& !treg.has_value ())
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
@@ -5272,7 +5272,7 @@ default_collect_symbol_completion_matches_break_on
if (code == TYPE_CODE_UNDEF)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
@@ -5291,7 +5291,7 @@ default_collect_symbol_completion_matches_break_on
}
/* Add completions for all currently loaded symbol tables. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (objfile))
add_symtab_completions (cust, tracker, mode, lookup_name,
@@ -5600,7 +5600,7 @@ make_source_files_completion_list (const char *text, const char *word)
filename_seen_cache filenames_seen;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
for (compunit_symtab *cu : objfile_compunits (objfile))
{
@@ -5717,7 +5717,7 @@ find_main_name (void)
relies on the order of objfile creation -- which still isn't
guaranteed to get the correct answer, but is just probably more
accurate. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (objfile->per_bfd->name_of_main != NULL)
{
@@ -423,7 +423,7 @@ windows_iterate_over_objfiles_in_search_order
return;
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->all_objfiles ())
{
if (objfile != current_objfile)
{