]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 6 Apr 2011 00:08:12 +0000 (00:08 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 6 Apr 2011 00:08:12 +0000 (00:08 +0000)
Fix crash regression on systems featuring .gdb_index.
* objfiles.c (free_objfile): Move the
forget_cached_source_info_for_objfile call earlier.  Comment it.
Extend the comment for objfile_free_data.

gdb/ChangeLog
gdb/objfiles.c

index 777947dc9bcd3f7bb809caf59d306611c3ad29e4..848a0728f68e27424358f8ff94473f87d631fa5e 100644 (file)
@@ -1,3 +1,10 @@
+2011-04-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix crash regression on systems featuring .gdb_index.
+       * objfiles.c (free_objfile): Move the
+       forget_cached_source_info_for_objfile call earlier.  Comment it.
+       Extend the comment for objfile_free_data.
+
 2011-04-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Fix regression of displaying the debug format.
index 1664e429f0a820bcf80f53b477df24454f1265b8..db01f4245881712ca7dc6955e71ee0d9e5fc1608 100644 (file)
@@ -583,6 +583,10 @@ free_objfile (struct objfile *objfile)
      lists.  */
   preserve_values (objfile);
 
+  /* It still may reference data modules have associated with the objfile and
+     the symbol file data.  */
+  forget_cached_source_info_for_objfile (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
@@ -595,7 +599,8 @@ free_objfile (struct objfile *objfile)
       (*objfile->sf->sym_finish) (objfile);
     }
 
-  /* Discard any data modules have associated with the objfile.  */
+  /* Discard any data modules have associated with the objfile.  The function
+     still may reference objfile->obfd.  */
   objfile_free_data (objfile);
 
   gdb_bfd_unref (objfile->obfd);
@@ -637,8 +642,6 @@ free_objfile (struct objfile *objfile)
       clear_current_source_symtab_and_line ();
   }
 
-  forget_cached_source_info_for_objfile (objfile);
-
   /* The last thing we do is free the objfile struct itself.  */
 
   xfree (objfile->name);