aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-06-21 12:19:00 +0200
committerTom de Vries <tdevries@suse.de>2021-06-24 17:44:35 +0200
commita3d638484949f751aa8c7a8612faf49b6c761812 (patch)
tree1533ec394942e478b3f0b5d23ea7830dc855df7b
parent560671a154d21c7982c039b98576a9d287e7665f (diff)
downloadbinutils-a3d638484949f751aa8c7a8612faf49b6c761812.zip
binutils-a3d638484949f751aa8c7a8612faf49b6c761812.tar.gz
binutils-a3d638484949f751aa8c7a8612faf49b6c761812.tar.bz2
[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.
-rw-r--r--gdb/psympriv.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/psympriv.h b/gdb/psympriv.h
index 59dd66f..246891d 100644
--- a/gdb/psympriv.h
+++ b/gdb/psympriv.h
@@ -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. */