Fix a regression by the mmap patch from 2009-06-16.
	* symfile.c (reread_symbols): Move sym_finish and clear_objfile_data
	calls before deleting the OBJFILE obstack.  Extend the comment.
This commit is contained in:
Jan Kratochvil 2009-06-23 18:19:54 +00:00
parent 45d5d5ca5d
commit 5b2ab4610e
2 changed files with 16 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2009-06-23 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix a regression by the mmap patch from 2009-06-16.
* symfile.c (reread_symbols): Move sym_finish and clear_objfile_data
calls before deleting the OBJFILE obstack. Extend the comment.
2009-06-23 Ulrich Weigand <uweigand@de.ibm.com>
* jv-lang.h (JAVA_OBJECT_SIZE): Remove.

View File

@ -2334,7 +2334,16 @@ reread_symbols (void)
/* Nuke all the state that we will re-read. Much of the following
code which sets things to NULL really is necessary to tell
other parts of GDB that there is nothing currently there. */
other parts of GDB that there is nothing currently there.
Try to keep the freeing order compatible with free_objfile. */
if (objfile->sf != NULL)
{
(*objfile->sf->sym_finish) (objfile);
}
clear_objfile_data (objfile);
/* FIXME: Do we have to free a whole linked list, or is this
enough? */
@ -2371,11 +2380,6 @@ reread_symbols (void)
sizeof (objfile->msymbol_hash));
memset (&objfile->msymbol_demangled_hash, 0,
sizeof (objfile->msymbol_demangled_hash));
clear_objfile_data (objfile);
if (objfile->sf != NULL)
{
(*objfile->sf->sym_finish) (objfile);
}
objfile->psymbol_cache = bcache_xmalloc ();
objfile->macro_cache = bcache_xmalloc ();