Blame SOURCES/gdb-gnat-dwarf-crash-3of3.patch

8c62a9
http://sourceware.org/ml/gdb-patches/2014-02/msg00731.html
8c62a9
Subject: [patch] gdb_assert -> complaint for weird DWARF
8c62a9
8c62a9
8c62a9
--6TrnltStXW4iwmi0
8c62a9
Content-Type: text/plain; charset=us-ascii
8c62a9
Content-Disposition: inline
8c62a9
8c62a9
Hi,
8c62a9
8c62a9
PR 16581:
8c62a9
	GDB crash on inherit_abstract_dies infinite recursion
8c62a9
	https://sourceware.org/bugzilla/show_bug.cgi?id=16581
8c62a9
8c62a9
fixed crash from an infinite recursion.  But in rare cases the new code can
8c62a9
now gdb_assert() due to weird DWARF file.
8c62a9
8c62a9
I do not yet fully understand why the DWARF is as it is but just GDB should
8c62a9
never crash due to invalid DWARF anyway.  The "invalid" DWARF I see only in
8c62a9
Fedora GCC build, not in FSF GCC build, more info at:
8c62a9
	https://bugzilla.redhat.com/show_bug.cgi?id=1069382
8c62a9
	http://people.redhat.com/jkratoch/gcc-debuginfo-4.8.2-7.fc20.x86_64-gnatbind.debug
8c62a9
8c62a9
8c62a9
Thanks,
8c62a9
Jan
8c62a9
8c62a9
--6TrnltStXW4iwmi0
8c62a9
Content-Type: text/plain; charset=us-ascii
8c62a9
Content-Disposition: inline; filename="complaint.patch"
8c62a9
8c62a9
gdb/
8c62a9
2014-02-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
8c62a9
8c62a9
	* dwarf2read.c (process_die): Change gdb_assert to complaint.
8c62a9
8c62a9
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
8c62a9
index 3eaa0b1..71f5d34 100644
8c62a9
--- a/gdb/dwarf2read.c
8c62a9
+++ b/gdb/dwarf2read.c
8c62a9
@@ -8029,7 +8029,13 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
8c62a9
   struct cleanup *in_process;
8c62a9
 
8c62a9
   /* We should only be processing those not already in process.  */
8c62a9
-  gdb_assert (!die->in_process);
8c62a9
+  if (die->in_process)
8c62a9
+    {
8c62a9
+      complaint (&symfile_complaints,
8c62a9
+		 _("DIE at 0x%x attempted to be processed twice"),
8c62a9
+		 die->offset.sect_off);
8c62a9
+      return;
8c62a9
+    }
8c62a9
 
8c62a9
   die->in_process = 1;
8c62a9
   in_process = make_cleanup (reset_die_in_process,die);
8c62a9
8c62a9
--6TrnltStXW4iwmi0--
8c62a9