418be79
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
418be79
418be79
eb6cb2d
Index: gdb-7.7.90.20140613/gdb/symtab.c
8b1b3fd
===================================================================
eb6cb2d
--- gdb-7.7.90.20140613.orig/gdb/symtab.c	2014-06-13 21:52:06.219338401 +0200
eb6cb2d
+++ gdb-7.7.90.20140613/gdb/symtab.c	2014-06-13 21:55:02.753531885 +0200
eb6cb2d
@@ -2394,6 +2394,13 @@ find_pc_sect_line (CORE_ADDR pc, struct
b0e03f5
 	     SYMBOL_LINKAGE_NAME (msymbol)); */
b0e03f5
 	  ;
418be79
 	/* fall through */
418be79
+	/* `msymbol' trampoline may be located before its .text symbol
418be79
+	   but this text symbol may be the address we were looking for.
418be79
+	   Avoid `find_pc_sect_line'<->`find_pc_line' infinite loop.
418be79
+	   Red Hat Bug 218379.  */
eb6cb2d
+	else if (BMSYMBOL_VALUE_ADDRESS (mfunsym) == pc)
eb6cb2d
+	  warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", MSYMBOL_LINKAGE_NAME (msymbol.minsym), paddress (target_gdbarch (), pc));
418be79
+	/* fall through */
418be79
 	else
eb6cb2d
 	  return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0);
418be79
       }