This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/3] Introduce a separate debug objfile iterator


On 4/9/19 12:09 PM, Tom Tromey wrote:
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-09  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.

FYI, this series of patches has broken builds with older versions of GCC (we've got 5.2.1 installed on our build system here). Multiple failures like:

/path/to/gdb/minsyms.c: In function 'bound_minimal_symbol lookup_minimal_symbol_by_pc_section(CORE_ADDR, obj_section*, lookup_msym_prefer)': /path/to/gdb/minsyms.c:724:8: error: types may not be defined in a for-range-declaration [-Werror] for (struct objfile *objfile : section->objfile->separate_debug_objfiles ())
        ^~~~~~

-Sandra


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]