From eb36a3eb2f846b8d4b16c1bb114136961d0ce5bf Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 20 Mar 2021 17:23:40 -0600 Subject: Allow multiple partial symbol readers per objfile This patch finally changes gdb so that an objfile can have multiple sources of partial symbols (or mixed partial symbols and other kinds of indices). This is done by having each symbol reader create its own psymbol_functions object and add it to the 'qf' list in the objfile. gdb/ChangeLog 2021-03-20 Tom Tromey * xcoffread.c (xcoff_initial_scan): Create partial symtabs. * symfile.c (syms_from_objfile_1, reread_symbols): Update. * psymtab.h (make_psymbol_functions): Don't declare. * psymtab.c (make_psymbol_functions): Remove. (maintenance_print_psymbols): Update. * psympriv.h (struct psymbol_functions): Add no-argument constructor. * objfiles.h (struct objfile) : Remove. : Remove. * mdebugread.c (mdebug_build_psymtabs): Create partial symtabs. * elfread.c (read_partial_symbols): Update. (elf_symfile_read): Remove check for existing partial symbols. Don't clear "qf". * dwarf2/read.c (dwarf2_has_info): Remove check for existing partial symbols. (dwarf2_build_psymtabs): Add psymbol_functions parameter. Create partial symtabs. * dwarf2/public.h (dwarf2_build_psymtabs): Add psymbol_functions parameter. * dbxread.c (dbx_symfile_read): Create partial symtabs. * ctfread.c (elfctf_build_psymtabs): Create partial symtabs. --- gdb/xcoffread.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gdb/xcoffread.c') diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index f8d428127da..30ac876e8e3 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -2946,7 +2946,9 @@ xcoff_initial_scan (struct objfile *objfile, symfile_add_flags symfile_flags) /* Now that the symbol table data of the executable file are all in core, process them and define symbols accordingly. */ - psymtab_storage *partial_symtabs = objfile->partial_symtabs.get (); + psymbol_functions *psf = new psymbol_functions (); + psymtab_storage *partial_symtabs = psf->get_partial_symtabs ().get (); + objfile->qf.emplace_front (psf); scan_xcoff_symtab (reader, partial_symtabs, objfile); /* Install any minimal symbols that have been collected as the current -- cgit v1.2.3-65-gdbad