diff options
author | Tom Tromey <tom@tromey.com> | 2019-01-19 21:30:36 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-04-10 08:05:17 -0600 |
commit | bf227d6105cb3908cde816429c84569da12e829c (patch) | |
tree | d7022aa84f98f332460726b0a1e944c7c14db563 /gdb/minsyms.c | |
parent | b05971a652c35ed72d3c95290e18d8f6e4ef6c46 (diff) | |
download | gdb-bf227d6105cb3908cde816429c84569da12e829c.zip gdb-bf227d6105cb3908cde816429c84569da12e829c.tar.gz gdb-bf227d6105cb3908cde816429c84569da12e829c.tar.bz2 |
Remove some uses of "object_files"
The "object_files" macro is sometimes used when iterating over
objfiles. This patch removes a few such uses in favor of the new
range adapter.
gdb/ChangeLog
2019-04-10 Tom Tromey <tom@tromey.com>
* ia64-tdep.c (ia64_get_dyn_info_list): Use foreach.
* minsyms.c (lookup_minimal_symbol): Use foreach.
(lookup_minimal_symbol_text, lookup_minimal_symbol_by_pc_name)
(lookup_minimal_symbol_solib_trampoline): Likewise.
* symfile.c (reread_symbols): Use foreach.
Diffstat (limited to 'gdb/minsyms.c')
-rw-r--r-- | gdb/minsyms.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 51b65f5..34198d1 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -308,7 +308,6 @@ struct bound_minimal_symbol lookup_minimal_symbol (const char *name, const char *sfile, struct objfile *objf) { - struct objfile *objfile; found_minimal_symbols found; unsigned int mangled_hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE; @@ -323,10 +322,11 @@ lookup_minimal_symbol (const char *name, const char *sfile, lookup_name_info lookup_name (name, symbol_name_match_type::FULL); - for (objfile = object_files; - objfile != NULL && found.external_symbol.minsym == NULL; - objfile = objfile->next) + for (objfile *objfile : current_program_space->objfiles ()) { + if (found.external_symbol.minsym != NULL) + break; + if (objf == NULL || objf == objfile || objf == objfile->separate_debug_objfile_backlink) { @@ -522,17 +522,17 @@ iterate_over_minimal_symbols struct bound_minimal_symbol lookup_minimal_symbol_text (const char *name, struct objfile *objf) { - struct objfile *objfile; struct minimal_symbol *msymbol; struct bound_minimal_symbol found_symbol = { NULL, NULL }; struct bound_minimal_symbol found_file_symbol = { NULL, NULL }; unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE; - for (objfile = object_files; - objfile != NULL && found_symbol.minsym == NULL; - objfile = objfile->next) + for (objfile *objfile : current_program_space->objfiles ()) { + if (found_symbol.minsym != NULL) + break; + if (objf == NULL || objf == objfile || objf == objfile->separate_debug_objfile_backlink) { @@ -574,14 +574,11 @@ struct minimal_symbol * lookup_minimal_symbol_by_pc_name (CORE_ADDR pc, const char *name, struct objfile *objf) { - struct objfile *objfile; struct minimal_symbol *msymbol; unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE; - for (objfile = object_files; - objfile != NULL; - objfile = objfile->next) + for (objfile *objfile : current_program_space->objfiles ()) { if (objf == NULL || objf == objfile || objf == objfile->separate_debug_objfile_backlink) @@ -606,15 +603,12 @@ struct bound_minimal_symbol lookup_minimal_symbol_solib_trampoline (const char *name, struct objfile *objf) { - struct objfile *objfile; struct minimal_symbol *msymbol; struct bound_minimal_symbol found_symbol = { NULL, NULL }; unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE; - for (objfile = object_files; - objfile != NULL; - objfile = objfile->next) + for (objfile *objfile : current_program_space->objfiles ()) { if (objf == NULL || objf == objfile || objf == objfile->separate_debug_objfile_backlink) |