From 3aa31ce7884f979c68d440a4352c8d69a3283f6c Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 20 Mar 2021 17:23:40 -0600 Subject: Remove last objfile partial_symtab references from psymtab.c This removes the last references to the partial_symtab via the objfile from psymtab.c. require_partial_symbols is now a method on psymbol_functions, and maintenance_print_psymbols is changed to use dynamic_cast to verify that it is examining partial symbols. gdb/ChangeLog 2021-03-20 Tom Tromey * psymtab.c (psymbol_functions::require_partial_symbols): Rename. (psymbol_functions::find_pc_sect_psymtab): Rename. (psymbol_functions::find_pc_sect_compunit_symtab) (maintenance_print_psymbols, maintenance_check_psymtabs): Update. * psympriv.h (struct psymbol_functions) : Declare new method. : Likewise. --- gdb/psympriv.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'gdb/psympriv.h') diff --git a/gdb/psympriv.h b/gdb/psympriv.h index 8717bd2..85651f5 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -559,6 +559,18 @@ struct psymbol_functions : public quick_symbol_functions m_psymbol_map.clear (); } + /* Ensure the partial symbols for OBJFILE have been loaded. Return + a range adapter for the psymtabs. */ + psymtab_storage::partial_symtab_range require_partial_symbols + (struct objfile *objfile); + + /* Return the partial symbol storage associated with this + object. */ + const std::shared_ptr &get_partial_symtabs () const + { + return m_partial_symtabs; + } + /* Replace the partial symbol table storage in this object with SYMS. */ void set_partial_symtabs (const std::shared_ptr &syms) @@ -566,6 +578,17 @@ struct psymbol_functions : public quick_symbol_functions m_partial_symtabs = syms; } + /* Find which partial symtab contains PC and SECTION. Return NULL if + none. We return the psymtab that contains a symbol whose address + exactly matches PC, or, if we cannot find an exact match, the + psymtab that contains a symbol whose address is closest to PC. */ + + struct partial_symtab *find_pc_sect_psymtab + (struct objfile *objfile, + CORE_ADDR pc, + struct obj_section *section, + struct bound_minimal_symbol msymbol); + private: void fill_psymbol_map (struct objfile *objfile, -- cgit v1.1