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

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