Change how DWARF indices use addrmap

Currently the DWARF index readers reuse the objfile's partial symbol
table in order to store an addrmap.  We're going to be remove the
partial symbol object, so this patch changes the DWARF reader to store
this addrmap in the per_bfd object.  This object is chosen, rather
than the quick_symbol_functions subclass, because the addrmap can be
shared across objfiles.

gdb/ChangeLog
2021-03-20  Tom Tromey  <tom@tromey.com>

	* dwarf2/read.h (struct dwarf2_per_bfd) <psymtabs_addrmap>: New
	member.
	* dwarf2/read.c (create_addrmap_from_index)
	(create_addrmap_from_aranges): Set per_bfd addrmap.
	(dwarf2_read_gdb_index): Don't set partial_symtabs.
	(dwarf2_base_index_functions::find_pc_sect_compunit_symtab): Use
	per_bfd addrmap.
	(dwarf2_read_debug_names): Don't set partial_symtabs.
	(dwarf2_initialize_objfile): Likewise.
This commit is contained in:
Tom Tromey
2021-03-20 17:23:40 -06:00
parent 51962708bd
commit efd7398ee2
3 changed files with 32 additions and 26 deletions

View File

@@ -257,6 +257,9 @@ public:
partial symbols have been read the first time. */
std::shared_ptr<psymtab_storage> partial_symtabs;
/* The address map that is used by the DWARF index code. */
struct addrmap *index_addrmap = nullptr;
private:
/* The total number of per_cu and signatured_type objects that have