From 128a391fe45a234587dc585e03a7726cd6ee0255 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 23 Oct 2019 09:50:58 -0600 Subject: Virtualize "readin" and "compunit_symtab" This patch removes the "readin" and "compunit_symtab" members from partial_symtab, replacing them with methods. Then it introduces a new "standard_psymtab" class, which restores these members; and changes the symbol readers to use this intermediate class as the base class of their partial symtab subclasses. The reason for this is to make it possible for a symbol reader to implement an alternate mapping between partial and full symbol tables. This is important in order to be able to share psymtabs across objfiles -- whether a psymtab has been "readin" is objfile-dependent, as are the pointers to the full symbol tables. gdb/ChangeLog 2020-01-26 Tom Tromey * psymtab.c (partial_map_expand_apply) (psym_find_pc_sect_compunit_symtab, psym_lookup_symbol) (psymtab_to_symtab, psym_find_last_source_symtab, dump_psymtab) (psym_print_stats, psym_expand_symtabs_for_function) (psym_map_symbol_filenames, psym_map_matching_symbols) (psym_expand_symtabs_matching) (partial_symtab::read_dependencies, maintenance_info_psymtabs) (maintenance_check_psymtabs): Use new methods. * psympriv.h (struct partial_symtab) : New methods. : Remove members. (struct standard_psymtab): New. (struct legacy_psymtab): Derive from standard_psymtab. * dwarf2read.h (struct dwarf2_psymtab): Derive from standard_psymtab. * ctfread.c (struct ctf_psymtab): Derive from standard_psymtab. Change-Id: Idb923f196d7e03bf7cb9cfc8134ed06dd3f211ce --- gdb/ctfread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/ctfread.c') diff --git a/gdb/ctfread.c b/gdb/ctfread.c index 77cdcd4..d363ce6 100644 --- a/gdb/ctfread.c +++ b/gdb/ctfread.c @@ -116,10 +116,10 @@ struct ctf_context }; /* A partial symtab, specialized for this module. */ -struct ctf_psymtab : public partial_symtab +struct ctf_psymtab : public standard_psymtab { ctf_psymtab (const char *filename, struct objfile *objfile, CORE_ADDR addr) - : partial_symtab (filename, objfile, addr) + : standard_psymtab (filename, objfile, addr) { } -- cgit v1.1