* dwarf2read.c (write_psymtabs_to_index): Move error checks ahead of
authorDoug Evans <dje@google.com>
Mon, 26 Aug 2013 18:38:37 +0000 (18:38 +0000)
committerDoug Evans <dje@google.com>
Mon, 26 Aug 2013 18:38:37 +0000 (18:38 +0000)
missing debug info checks.

gdb/ChangeLog
gdb/dwarf2read.c

index 923fb89..91dc2d4 100644 (file)
@@ -1,3 +1,8 @@
+2013-08-26  Doug Evans  <dje@google.com>
+
+       * dwarf2read.c (write_psymtabs_to_index): Move error checks ahead of
+       missing debug info checks.
+
 2013-08-26  Raunaq Bathija  <raunaq12@in.ibm.com>
            Ulrich Weigand  <uweigand@de.ibm.com>
 
index 7891e32..d1ce946 100644 (file)
@@ -21263,15 +21263,15 @@ 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 || !objfile->psymtabs_addrmap)
-    return;
-
   if (dwarf2_per_objfile->using_index)
     error (_("Cannot use an index to create the index"));
 
   if (VEC_length (dwarf2_section_info_def, dwarf2_per_objfile->types) > 1)
     error (_("Cannot make an index when the file has multiple .debug_types sections"));
 
+  if (!objfile->psymtabs || !objfile->psymtabs_addrmap)
+    return;
+
   if (stat (objfile->name, &st) < 0)
     perror_with_name (objfile->name);