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

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