diff options
author | Tom Tromey <tom@tromey.com> | 2018-11-24 11:54:26 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-01-09 18:28:15 -0700 |
commit | 3b9d3ac236dcc418619785e0660fc0063e6489b8 (patch) | |
tree | cf889e1bf17b40f716551bb173c9189a45a33a99 /gdb/maint.c | |
parent | 8b31193aa9752ba60d63cedaba943370d76ce543 (diff) | |
download | gdb-3b9d3ac236dcc418619785e0660fc0063e6489b8.zip gdb-3b9d3ac236dcc418619785e0660fc0063e6489b8.tar.gz gdb-3b9d3ac236dcc418619785e0660fc0063e6489b8.tar.bz2 |
Remove ALL_OBJSECTIONS
This removes the ALL_OBJSECTIONS macro, replacing its uses with ranged
for loops.
The special code in this macro for noticing a "break" from the inner
loop was only needed in a single place; so rather than try to
replicate this, I've simply replaced that use with a "goto".
gdb/ChangeLog
2019-01-09 Tom Tromey <tom@tromey.com>
* symfile.c (overlay_invalidate_all, find_pc_overlay)
(find_pc_mapped_section, list_overlays_command)
(map_overlay_command, unmap_overlay_command)
(simple_overlay_update): Use all_objfiles.
* spu-tdep.c (spu_overlay_update): Use all_objfiles.
* printcmd.c (info_symbol_command): Use all_objfiles.
* objfiles.h (ALL_OBJSECTIONS): Remove.
* maint.c (maintenance_translate_address): Use all_objfiles.
* gcore.c (gcore_create_callback): Use all_objfiles.
(objfile_find_memory_regions): Likewise.
Diffstat (limited to 'gdb/maint.c')
-rw-r--r-- | gdb/maint.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/maint.c b/gdb/maint.c index 04b4473..f286c63 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -430,7 +430,6 @@ maintenance_translate_address (const char *arg, int from_tty) struct obj_section *sect; const char *p; struct bound_minimal_symbol sym; - struct objfile *objfile; if (arg == NULL || *arg == 0) error (_("requires argument (address or section + address)")); @@ -448,14 +447,15 @@ maintenance_translate_address (const char *arg, int from_tty) int arg_len = p - arg; p = skip_spaces (p + 1); - ALL_OBJSECTIONS (objfile, sect) - { - if (strncmp (sect->the_bfd_section->name, arg, arg_len) == 0) - break; - } + for (objfile *objfile : all_objfiles (current_program_space)) + ALL_OBJFILE_OSECTIONS (objfile, sect) + { + if (strncmp (sect->the_bfd_section->name, arg, arg_len) == 0) + goto found; + } - if (!objfile) - error (_("Unknown section %s."), arg); + error (_("Unknown section %s."), arg); + found: ; } address = parse_and_eval_address (p); |