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

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