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

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