diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-06-23 18:19:54 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-06-23 18:19:54 +0000 |
commit | 5b2ab4610e175ef90edff7754e1121816b3eb5ad (patch) | |
tree | 7bf859ba71c2e5d36021949f6d73a65f21b7a5d9 /gdb/symfile.c | |
parent | 45d5d5ca5d94e8690843688cef1e320aca18d39e (diff) | |
download | gdb-5b2ab4610e175ef90edff7754e1121816b3eb5ad.zip gdb-5b2ab4610e175ef90edff7754e1121816b3eb5ad.tar.gz gdb-5b2ab4610e175ef90edff7754e1121816b3eb5ad.tar.bz2 |
gdb/
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.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index 968c8a8..25f3f26 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -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 (); |