Blame SOURCES/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch

b2f73e
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
b2f73e
From: Fedora GDB patches <invalid@email.com>
b2f73e
Date: Fri, 27 Oct 2017 21:07:50 +0200
b2f73e
Subject: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
b2f73e
b2f73e
;; Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379).
b2f73e
;;=fedora
b2f73e
b2f73e
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
b2f73e
b2f73e
diff --git a/gdb/symtab.c b/gdb/symtab.c
b2f73e
--- a/gdb/symtab.c
b2f73e
+++ b/gdb/symtab.c
b2f73e
@@ -3166,6 +3166,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
b2f73e
 	     msymbol->linkage_name ()); */
b2f73e
 	  ;
b2f73e
 	/* fall through */
b2f73e
+	/* `msymbol' trampoline may be located before its .text symbol
b2f73e
+	   but this text symbol may be the address we were looking for.
b2f73e
+	   Avoid `find_pc_sect_line'<->`find_pc_line' infinite loop.
b2f73e
+	   Red Hat Bug 218379.  */
b2f73e
+	else if (BMSYMBOL_VALUE_ADDRESS (mfunsym) == pc)
b2f73e
+	  warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", msymbol.minsym->linkage_name (), paddress (target_gdbarch (), pc));
b2f73e
+	/* fall through */
b2f73e
 	else
b2f73e
 	  return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0);
b2f73e
       }