From 75336a5a2aa345953d0a9de73205457b6d9e27c2 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 20 Mar 2021 17:23:40 -0600 Subject: Move psymbol_map out of objfile objfile::psymbol_map is used to implement a Rust feature. It is currently specific to partial symbols -- it isn't used by the DWARF indices. This patch moves it out of objfile and into psymbol_functions, adding a new method to quick_symbol_functions to handle the clearing case. This is needed because the map holds unrelocated addresses. gdb/ChangeLog 2021-03-20 Tom Tromey * quick-symbol.h (struct quick_symbol_functions) : New method. * psymtab.h (struct psymbol_functions) : New method. : Declare method. : New member. * psymtab.c (psymbol_functions::fill_psymbol_map): Rename. (psymbol_functions::find_compunit_symtab_by_address): Update. * objfiles.h (reset_psymtabs): Don't clear psymbol_map. (struct objfile) : Remove. * objfiles.c (objfile_relocate1): Update. --- gdb/psympriv.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gdb/psympriv.h') diff --git a/gdb/psympriv.h b/gdb/psympriv.h index 6b9ee18..73f00a5 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -535,6 +535,23 @@ struct psymbol_functions : public quick_symbol_functions void map_symbol_filenames (struct objfile *objfile, symbol_filename_ftype *fun, void *data, int need_fullname) override; + + void relocated () override + { + m_psymbol_map.clear (); + } + +private: + + void fill_psymbol_map (struct objfile *objfile, + struct partial_symtab *psymtab, + std::set *seen_addrs, + const std::vector &symbols); + + /* Map symbol addresses to the partial symtab that defines the + object at that address. */ + + std::vector> m_psymbol_map; }; #endif /* PSYMPRIV_H */ -- cgit v1.1