* dwarf2read.c (dwarf2_free_objfile): New.
* elfread.c (elf_symfile_finish): Call dwarf2_free_objfile.
* symfile.h (dwarf2_free_objfile): Declare.
+2007-10-21 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * 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.
+
2007-10-21 Joel Brobecker <brobecker@adacore.com>
* hppa-hpux-nat.c (hppa_hpux_store_register): Add missing semi-colon.
/* Let stabs reader clean up */
stabsread_clear_cache ();
+
+ dwarf2_free_objfile (objfile);
}
\f
}
}
+/* 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. */
{
xfree (objfile->deprecated_sym_stab_info);
}
+
+ dwarf2_free_objfile (objfile);
}
/* ELF specific initialization routine for reading symbols.
extern void dwarf2_build_psymtabs (struct objfile *, int);
extern void dwarf2_build_frame_info (struct objfile *);
+void dwarf2_free_objfile (struct objfile *);
+
/* From mdebugread.c */
/* Hack to force structures to exist before use in parameter list. */