]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 27 Apr 2010 20:07:01 +0000 (20:07 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 27 Apr 2010 20:07:01 +0000 (20:07 +0000)
* objfiles.c: Include solist.h.
(free_all_objfiles): New variable so.  Check stale solist objfiles.
* symfile.c (symbol_file_clear): Swap the order of free_all_objfiles
and no_shared_libraries.

gdb/ChangeLog
gdb/objfiles.c
gdb/symfile.c

index aa87a5c78d3a89ce61a4da56c1bd39c846637afd..0bbf6ed6372419610b5f7f8809233c70a1c6ee2f 100644 (file)
@@ -1,3 +1,10 @@
+2010-04-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * objfiles.c: Include solist.h.
+       (free_all_objfiles): New variable so.  Check stale solist objfiles.
+       * symfile.c (symbol_file_clear): Swap the order of free_all_objfiles
+       and no_shared_libraries.
+
 2010-04-27  Joel Brobecker  <brobecker@adacore.com>
 
        ARI warning fix.
index 5be5c6a46ff398bed16da604ea8074715b462afd..cacdabae3b7352e4cd2898608a87c221af49bf4f 100644 (file)
@@ -53,6 +53,7 @@
 #include "observer.h"
 #include "complaints.h"
 #include "psymtab.h"
+#include "solist.h"
 
 /* Prototypes for local functions */
 
@@ -688,6 +689,11 @@ void
 free_all_objfiles (void)
 {
   struct objfile *objfile, *temp;
+  struct so_list *so;
+
+  /* Any objfile referencewould become stale.  */
+  for (so = master_so_list (); so; so = so->next)
+    gdb_assert (so->objfile == NULL);
 
   ALL_OBJFILES_SAFE (objfile, temp)
   {
index eda26cc0436bb8dbbed04dc758a29868cd8ff428..4f70445c6015cc32363a745ccd68e74b912301b6 100644 (file)
@@ -1228,13 +1228,12 @@ symbol_file_clear (int from_tty)
          : !query (_("Discard symbol table? "))))
     error (_("Not confirmed."));
 
-  free_all_objfiles ();
-
-  /* solib descriptors may have handles to objfiles.  Since their
-     storage has just been released, we'd better wipe the solib
-     descriptors as well.  */
+  /* solib descriptors may have handles to objfiles.  Wipe them before their
+     objfiles get stale by free_all_objfiles.  */
   no_shared_libraries (NULL, from_tty);
 
+  free_all_objfiles ();
+
   gdb_assert (symfile_objfile == NULL);
   if (from_tty)
     printf_unfiltered (_("No symbol file now.\n"));