Blame SOURCES/gdb-6.3-ppc64displaysymbol-20041124.patch

2c2fa1
2004-11-24  Andrew Cagney  <cagney@gnu.org>
2c2fa1
2c2fa1
	* printcmd.c (build_address_symbolic): Find a section for the
2c2fa1
	address.
2c2fa1
2c2fa1
Index: gdb-6.8.50.20081128/gdb/printcmd.c
2c2fa1
===================================================================
2c2fa1
--- gdb-6.8.50.20081128.orig/gdb/printcmd.c	2008-12-04 01:36:05.000000000 +0100
2c2fa1
+++ gdb-6.8.50.20081128/gdb/printcmd.c	2008-12-04 01:37:18.000000000 +0100
2c2fa1
@@ -616,6 +616,14 @@ build_address_symbolic (CORE_ADDR addr, 
2c2fa1
 	  addr = overlay_mapped_address (addr, section);
2c2fa1
 	}
2c2fa1
     }
2c2fa1
+  /* To ensure that the symbol returned belongs to the correct setion
2c2fa1
+     (and that the last [random] symbol from the previous section
2c2fa1
+     isn't returned) try to find the section containing PC.  First try
2c2fa1
+     the overlay code (which by default returns NULL); and second try
2c2fa1
+     the normal section code (which almost always succeeds).  */
2c2fa1
+  section = find_pc_overlay (addr);
2c2fa1
+  if (section == NULL)
2c2fa1
+    section = find_pc_section (addr);
2c2fa1
 
2c2fa1
   /* First try to find the address in the symbol table, then
2c2fa1
      in the minsyms.  Take the closest one.  */