forked from Imagelibrary/binutils-gdb
[gdb/symtab] Add sect_off map to partial_symtab
Initially, we added a sect_off field to partial_symbol, but that turned out to make the bcache aspect of partial symbols ineffective, changing the "percentage of duplicates" for "partial symbol cache" as reported by "maint print statistics" from 95% to 0%. This showed up both as a slow down and more memory usage. At least parts of the slow down could possibly be addressed by removing the bcache aspect entirely (given that there are no duplicates), but that wouldn't address the increase in memory usage. Instead, implement the sect_off field as a side table.
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
#include "objfiles.h"
|
||||
#include "gdbsupport/gdb_string_view.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
/* A partial_symbol records the name, domain, and address class of
|
||||
symbols whose types we have not parsed yet. For functions, it also
|
||||
contains their memory address, so we can find them from a PC value.
|
||||
@@ -343,6 +345,10 @@ struct partial_symtab
|
||||
|
||||
std::vector<partial_symbol *> static_psymbols;
|
||||
|
||||
/* The sect_offset corresponding to the partial symbols in this partial
|
||||
symbol table. */
|
||||
std::unordered_map<partial_symbol *, sect_offset> sect_off;
|
||||
|
||||
/* True iff objfile->psymtabs_addrmap is properly populated for this
|
||||
partial_symtab. For discontiguous overlapping psymtabs is the only usable
|
||||
info in PSYMTABS_ADDRMAP. */
|
||||
|
||||
Reference in New Issue
Block a user