From 0285512f2902753c8185679567b0d0dc95c3c129 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 28 Aug 2003 02:53:08 +0000 Subject: [PATCH] 2003-08-27 Andrew Cagney * ppc-linux-tdep.c (ppc64_call_dummy_address): Delete function. (ppc_linux_init_abi): For PPC64, do not set call_dummy_address. * infcall.c (call_function_by_hand): Convert the entry point address into a code address. --- gdb/ChangeLog | 7 +++++++ gdb/infcall.c | 8 ++++++++ gdb/ppc-linux-tdep.c | 14 -------------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 43fcf73e1d..f1be370fda 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2003-08-27 Andrew Cagney + + * ppc-linux-tdep.c (ppc64_call_dummy_address): Delete function. + (ppc_linux_init_abi): For PPC64, do not set call_dummy_address. + * infcall.c (call_function_by_hand): Convert the entry point + address into a code address. + 2003-08-27 Andrew Cagney * dsrec.c: Include "gdb_string.h". diff --git a/gdb/infcall.c b/gdb/infcall.c index 98e7da5fc3..6baa88a337 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -558,6 +558,9 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) } real_pc = funaddr; dummy_addr = CALL_DUMMY_ADDRESS (); + /* Make certain that the address points at real code, and not a + function descriptor. */ + dummy_addr = CONVERT_FROM_FUNC_PTR_ADDR (dummy_addr); /* A call dummy always consists of just a single breakpoint, so it's address is the same as the address of the dummy. */ bp_addr = dummy_addr; @@ -576,6 +579,11 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) dummy_addr = SYMBOL_VALUE_ADDRESS (sym); else dummy_addr = entry_point_address (); + /* Make certain that the address points at real code, and not + a function descriptor. */ + dummy_addr = CONVERT_FROM_FUNC_PTR_ADDR (dummy_addr); + /* A call dummy always consists of just a single breakpoint, + so it's address is the same as the address of the dummy. */ bp_addr = dummy_addr; break; } diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index 05b051045b..5c8f695d0f 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -929,18 +929,6 @@ ppc64_linux_convert_from_func_ptr_addr (CORE_ADDR addr) } -/* On 64-bit PowerPC GNU/Linux, the ELF header's e_entry field is the - address of a function descriptor for the entry point function, not - the actual entry point itself. So to find the actual address at - which execution should begin, we need to fetch the function's entry - point from that descriptor. */ -static CORE_ADDR -ppc64_call_dummy_address (void) -{ - return ppc64_desc_entry_point (entry_point_address ()); -} - - enum { ELF_NGREG = 48, ELF_NFPREG = 33, @@ -1067,8 +1055,6 @@ ppc_linux_init_abi (struct gdbarch_info info, set_gdbarch_convert_from_func_ptr_addr (gdbarch, ppc64_linux_convert_from_func_ptr_addr); - set_gdbarch_call_dummy_address (gdbarch, ppc64_call_dummy_address); - set_gdbarch_in_solib_call_trampoline (gdbarch, ppc64_in_solib_call_trampoline); set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code);