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

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