aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-10-22 01:16:34 +0000
committerDaniel Jacobowitz <drow@false.org>2007-10-22 01:16:34 +0000
commitfe3e1990b3ea81a95d90721f8e86fb5a10f76ba1 (patch)
tree677f8787ef5c105ed5ee005bdabfce70c7325da4 /gdb/dwarf2read.c
parentaf81c53cb734e712ffa213e94a4db302d1a3f8a2 (diff)
downloadgdb-fe3e1990b3ea81a95d90721f8e86fb5a10f76ba1.zip
gdb-fe3e1990b3ea81a95d90721f8e86fb5a10f76ba1.tar.gz
gdb-fe3e1990b3ea81a95d90721f8e86fb5a10f76ba1.tar.bz2
* coffread.c (coff_symfile_finish): Call dwarf2_free_objfile.
* dwarf2read.c (dwarf2_free_objfile): New. * elfread.c (elf_symfile_finish): Call dwarf2_free_objfile. * symfile.h (dwarf2_free_objfile): Declare.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index e5e8aa4..dbbe019 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -9964,6 +9964,22 @@ free_one_cached_comp_unit (void *target_cu)
}
}
+/* Release all extra memory associated with OBJFILE. */
+
+void
+dwarf2_free_objfile (struct objfile *objfile)
+{
+ dwarf2_per_objfile = objfile_data (objfile, dwarf2_objfile_data_key);
+
+ if (dwarf2_per_objfile == NULL)
+ return;
+
+ /* Cached DIE trees use xmalloc and the comp_unit_obstack. */
+ free_cached_comp_units (NULL);
+
+ /* Everything else should be on the objfile obstack. */
+}
+
/* A pair of DIE offset and GDB type pointer. We store these
in a hash table separate from the DIEs, and preserve them
when the DIEs are flushed out of cache. */