gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 9 Apr 2011 15:20:38 +0000 (15:20 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 9 Apr 2011 15:20:38 +0000 (15:20 +0000)
Fix crash of gdb save-index on a STABS file.
* dwarf2read.c (write_psymtabs_to_index): Return also on no
PSYMTABS_ADDRMAP.

gdb/ChangeLog
gdb/dwarf2read.c

index 038c56b8a0ec7a84a4077e14585808c36379de2e..7da8c9e892df4a9c2c5759b0a17f0d9272544c3a 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix crash of gdb save-index on a STABS file.
+       * dwarf2read.c (write_psymtabs_to_index): Return also on no
+       PSYMTABS_ADDRMAP.
+
 2011-04-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Fix DW_AT_accessibility compatibility with gcc-4.6+.
index 15311feca12c1b5844ecd988d53815c1597daa9a..5bf98deb91604df4ec1fb726b7a6ebcadcbb7149 100644 (file)
@@ -15843,8 +15843,9 @@ write_psymtabs_to_index (struct objfile *objfile, const char *dir)
   htab_t cu_index_htab;
   struct psymtab_cu_index_map *psymtab_cu_index_map;
 
-  if (!objfile->psymtabs)
+  if (!objfile->psymtabs || !objfile->psymtabs_addrmap)
     return;
+
   if (dwarf2_per_objfile->using_index)
     error (_("Cannot use an index to create the index"));