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

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