+2019-01-17 Tom Tromey <tom@tromey.com>
+
+ * progspace.h (program_space) <objfiles_range>: New typedef.
+ <objfiles>: New method.
+ <objfiles_head>: Rename from objfiles.
+ (object_files): Update.
+ * guile/scm-progspace.c (gdbscm_progspace_objfiles): Update.
+ * guile/scm-pretty-print.c
+ (ppscm_find_pretty_printer_from_objfiles): Update.
+ * guile/scm-objfile.c (gdbscm_objfiles): Update.
+ * python/py-xmethods.c (gdbpy_get_matching_xmethod_workers):
+ Update.
+ * python/py-progspace.c (pspy_get_objfiles): Update.
+ * python/py-prettyprint.c (find_pretty_printer_from_objfiles):
+ Update.
+ * python/py-objfile.c (objfpy_lookup_objfile_by_name)
+ (objfpy_lookup_objfile_by_build_id): Update.
+ * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Update.
+ * windows-tdep.c (windows_iterate_over_objfiles_in_search_order):
+ Update.
+ * symtab.c (iterate_over_symtabs, matching_obj_sections)
+ (expand_symtab_containing_pc, lookup_objfile_from_block)
+ (lookup_static_symbol, basic_lookup_transparent_type)
+ (find_pc_sect_compunit_symtab, find_symbol_at_address)
+ (find_line_symtab, info_sources_command)
+ (default_collect_symbol_completion_matches_break_on)
+ (make_source_files_completion_list, find_main_name): Update.
+ * symmisc.c (print_symbol_bcache_statistics)
+ (print_objfile_statistics, maintenance_print_symbols)
+ (maintenance_print_msymbols, maintenance_print_objfiles)
+ (maintenance_info_symtabs, maintenance_check_symtabs)
+ (maintenance_expand_symtabs, maintenance_info_line_tables):
+ Update.
+ * symfile.c (remove_symbol_file_command, overlay_invalidate_all)
+ (find_pc_overlay, find_pc_mapped_section, list_overlays_command)
+ (map_overlay_command, unmap_overlay_command)
+ (simple_overlay_update, expand_symtabs_matching)
+ (map_symbol_filenames): Update.
+ * symfile-debug.c (set_debug_symfile): Update.
+ * spu-tdep.c (spu_overlay_update, spu_objfile_from_frame):
+ Update.
+ * source.c (select_source_symtab, forget_cached_source_info):
+ Update.
+ * solib.c (solib_read_symbols): Update.
+ * solib-spu.c (append_ocl_sos): Update.
+ * psymtab.c (maintenance_print_psymbols)
+ (maintenance_info_psymtabs, maintenance_check_psymtabs): Update.
+ * probe.c (parse_probes_in_pspace, find_probe_by_pc): Update.
+ * printcmd.c (info_symbol_command): Update.
+ * ppc-linux-tdep.c (ppc_linux_spe_context_inferior_created):
+ Update.
+ * objfiles.h (class all_objfiles): Remove.
+ * objfiles.c (have_partial_symbols, have_full_symbols)
+ (have_minimal_symbols, qsort_cmp, update_section_map)
+ (shared_objfile_contains_address_p)
+ (default_iterate_over_objfiles_in_search_order): Update.
+ * objc-lang.c (info_selectors_command, info_classes_command)
+ (find_methods): Update.
+ * minsyms.c (find_solib_trampoline_target): Update.
+ * maint.c (maintenance_info_sections)
+ (maintenance_translate_address, count_symtabs_and_blocks):
+ Update.
+ * main.c (captured_main_1): Update.
+ * linux-thread-db.c (try_thread_db_load_from_pdir)
+ (has_libpthread): Update.
+ * linespec.c (iterate_over_all_matching_symtabs)
+ (search_minsyms_for_name): Update.
+ * jit.c (jit_find_objf_with_entry_addr): Update.
+ * hppa-tdep.c (find_unwind_entry)
+ (hppa_lookup_stub_minimal_symbol): Update.
+ * gcore.c (gcore_create_callback, objfile_find_memory_regions):
+ Update.
+ * elfread.c (elf_gnu_ifunc_resolve_by_cache)
+ (elf_gnu_ifunc_resolve_by_got): Update.
+ * dwarf2-frame.c (dwarf2_frame_find_fde): Update.
+ * dwarf-index-write.c (save_gdb_index_command): Update.
+ * cp-support.c (add_symbol_overload_list_qualified): Update.
+ * breakpoint.c (create_overlay_event_breakpoint)
+ (create_longjmp_master_breakpoint)
+ (create_std_terminate_master_breakpoint)
+ (create_exception_master_breakpoint): Update.
+ * blockframe.c (find_pc_partial_function): Update.
+ * ada-lang.c (ada_lookup_simple_minsym, add_nonlocal_symbols)
+ (ada_collect_symbol_completion_matches)
+ (ada_add_global_exceptions): Update.
+
2019-01-17 Tom Tromey <tom@tromey.com>
* solib-target.c (lm_info_target_p): Remove typedef. Don't
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->objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
bool is_wild_match = lookup_name.ada ().wild_match_p ();
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
data.objfile = objfile;
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->objfiles ())
{
data.objfile = objfile;
objfile->sf->qf->map_matching_symbols (objfile, name1.c_str (),
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->objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
/* 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->objfiles ())
{
for (compunit_symtab *s : objfile_compunits (objfile))
{
}
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
for (compunit_symtab *s : objfile_compunits (objfile))
{
NULL,
VARIABLES_DOMAIN);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
for (compunit_symtab *s : objfile_compunits (objfile))
{
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->objfiles ())
{
if (objfile->sf)
{
{
const char *const func_name = "_ovly_debug_event";
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
struct breakpoint *b;
struct breakpoint_objfile_data *bp_objfile_data;
{
set_current_program_space (pspace);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
int i;
struct gdbarch *gdbarch;
set_current_program_space (pspace);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
struct breakpoint *b;
struct breakpoint_objfile_data *bp_objfile_data;
{
const char *const func_name = "_Unwind_DebugHook";
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
struct breakpoint *b;
struct gdbarch *gdbarch;
}
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
if ((objfile->flags & OBJF_USERLOADED) == 0
&& (strcmp (objfile_name (objfile), data->objfile_name_string) == 0))
{
/* 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->objfiles ())
{
if (objf->sf)
objf->sf->qf->expand_symtabs_for_function (objf, 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->objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (objfile))
{
}
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (objfile))
{
if (!*arg)
error (_("usage: save gdb-index [-dwarf-5] DIRECTORY"));
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
struct stat st;
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->objfiles ())
{
struct dwarf2_fde_table *fde_table;
struct dwarf2_fde **p_fde;
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->objfiles ())
{
htab_t htab;
struct elf_gnu_ifunc_cache *entry_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->objfiles ())
{
bfd *obfd = objfile->obfd;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
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->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, objsec)
{
bfd *abfd = objfile->obfd;
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->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, objsec)
{
bfd *ibfd = objfile->obfd;
result = SCM_EOL;
- for (objfile *objf : all_objfiles (current_program_space))
+ for (objfile *objf : current_program_space->objfiles ())
{
SCM item = ofscm_scm_from_objfile (objf);
static SCM
ppscm_find_pretty_printer_from_objfiles (SCM value)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
objfile_smob *o_smob = ofscm_objfile_smob_from_objfile (objfile);
SCM pp
result = SCM_EOL;
- for (objfile *objfile : all_objfiles (p_smob->pspace))
+ for (objfile *objfile : p_smob->pspace->objfiles ())
{
if (objfile->separate_debug_objfile_backlink == NULL)
{
return NULL;
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
struct hppa_unwind_info *ui;
ui = NULL;
{
struct bound_minimal_symbol result = { NULL, NULL };
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
for (minimal_symbol *msym : objfile_msymbols (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->objfiles ())
{
struct jit_objfile_data *objf_data;
set_current_program_space (pspace);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
if (objfile->sf)
objfile->sf->qf->expand_symtabs_matching (objfile,
set_current_program_space (pspace);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
iterate_over_minimal_symbols (objfile, name,
[&] (struct minimal_symbol *msym)
if (!auto_load_thread_db)
return 0;
- for (objfile *obj : all_objfiles (current_program_space))
+ for (objfile *obj : current_program_space->objfiles ())
if (libpthread_name_p (objfile_name (obj)))
{
if (try_thread_db_load_from_pdir_1 (obj, subdir))
static int
has_libpthread (void)
{
- for (objfile *obj : all_objfiles (current_program_space))
+ for (objfile *obj : current_program_space->objfiles ())
if (libpthread_name_p (objfile_name (obj)))
return 1;
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->objfiles ())
load_auto_scripts_for_objfile (objfile);
/* Process '-x' and '-ex' options. */
if (strcmp (arg, "ALLOBJ") == 0)
arg = NULL;
- for (objfile *ofile : all_objfiles (current_program_space))
+ for (objfile *ofile : current_program_space->objfiles ())
{
printf_filtered (_(" Object file: %s\n"),
bfd_get_filename (ofile->obfd));
int arg_len = p - arg;
p = skip_spaces (p + 1);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, sect)
{
if (strncmp (sect->the_bfd_section->name, arg, arg_len) == 0)
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->objfiles ())
{
for (compunit_symtab *cu : objfile_compunits (o))
{
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->objfiles ())
{
for (compunit_symtab *cu : objfile_compunits (objfile))
{
if (tsymbol != NULL)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
}
/* 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->objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
sym_arr = XALLOCAVEC (struct symbol *, matches);
matches = 0;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
}
/* 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->objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
regexp ? regexp : "*");
sym_arr = XALLOCAVEC (struct symbol *, matches);
matches = 0;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
gdb_assert (symbol_names != NULL);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
unsigned int *objc_csym;
int
have_partial_symbols (void)
{
- for (objfile *ofp : all_objfiles (current_program_space))
+ for (objfile *ofp : current_program_space->objfiles ())
{
if (objfile_has_partial_symbols (ofp))
return 1;
int
have_full_symbols (void)
{
- for (objfile *ofp : all_objfiles (current_program_space))
+ for (objfile *ofp : current_program_space->objfiles ())
{
if (objfile_has_full_symbols (ofp))
return 1;
int
have_minimal_symbols (void)
{
- for (objfile *ofp : all_objfiles (current_program_space))
+ for (objfile *ofp : current_program_space->objfiles ())
{
if (ofp->per_bfd->minimal_symbol_count > 0)
{
{
/* Sort on sequence number of the objfile in the chain. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
if (objfile == objfile1)
return -1;
else if (objfile == objfile2)
xfree (map);
alloc_size = 0;
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, s)
if (insert_section_p (objfile->obfd, s->the_bfd_section))
alloc_size += 1;
map = XNEWVEC (struct obj_section *, alloc_size);
i = 0;
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, s)
if (insert_section_p (objfile->obfd, s->the_bfd_section))
map[i++] = s;
shared_objfile_contains_address_p (struct program_space *pspace,
CORE_ADDR address)
{
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->objfiles ())
{
if ((objfile->flags & OBJF_SHARED) != 0
&& is_addr_in_objfile (address, objfile))
}
/* The default implementation for the "iterate_over_objfiles_in_search_order"
- gdbarch method. It is equivalent to use the all_objfiles iterable,
+ gdbarch method. It is equivalent to use the objfiles iterable,
searching the objfiles in the order they are stored internally,
ignoring CURRENT_OBJFILE.
{
int stop = 0;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
stop = cb (objfile, cb_data);
if (stop)
Although this is a tree structure, GDB only support one level
(ie a separate debug for a separate debug is not supported). Note that
separate debug object are in the main chain and therefore will be
- visited by all_objfiles & co iterators. Separate debug objfile always
+ visited by objfiles & co iterators. Separate debug objfile always
has a non-nul separate_debug_objfile_backlink. */
/* Link to the first separate debug object, if any. */
void *cb_data, struct objfile *current_objfile);
\f
-/* 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:
explicit all_objfiles_safe (struct program_space *pspace)
: next_adapter<struct objfile,
basic_safe_iterator<next_iterator<objfile>>>
- (pspace->objfiles)
+ (pspace->objfiles_head)
{
}
};
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->objfiles ())
ppc_linux_spe_context_lookup (objfile);
}
error_no_arg (_("address"));
addr = parse_and_eval_address (arg);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, osect)
{
/* Only process each object file once, even if there's a separate
const char *name,
std::vector<symtab_and_line> *result)
{
- for (objfile *objfile : all_objfiles (search_pspace))
+ for (objfile *objfile : search_pspace->objfiles ())
{
if (!objfile->sf || !objfile->sf->sym_probe_fns)
continue;
result.objfile = NULL;
result.prob = NULL;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
if (!objfile->sf || !objfile->sf->sym_probe_fns
|| objfile->sect_index_text == -1)
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->objfiles ())
{
if (! objfile->sf || ! objfile->sf->sym_probe_fns)
continue;
program_space (address_space *aspace_);
~program_space ();
+ typedef next_adapter<struct objfile> 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->objfiles ()) { ... } */
+ objfiles_range objfiles ()
+ {
+ return objfiles_range (objfiles_head);
+ }
+
/* Pointer to next in linked list. */
struct program_space *next = NULL;
/* All known objfiles are kept in a linked list. This points to
the head of this list. */
- struct objfile *objfiles = NULL;
+ struct objfile *objfiles_head = NULL;
/* The set of target sections matching the sections mapped into
this program space. Managed by both exec_ops and solib.c. */
/* All known objfiles are kept in a linked list. This points to the
root of this list. */
-#define object_files current_program_space->objfiles
+#define object_files current_program_space->objfiles_head
/* The set of target sections matching the sections mapped into the
current program space. */
}
found = 0;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
int printed_objfile_header = 0;
int print_for_objfile = 1;
re_comp (regexp);
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->objfiles ())
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct block *b;
int length;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
for (partial_symtab *ps : require_partial_symbols (objfile, 1))
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
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->objfiles ())
{
const char *filename;
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->objfiles ())
{
const struct bfd_build_id *obfd_build_id;
static PyObject *
find_pretty_printer_from_objfiles (PyObject *value)
{
- for (objfile *obj : all_objfiles (current_program_space))
+ for (objfile *obj : current_program_space->objfiles ())
{
gdbpy_ref<> objf = objfile_to_objfile_object (obj);
if (objf == NULL)
if (self->pspace != NULL)
{
- for (objfile *objf : all_objfiles (self->pspace))
+ for (objfile *objf : self->pspace->objfiles ())
{
gdbpy_ref<> item = objfile_to_objfile_object (objf);
/* 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->objfiles ())
{
gdbpy_ref<> py_objfile = objfile_to_objfile_object (objfile);
{
CORE_ADDR *ocl_program_addr_base;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
ocl_program_addr_base
= (CORE_ADDR *) objfile_data (objfile, ocl_program_data_key);
{
/* Have we already loaded this shared object? */
so->objfile = nullptr;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
if (filename_cmp (objfile_name (objfile), so->so_name) == 0
&& objfile->addr_low == so->addr_low)
current_source_line = 1;
- for (objfile *ofp : all_objfiles (current_program_space))
+ for (objfile *ofp : current_program_space->objfiles ())
{
for (compunit_symtab *cu : objfile_compunits (ofp))
{
if (current_source_symtab)
return;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
if (objfile->sf)
s = objfile->sf->qf->find_last_source_symtab (objfile);
struct program_space *pspace;
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->objfiles ())
{
forget_cached_source_info_for_objfile (objfile);
}
/* All sections. */
else
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, osect)
if (section_is_overlay (osect))
spu_overlay_update_osect (osect);
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->objfiles ())
{
if (obj->sections != obj->sections_end
&& SPUADDR_SPU (obj_section_addr (obj->sections)) == tdep->id)
struct program_space *pspace;
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->objfiles ())
{
if (debug_symfile)
{
addr = parse_and_eval_address (argv[1]);
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
if ((objfile->flags & OBJF_USERLOADED) != 0
&& (objfile->flags & OBJF_SHARED) != 0
gdb::unique_xmalloc_ptr<char> filename (tilde_expand (argv[0]));
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
if ((objfile->flags & OBJF_USERLOADED) != 0
&& (objfile->flags & OBJF_SHARED) != 0
{
struct obj_section *sect;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, sect)
if (section_is_overlay (sect))
sect->ovly_mapped = -1;
if (overlay_debugging)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, osect)
if (section_is_overlay (osect))
{
if (overlay_debugging)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, osect)
if (pc_in_mapped_range (pc, osect) && section_is_mapped (osect))
return osect;
if (overlay_debugging)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, osect)
if (section_is_mapped (osect))
{
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->objfiles ())
ALL_OBJFILE_OSECTIONS (obj_file, sec)
if (!strcmp (bfd_section_name (obj_file->obfd, sec->the_bfd_section),
args))
/* 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->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile2, sec2)
if (sec2->ovly_mapped && sec != sec2 && sections_overlap (sec,
sec2))
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->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, sec)
if (!strcmp (bfd_section_name (objfile->obfd, sec->the_bfd_section), args))
{
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->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, osect)
if (section_is_overlay (osect))
{
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->objfiles ())
{
if (objfile->sf)
objfile->sf->qf->expand_symtabs_matching (objfile, file_matcher,
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->objfiles ())
{
if (objfile->sf)
objfile->sf->qf->map_symbol_filenames (objfile, fun, data,
struct program_space *pspace;
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->objfiles ())
{
QUIT;
printf_filtered (_("Byte cache statistics for '%s':\n"),
int i, linetables, blockvectors;
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->objfiles ())
{
QUIT;
printf_filtered (_("Statistics for '%s':\n"), objfile_name (objfile));
{
int found = 0;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
int print_for_objfile = 1;
outfile = &arg_outfile;
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
QUIT;
if (objfile_arg == NULL
re_comp (regexp);
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->objfiles ())
{
QUIT;
if (! regexp
re_comp (regexp);
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->objfiles ())
{
/* We don't want to print anything for this objfile until we
actually find a symtab whose name matches. */
struct program_space *pspace;
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->objfiles ())
{
/* We don't want to print anything for this objfile until we
actually find something worth printing. */
re_comp (regexp);
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->objfiles ())
{
if (objfile->sf)
{
re_comp (regexp);
ALL_PSPACES (pspace)
- for (objfile *objfile : all_objfiles (pspace))
+ for (objfile *objfile : pspace->objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (objfile))
{
gdb_assert (IS_ABSOLUTE_PATH (real_path.get ()));
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
if (iterate_over_some_symtabs (name, real_path.get (),
objfile->compunit_symtabs, NULL,
/* 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->objfiles ())
{
if (objfile->sf
&& objfile->sf->qf->map_symtabs_matching_filename (objfile,
/* 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->objfiles ())
if (objfile->obfd == first->owner)
{
obj = objfile;
|| MSYMBOL_TYPE (msymbol.minsym) == mst_file_bss))
return;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
struct compunit_symtab *cust = NULL;
block = block_global_block (block);
/* Look through all blockvectors. */
- for (objfile *obj : all_objfiles (current_program_space))
+ for (objfile *obj : current_program_space->objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (obj))
if (block == BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust),
return result;
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
result = lookup_symbol_in_objfile (objfile, STATIC_BLOCK, name, domain);
if (result.symbol != NULL)
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->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->objfiles ())
{
t = basic_lookup_transparent_type_quick (objfile, GLOBAL_BLOCK, name);
if (t)
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->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->objfiles ())
{
t = basic_lookup_transparent_type_quick (objfile, STATIC_BLOCK, name);
if (t)
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->objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (obj_file))
{
/* 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->objfiles ())
{
struct compunit_symtab *result;
struct symbol *
find_symbol_at_address (CORE_ADDR address)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
if (objfile->sf == NULL
|| objfile->sf->qf->find_compunit_symtab_by_address == NULL)
else
best = 0;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->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->objfiles ())
{
for (compunit_symtab *cu : objfile_compunits (objfile))
{
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->objfiles ())
{
for (compunit_symtab *cu : objfile_compunits (objfile))
{
if (nfiles == 0 && (kind == VARIABLES_DOMAIN || kind == FUNCTIONS_DOMAIN))
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
}
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (objfile))
{
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->objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
if (code == TYPE_CODE_UNDEF)
{
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
for (minimal_symbol *msymbol : objfile_msymbols (objfile))
{
}
/* Add completions for all currently loaded symbol tables. */
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
for (compunit_symtab *cust : objfile_compunits (objfile))
add_symtab_completions (cust, tracker, mode, lookup_name,
filename_seen_cache filenames_seen;
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
for (compunit_symtab *cu : objfile_compunits (objfile))
{
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->objfiles ())
{
if (objfile->per_bfd->name_of_main != NULL)
{
return;
}
- for (objfile *objfile : all_objfiles (current_program_space))
+ for (objfile *objfile : current_program_space->objfiles ())
{
if (objfile != current_objfile)
{