aboutsummaryrefslogtreecommitdiff
path: root/gdb/ppc-linux-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-10-03 20:50:56 +0000
committerAndrew Cagney <cagney@redhat.com>2003-10-03 20:50:56 +0000
commit9b540880d68f565c0a7a4e2d4aa9205e70e12a0a (patch)
tree0ab353aab4932da9695df50cf0e7e25d5b9b097d /gdb/ppc-linux-tdep.c
parent8748518b95a4543d98477eec5a85fa9a037de209 (diff)
downloadfsf-binutils-gdb-9b540880d68f565c0a7a4e2d4aa9205e70e12a0a.zip
fsf-binutils-gdb-9b540880d68f565c0a7a4e2d4aa9205e70e12a0a.tar.gz
fsf-binutils-gdb-9b540880d68f565c0a7a4e2d4aa9205e70e12a0a.tar.bz2
2003-10-03 Andrew Cagney <cagney@redhat.com>
* ppc-linux-tdep.c (ppc64_linux_convert_from_func_ptr_addr): Only convert a descriptor to a function when it's in the ".opd" section.
Diffstat (limited to 'gdb/ppc-linux-tdep.c')
-rw-r--r--gdb/ppc-linux-tdep.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 27744f3..4a6bf6d 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -925,8 +925,10 @@ ppc64_skip_trampoline_code (CORE_ADDR pc)
find_function_addr uses this function to get the function address
from a function pointer. */
-/* Return real function address if ADDR (a function pointer) is in the data
- space and is therefore a special function pointer. */
+/* If ADDR points at what is clearly a function descriptor, transform
+ it into the address of the corresponding function. Be
+ conservative, otherwize GDB will do the transformation on any
+ random addresses such as occures when there is no symbol table. */
static CORE_ADDR
ppc64_linux_convert_from_func_ptr_addr (CORE_ADDR addr)
@@ -934,12 +936,12 @@ ppc64_linux_convert_from_func_ptr_addr (CORE_ADDR addr)
struct obj_section *s;
s = find_pc_section (addr);
- if (s && s->the_bfd_section->flags & SEC_CODE)
- return addr;
- /* ADDR is in the data space, so it's a pointer to a descriptor, not
- the entry point. */
- return ppc64_desc_entry_point (addr);
+ /* Check if ADDR points to a function descriptor. */
+ if (s && strcmp (s->the_bfd_section->name, ".opd") == 0)
+ return read_memory_unsigned_integer (addr, 8);
+
+ return addr;
}