From 260b681b41cf3953ac2a2e5e3e6a4f690a75064d Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Mon, 26 Aug 2013 18:38:37 +0000 Subject: [PATCH] * dwarf2read.c (write_psymtabs_to_index): Move error checks ahead of missing debug info checks. --- gdb/ChangeLog | 5 +++++ gdb/dwarf2read.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 923fb89da0e..91dc2d4aa22 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-08-26 Doug Evans + + * dwarf2read.c (write_psymtabs_to_index): Move error checks ahead of + missing debug info checks. + 2013-08-26 Raunaq Bathija Ulrich Weigand diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 7891e32d753..d1ce9460bac 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -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); -- 2.30.2