+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.
/* 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? */
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 ();