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/objfiles.h | |
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/objfiles.h')
-rw-r--r-- | gdb/objfiles.h | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/gdb/objfiles.h b/gdb/objfiles.h index b8d5b65..c0fc36f 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -705,42 +705,6 @@ private: } \ else -/* Traverse all obj_sections in all objfiles in the current program - space. - - Note that this detects a "break" in the inner loop, and exits - immediately from the outer loop as well, thus, client code doesn't - need to know that this is implemented with a double for. The extra - hair is to make sure that a "break;" stops the outer loop iterating - as well, and both OBJFILE and OSECT are left unmodified: - - - The outer loop learns about the inner loop's end condition, and - stops iterating if it detects the inner loop didn't reach its - end. In other words, the outer loop keeps going only if the - inner loop reached its end cleanly [(osect) == - (objfile)->sections_end]. - - - OSECT is initialized in the outer loop initialization - expressions, such as if the inner loop has reached its end, so - the check mentioned above succeeds the first time. - - - The trick to not clearing OBJFILE on a "break;" is, in the outer - loop's loop expression, advance OBJFILE, but iff the inner loop - reached its end. If not, there was a "break;", so leave OBJFILE - as is; the outer loop's conditional will break immediately as - well (as OSECT will be different from OBJFILE->sections_end). */ - -#define ALL_OBJSECTIONS(objfile, osect) \ - for ((objfile) = current_program_space->objfiles, \ - (objfile) != NULL ? ((osect) = (objfile)->sections_end) : 0; \ - (objfile) != NULL \ - && (osect) == (objfile)->sections_end; \ - ((osect) == (objfile)->sections_end \ - ? ((objfile) = (objfile)->next, \ - (objfile) != NULL ? (osect) = (objfile)->sections_end : 0) \ - : 0)) \ - ALL_OBJFILE_OSECTIONS (objfile, osect) - #define SECT_OFF_DATA(objfile) \ ((objfile->sect_index_data == -1) \ ? (internal_error (__FILE__, __LINE__, \ |