This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] move dwarf2_free_objfile to dwarf2_per_objfile_cleanup
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 13 Sep 2009 10:06:18 -0700
- Subject: Re: [RFA] move dwarf2_free_objfile to dwarf2_per_objfile_cleanup
- References: <20090904235009.5FA8D843B9@localhost>
> 2009-09-04 Doug Evans <dje@google.com>
>
> * symfile.h (dwarf2_free_objfile): Delete.
> * dwarf2read.c (dwarf2_build_psymtabs_hard): Pass dwarf2_per_objfile
> to free_cached_comp_units.
> (free_cached_comp_units): Remove reference to global
> dwarf2_per_objfile, use passed parameter instead.
> (dwarf2_free_objfile): Delete, contents moved to ...
> (dwarf2_per_objfile_cleanup): ... here.
> * coffread.c (coff_symfile_finish): Delete call to dwarf2_free_objfile.
> * elfread.c (elf_symfile_finish): Delete call to dwarf2_free_objfile.
Not really an expert in this area, but does it look like you are
re-reading the per-objfile data a second time when converting from
a psymtab to a symtab? On the plus side, I really find it makes
the code clearer to understand - it's a bit hard to figure out
the lifetime of this global... Was the memory every released before?
(I see two calls to sym_finish, one when free_objfile is called,
and one when reread_symbols is called - these two are not necessarily
called after the symtab has been computed)
--
Joel