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

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