diff options
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/symfile.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dfd80c0..279e3e2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-11-13 Joel Brobecker <brobecker@adacore.com> + + * symfile.c (reread_symbols): Move call to set_objfile_per_bfd + after re-initialization of OBJFILE's obstack. + 2013-11-12 Doug Evans <dje@sebabeach.org> * breakpoint.c (bpstat_check_breakpoint_conditions): Assert diff --git a/gdb/symfile.c b/gdb/symfile.c index 1307189..61e3e44 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2591,13 +2591,17 @@ reread_symbols (void) memset (&objfile->msymbol_demangled_hash, 0, sizeof (objfile->msymbol_demangled_hash)); - set_objfile_per_bfd (objfile); - /* obstack_init also initializes the obstack so it is empty. We could use obstack_specify_allocation but gdb_obstack.h specifies the alloc/dealloc functions. */ obstack_init (&objfile->objfile_obstack); + /* set_objfile_per_bfd potentially allocates the per-bfd + data on the objfile's obstack (if sharing data across + multiple users is not possible), so it's important to + do it *after* the obstack has been initialized. */ + set_objfile_per_bfd (objfile); + objfile->original_name = obstack_copy0 (&objfile->objfile_obstack, original_name, strlen (original_name)); |