public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch] Fix dwarf2read save gdb-index error checks.
@ 2013-08-24  0:08 Doug Evans
  2013-08-26 15:16 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Evans @ 2013-08-24  0:08 UTC (permalink / raw)
  To: gdb-patches

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);
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Fix dwarf2read save gdb-index error checks.
  2013-08-24  0:08 [patch] Fix dwarf2read save gdb-index error checks Doug Evans
@ 2013-08-26 15:16 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2013-08-26 15:16 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

>>>>> "Doug" == Doug Evans <dje@google.com> writes:

Doug> 2013-08-23  Doug Evans  <dje@google.com>
Doug> 	* dwarf2read.c (write_psymtabs_to_index): Move error checks ahead of
Doug> 	missing debug info checks.

Looks good to me.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-26 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-24  0:08 [patch] Fix dwarf2read save gdb-index error checks Doug Evans
2013-08-26 15:16 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).