aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-20 17:23:40 -0600
committerTom Tromey <tom@tromey.com>2021-03-20 17:23:45 -0600
commite11145903f25b7ac91dd12e6330df3faec0a3f1b (patch)
tree921a7ace0f6baf95a09d3063413050f213b947f1 /gdb/elfread.c
parentde909f0b765dbe6223292c2d05e97631136df42b (diff)
downloadgdb-e11145903f25b7ac91dd12e6330df3faec0a3f1b.zip
gdb-e11145903f25b7ac91dd12e6330df3faec0a3f1b.tar.gz
gdb-e11145903f25b7ac91dd12e6330df3faec0a3f1b.tar.bz2
Switch objfile to hold a list of psymbol readers
This changes objfile::qf to be a forward_list, and then updates all the uses to iterate over the list. Note that there is still only ever a single element in the list; this is handled by clearing the list whenever an object is added. gdb/ChangeLog 2021-03-20 Tom Tromey <tom@tromey.com> * dwarf2/read.c (dwarf2_build_psymtabs): Update. * symfile.c (syms_from_objfile_1, reread_symbols): Update. * symfile-debug.c (objfile::has_partial_symbols) (objfile::find_last_source_symtab) (objfile::forget_cached_source_info) (objfile::map_symtabs_matching_filename, objfile::lookup_symbol) (objfile::print_stats, objfile::dump) (objfile::expand_symtabs_for_function) (objfile::expand_all_symtabs) (objfile::expand_symtabs_with_fullname) (objfile::map_matching_symbols) (objfile::expand_symtabs_matching) (objfile::find_pc_sect_compunit_symtab) (objfile::map_symbol_filenames) (objfile::find_compunit_symtab_by_address) (objfile::lookup_global_symbol_language) (objfile::require_partial_symbols): Update. * psymtab.c (maintenance_print_psymbols) (maintenance_info_psymtabs, maintenance_check_psymtabs): Update. * objfiles.h (struct objfile) <qf>: Now a forward_list. * objfiles.c (objfile_relocate1): Update. * elfread.c (elf_symfile_read): Update.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 157a071..1cf9b2a 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -1287,10 +1287,12 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
switch (index_kind)
{
case dw_index_kind::GDB_INDEX:
- objfile->qf = make_dwarf_gdb_index ();
+ objfile->qf.clear ();
+ objfile->qf.push_front (make_dwarf_gdb_index ());
break;
case dw_index_kind::DEBUG_NAMES:
- objfile->qf = make_dwarf_debug_names ();
+ objfile->qf.clear ();
+ objfile->qf.push_front (make_dwarf_debug_names ());
break;
}
}
@@ -1300,7 +1302,8 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
partial symbols, because OBJF_PSYMTABS_READ has not been
set, and so our lazy reader function will still be called
when needed. */
- objfile->qf.reset
+ objfile->qf.clear ();
+ objfile->qf.emplace_front
(new lazy_dwarf_reader (objfile->partial_symtabs));
}
}