* readelf.c (dump_section): Don't print 32-bit values, which
[deliverable/binutils-gdb.git] / gdb / objfiles.c
index 41aab64594a1d0bc4847dd9f2213d4e1184d66b0..a3af5a41f143977447e3f66182f933418c3c029b 100644 (file)
@@ -34,6 +34,9 @@
 #include "target.h"
 #include "bcache.h"
 #include "mdebugread.h"
+#include "expression.h"
+#include "parser-defs.h"
+
 #include "gdb_assert.h"
 #include <sys/types.h>
 #include "gdb_stat.h"
@@ -393,6 +396,10 @@ free_objfile (struct objfile *objfile)
       objfile->separate_debug_objfile_backlink->separate_debug_objfile = NULL;
     }
   
+  /* Remove any references to this objfile in the global value
+     lists.  */
+  preserve_values (objfile);
+
   /* First do any symbol file specific actions required when we are
      finished with a particular symbol file.  Note that if the objfile
      is using reusable symbol information (via mmalloc) then each of
@@ -437,6 +444,12 @@ free_objfile (struct objfile *objfile)
      for example), so we need to call this here.  */
   clear_pc_function_cache ();
 
+  /* Clear globals which might have pointed into a removed objfile.
+     FIXME: It's not clear which of these are supposed to persist
+     between expressions and which ought to be reset each time.  */
+  expression_context_block = NULL;
+  innermost_block = NULL;
+
   /* Check to see if the current_source_symtab belongs to this objfile,
      and if so, call clear_current_source_symtab_and_line. */
 
This page took 0.023936 seconds and 4 git commands to generate.