* symfile.c (clear_symtab_users): Call
authorDaniel Jacobowitz <drow@false.org>
Tue, 8 Mar 2005 21:40:46 +0000 (21:40 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 8 Mar 2005 21:40:46 +0000 (21:40 +0000)
clear_current_source_symtab_and_line first.

gdb/ChangeLog
gdb/symfile.c

index 70e447888726d0473cdd710ac125f7c7ba8450fa..ccb361f81a3d1205d438878c16b6252d293bd902 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-08  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * symfile.c (clear_symtab_users): Call
+       clear_current_source_symtab_and_line first.
+
 2005-03-08  Nathan Sidwell  <nathan@codesourcery.com>
 
        * ax-gdb.c (gen_expr): Add UNOP_PLUS case.
index 1dbc2b25033f4b5c83e690eb2dd6b0a7bec95291..89878bcbcf71cd60ca32d383460325b4eb35805f 100644 (file)
@@ -2367,12 +2367,16 @@ clear_symtab_users (void)
 {
   /* Someday, we should do better than this, by only blowing away
      the things that really need to be blown.  */
+
+  /* Clear the "current" symtab first, because it is no longer valid.
+     breakpoint_re_set may try to access the current symtab.  */
+  clear_current_source_symtab_and_line ();
+
   clear_value_history ();
   clear_displays ();
   clear_internalvars ();
   breakpoint_re_set ();
   set_default_breakpoint (0, 0, 0, 0);
-  clear_current_source_symtab_and_line ();
   clear_pc_function_cache ();
   if (deprecated_target_new_objfile_hook)
     deprecated_target_new_objfile_hook (NULL);