summaryrefslogtreecommitdiff
path: root/gdb/ppc-sysv-tdep.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-09-29 00:49:18 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-09-29 00:49:18 +0000
commit86e74b0e0eb5697e91f8351a54d9e60af0e40991 (patch)
tree2633b074e3d067c53f4843d8e033edc406305975 /gdb/ppc-sysv-tdep.c
parent79a6ba40dacbc2659540af3138ad5ebdecd3a2b4 (diff)
downloadgdb-86e74b0e0eb5697e91f8351a54d9e60af0e40991.tar.gz
* eval.c (evaluate_subexp_standard) [OP_OBJC_MSGCALL]: Support
platforms that use function descriptors. Prefer to use function pointer types instead of function types. * linespec.c (decode_objc): Support function descriptors. Fully initialize SAL result. * objc-lang.c (find_methods): Support function descriptors. Do not require function symbol to point to text section. * ppc-sysv-tdep.c (ppc64_sysv_abi_push_dummy_call): When calling via a function pointer, use the descriptor it points to.
Diffstat (limited to 'gdb/ppc-sysv-tdep.c')
-rw-r--r--gdb/ppc-sysv-tdep.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index 703ca4db40a..031ec52da02 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -1326,10 +1326,14 @@ ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
regcache_cooked_write_signed (regcache, tdep->ppc_lr_regnum, bp_addr);
/* Use the func_addr to find the descriptor, and use that to find
- the TOC. */
+ the TOC. If we're calling via a function pointer, the pointer
+ itself identifies the descriptor. */
{
- CORE_ADDR desc_addr;
- if (convert_code_addr_to_desc_addr (func_addr, &desc_addr))
+ struct type *ftype = check_typedef (value_type (function));
+ CORE_ADDR desc_addr = value_as_address (function);
+
+ if (TYPE_CODE (ftype) == TYPE_CODE_PTR
+ || convert_code_addr_to_desc_addr (func_addr, &desc_addr))
{
/* The TOC is the second double word in the descriptor. */
CORE_ADDR toc =