diff options
author | Tom Tromey <tom@tromey.com> | 2021-03-20 17:23:40 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-03-20 17:23:42 -0600 |
commit | 75336a5a2aa345953d0a9de73205457b6d9e27c2 (patch) | |
tree | 73e2373cad911b81c529089a73db5b199b26ae05 /gdb/psympriv.h | |
parent | 39298a5d973d5822ed7d09230f67cc83f72a06c2 (diff) | |
download | gdb-75336a5a2aa345953d0a9de73205457b6d9e27c2.zip gdb-75336a5a2aa345953d0a9de73205457b6d9e27c2.tar.gz gdb-75336a5a2aa345953d0a9de73205457b6d9e27c2.tar.bz2 |
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 <tom@tromey.com>
* quick-symbol.h (struct quick_symbol_functions)
<relocated>: New method.
* psymtab.h (struct psymbol_functions) <relocated>: New
method.
<fill_psymbol_map>: Declare method.
<m_psymbol_map>: 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) <psymbol_map>: Remove.
* objfiles.c (objfile_relocate1): Update.
Diffstat (limited to 'gdb/psympriv.h')
-rw-r--r-- | gdb/psympriv.h | 17 |
1 files changed, 17 insertions, 0 deletions
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<CORE_ADDR> *seen_addrs, + const std::vector<partial_symbol *> &symbols); + + /* Map symbol addresses to the partial symtab that defines the + object at that address. */ + + std::vector<std::pair<CORE_ADDR, partial_symtab *>> m_psymbol_map; }; #endif /* PSYMPRIV_H */ |