aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-04-16 10:12:49 -0600
committerTom Tromey <tom@tromey.com>2022-06-12 10:49:48 -0600
commit93b527ef787b7c98611abd21bdd77de6c41769f1 (patch)
tree2ed7039b479e080e108387a9e7a53c2050d73f44 /gdb/buildsym.h
parentd89120e9493281a60d6e7280e9cfa3741ea7e379 (diff)
downloadgdb-93b527ef787b7c98611abd21bdd77de6c41769f1.zip
gdb-93b527ef787b7c98611abd21bdd77de6c41769f1.tar.gz
gdb-93b527ef787b7c98611abd21bdd77de6c41769f1.tar.bz2
Use malloc for mutable addrmaps
Mutable addrmaps currently require an obstack. This was probably done to avoid having to call splay_tree_delete, but examination of the code shows that all mutable obstacks have a limited lifetime -- now it's simple to treat them as ordinary C++ objects, in some cases stack-allocating them, and have a destructor to make the needed call. This patch implements this change.
Diffstat (limited to 'gdb/buildsym.h')
-rw-r--r--gdb/buildsym.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/gdb/buildsym.h b/gdb/buildsym.h
index c1cd519..2ad0033 100644
--- a/gdb/buildsym.h
+++ b/gdb/buildsym.h
@@ -21,6 +21,7 @@
#include "gdbsupport/gdb_obstack.h"
#include "symtab.h"
+#include "addrmap.h"
struct objfile;
struct symbol;
@@ -385,12 +386,7 @@ private:
/* The mutable address map for the compilation unit whose symbols
we're currently reading. The symtabs' shared blockvector will
point to a fixed copy of this. */
- struct addrmap_mutable *m_pending_addrmap = nullptr;
-
- /* The obstack on which we allocate pending_addrmap.
- If pending_addrmap is NULL, this is uninitialized; otherwise, it is
- initialized (and holds pending_addrmap). */
- auto_obstack m_pending_addrmap_obstack;
+ struct addrmap_mutable m_pending_addrmap;
/* True if we recorded any ranges in the addrmap that are different
from those in the blockvector already. We set this to false when