This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] Fix dwarf2read save gdb-index error checks.
- From: Doug Evans <dje at google dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 23 Aug 2013 17:08:55 -0700
- Subject: [patch] Fix dwarf2read save gdb-index error checks.
Hi.
There's a check in the implementation of "save gdb-index"
that flags an error if an index is currently in use: we currently
don't support creating an index from an index.
This error currently doesn't fire because if we're using an index
then obviously there's no psymtabs (and thus the command will
silently "succeed").
I will commit this in a few days if there are no objections.
2013-08-23 Doug Evans <dje@google.com>
* dwarf2read.c (write_psymtabs_to_index): Move error checks ahead of
missing debug info checks.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.827
diff -u -p -r1.827 dwarf2read.c
--- dwarf2read.c 20 Aug 2013 18:57:00 -0000 1.827
+++ dwarf2read.c 24 Aug 2013 00:03:43 -0000
@@ -21263,15 +21263,15 @@ write_psymtabs_to_index (struct objfile
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);