From adb7f3388f557308fab00d544185922035efa8f0 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 18 Sep 2009 17:33:51 +0000 Subject: [PATCH] gdb/ * objfiles.c (free_objfile): Clear SYMFILE_OBJFILE if it is OBJFILE. * rs6000-nat.c (vmap_ldinfo): Only assertion check SYMFILE_OBJFILE now. * symfile.c (syms_from_objfile, symbol_file_clear): Likewise. --- gdb/ChangeLog | 8 +++++++- gdb/objfiles.c | 4 ++-- gdb/rs6000-nat.c | 2 +- gdb/symfile.c | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 34865017c41..427f61f062f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,4 +1,10 @@ -2009-09-19 Ulrich Weigand +2009-09-18 Jan Kratochvil + + * objfiles.c (free_objfile): Clear SYMFILE_OBJFILE if it is OBJFILE. + * rs6000-nat.c (vmap_ldinfo): Only assertion check SYMFILE_OBJFILE now. + * symfile.c (syms_from_objfile, symbol_file_clear): Likewise. + +2009-09-18 Ulrich Weigand * rs6000-tdep.c (rs6000_builtin_type_vec128): Add v2_double union member. diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 1f7489f22d8..8dcca702a76 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -459,8 +459,8 @@ free_objfile (struct objfile *objfile) unlink_objfile (objfile); - /* If we are going to free the runtime common objfile, mark it - as unallocated. */ + if (objfile == symfile_objfile) + symfile_objfile = NULL; if (objfile == rt_common_objfile) rt_common_objfile = NULL; diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index 7fa7c4107c2..82730464f94 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -915,7 +915,7 @@ If in fact that file has symbols which the mapped files listed by\n\ symbols to the proper address)."), symfile_objfile->name); free_objfile (symfile_objfile); - symfile_objfile = NULL; + gdb_assert (symfile_objfile == NULL); } breakpoint_re_set (); } diff --git a/gdb/symfile.c b/gdb/symfile.c index 2f3441cbb44..2458201122e 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -786,7 +786,7 @@ syms_from_objfile (struct objfile *objfile, if (symfile_objfile != NULL) { free_objfile (symfile_objfile); - symfile_objfile = NULL; + gdb_assert (symfile_objfile == NULL); } /* Currently we keep symbols from the add-symbol-file command. @@ -1150,7 +1150,7 @@ symbol_file_clear (int from_tty) descriptors as well. */ no_shared_libraries (NULL, from_tty); - symfile_objfile = NULL; + gdb_assert (symfile_objfile == NULL); if (from_tty) printf_unfiltered (_("No symbol file now.\n")); } -- 2.30.2