diff options
author | Tom Tromey <tom@tromey.com> | 2019-03-10 15:37:20 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-04-10 08:05:17 -0600 |
commit | e9ad22ee5f0a40dfa1182ee68e3349dd72a42afe (patch) | |
tree | 5500e93752b2711677dbcd2524e1d91f067bd680 /gdb/minsyms.c | |
parent | ee3711344b6e0cffeb237fa6889aab04853f9004 (diff) | |
download | gdb-e9ad22ee5f0a40dfa1182ee68e3349dd72a42afe.zip gdb-e9ad22ee5f0a40dfa1182ee68e3349dd72a42afe.tar.gz gdb-e9ad22ee5f0a40dfa1182ee68e3349dd72a42afe.tar.bz2 |
Introduce a separate debug objfile iterator
This introduces a new iterator and range adapter for iteration over
the separate debug files of a given objfile. As in the current
approach, the requested objfile is returned first, followed by the
separate debug objfiles.
gdb/ChangeLog
2019-04-10 Tom Tromey <tom@tromey.com>
* symtab.c (lookup_global_symbol_from_objfile)
(lookup_symbol_in_objfile_from_linkage_name): Use the iterator.
* objfiles.h (class separate_debug_iterator): New.
(class separate_debug_range): New.
(struct objfile) <separate_debug_objfiles>: New method.
(objfile_separate_debug_iterate): Don't declare.
* objfiles.c (separate_debug_iterator::operator++): Rename from
objfile_separate_debug_iterate.
(objfile_relocate, objfile_rebase, objfile_has_symbols): Use the
iterator.
* minsyms.c (lookup_minimal_symbol_by_pc_section): Use the
iterator.
Diffstat (limited to 'gdb/minsyms.c')
-rw-r--r-- | gdb/minsyms.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 34198d1..8037329 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -696,7 +696,6 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio int lo; int hi; int newobj; - struct objfile *objfile; struct minimal_symbol *msymbol; struct minimal_symbol *best_symbol = NULL; struct objfile *best_objfile = NULL; @@ -722,9 +721,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio gdb_assert (section != NULL); - for (objfile = section->objfile; - objfile != NULL; - objfile = objfile_separate_debug_iterate (section->objfile, objfile)) + for (struct objfile *objfile : section->objfile->separate_debug_objfiles ()) { CORE_ADDR pc = pc_in; |