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