aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-02-12 15:45:08 -0700
committerTom Tromey <tom@tromey.com>2020-02-12 15:51:58 -0700
commit0d404d447ae34e31bdf58ba09c5d3254db3766e1 (patch)
treeee47cdf3f464aba9c516d2ea46fa4885f64d9432
parenta7a3ae5c02d6d8711c2c336b9b809d05211fc497 (diff)
downloadgdb-0d404d447ae34e31bdf58ba09c5d3254db3766e1.zip
gdb-0d404d447ae34e31bdf58ba09c5d3254db3766e1.tar.gz
gdb-0d404d447ae34e31bdf58ba09c5d3254db3766e1.tar.bz2
Add per-unit obstack
This adds an auto_obstack to the DWARF frame comp_unit object, and then changes the remaining code here to use the comp_unit obstack rather than the objfile obstack. At this point, all the storage for frame data is self-contained -- that is, it is independent of the objfile. gdb/ChangeLog 2020-02-12 Tom Tromey <tom@tromey.com> * dwarf2/frame.c (struct comp_unit) <obstack>: New member. (decode_frame_entry_1): Use the comp_unit obstack.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/dwarf2/frame.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1ac9884..5b70563 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2020-02-12 Tom Tromey <tom@tromey.com>
+ * dwarf2/frame.c (struct comp_unit) <obstack>: New member.
+ (decode_frame_entry_1): Use the comp_unit obstack.
+
+2020-02-12 Tom Tromey <tom@tromey.com>
+
* dwarf2/frame.c (struct comp_unit): Add initializers and
constructor.
(dwarf2_frame_objfile_data): Store a comp_unit.
diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c
index b08e792..53f9079 100644
--- a/gdb/dwarf2/frame.c
+++ b/gdb/dwarf2/frame.c
@@ -164,6 +164,9 @@ struct comp_unit
/* The FDE table. */
dwarf2_fde_table fde_table;
+
+ /* Hold data used by this module. */
+ auto_obstack obstack;
};
static struct dwarf2_fde *dwarf2_frame_find_fde (CORE_ADDR *pc,
@@ -1777,7 +1780,7 @@ decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start,
if (find_cie (cie_table, cie_pointer))
return end;
- cie = XOBNEW (&unit->objfile->objfile_obstack, struct dwarf2_cie);
+ cie = XOBNEW (&unit->obstack, struct dwarf2_cie);
cie->initial_instructions = NULL;
cie->cie_pointer = cie_pointer;
@@ -1956,7 +1959,7 @@ decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start,
if (cie_pointer >= unit->dwarf_frame_size)
return NULL;
- fde = XOBNEW (&unit->objfile->objfile_obstack, struct dwarf2_fde);
+ fde = XOBNEW (&unit->obstack, struct dwarf2_fde);
fde->cie = find_cie (cie_table, cie_pointer);
if (fde->cie == NULL)
{