a8767b3
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
f524ac5
From: Fedora GDB patches <invalid@email.com>
f524ac5
Date: Fri, 27 Oct 2017 21:07:50 +0200
d8c8d57
Subject: gdb-gnat-dwarf-crash-3of3.patch
f524ac5
f637971
;; Fix crash of -readnow /usr/lib/debug/usr/bin/gnatbind.debug (BZ 1069211).
f637971
;;=push+jan
f524ac5
f637971
http://sourceware.org/ml/gdb-patches/2014-02/msg00731.html
Jan Kratochvil 3e56442
Jan Kratochvil 3e56442
--6TrnltStXW4iwmi0
Jan Kratochvil 3e56442
Content-Type: text/plain; charset=us-ascii
Jan Kratochvil 3e56442
Content-Disposition: inline
Jan Kratochvil 3e56442
Jan Kratochvil 3e56442
Hi,
Jan Kratochvil 3e56442
Jan Kratochvil 3e56442
PR 16581:
Jan Kratochvil 3e56442
	GDB crash on inherit_abstract_dies infinite recursion
Jan Kratochvil 3e56442
	https://sourceware.org/bugzilla/show_bug.cgi?id=16581
Jan Kratochvil 3e56442
Jan Kratochvil 3e56442
fixed crash from an infinite recursion.  But in rare cases the new code can
Jan Kratochvil 3e56442
now gdb_assert() due to weird DWARF file.
Jan Kratochvil 3e56442
Jan Kratochvil 3e56442
I do not yet fully understand why the DWARF is as it is but just GDB should
Jan Kratochvil 3e56442
never crash due to invalid DWARF anyway.  The "invalid" DWARF I see only in
Jan Kratochvil 3e56442
Fedora GCC build, not in FSF GCC build, more info at:
Jan Kratochvil 3e56442
	https://bugzilla.redhat.com/show_bug.cgi?id=1069382
Jan Kratochvil 3e56442
	http://people.redhat.com/jkratoch/gcc-debuginfo-4.8.2-7.fc20.x86_64-gnatbind.debug
Jan Kratochvil 3e56442
Jan Kratochvil 3e56442
Thanks,
Jan Kratochvil 3e56442
Jan
Jan Kratochvil 3e56442
Jan Kratochvil 3e56442
--6TrnltStXW4iwmi0
Jan Kratochvil 3e56442
Content-Type: text/plain; charset=us-ascii
Jan Kratochvil 3e56442
Content-Disposition: inline; filename="complaint.patch"
Jan Kratochvil 3e56442
Jan Kratochvil 3e56442
gdb/
Jan Kratochvil 3e56442
2014-02-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan Kratochvil 3e56442
Jan Kratochvil 3e56442
	* dwarf2read.c (process_die): Change gdb_assert to complaint.
Jan Kratochvil 3e56442
f637971
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
f637971
--- a/gdb/dwarf2read.c
f637971
+++ b/gdb/dwarf2read.c
ad19172
@@ -10613,6 +10613,14 @@ private:
f637971
 static void
f637971
 process_die (struct die_info *die, struct dwarf2_cu *cu)
f637971
 {
Jan Kratochvil 3e56442
+  if (die->in_process)
Jan Kratochvil 3e56442
+    {
Jan Kratochvil 3e56442
+      complaint (&symfile_complaints,
Jan Kratochvil 3e56442
+		 _("DIE at 0x%x attempted to be processed twice"),
Jan Kratochvil 5bb0f3b
+		 to_underlying (die->sect_off));
Jan Kratochvil 3e56442
+      return;
Jan Kratochvil 3e56442
+    }
f637971
+
f637971
   process_die_scope scope (die, cu);
Jan Kratochvil 3e56442
 
f637971
   switch (die->tag)