From 4f9159141072fd265ad28b800df492cd7977d506 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 6 Apr 1994 00:56:36 +0000 Subject: [PATCH] * hppa-tdep.c (hppa_fix_call_dummy): If FUN is a procedure label, then gets its real address into FUN and its GOT/DP value into %r19. * tm-hppa.h (CALL_DUMMY): Use %r20, not %r19 as a temporary. --- gdb/ChangeLog | 5 +++++ gdb/config/pa/tm-hppa.h | 6 +++--- gdb/hppa-tdep.c | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 310a1d2ee59..9e4981b9247 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ Tue Apr 5 15:29:25 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + * hppa-tdep.c (hppa_fix_call_dummy): If FUN is a procedure label, + then gets its real address into FUN and its GOT/DP value into %r19. + + * tm-hppa.h (CALL_DUMMY): Use %r20, not %r19 as a temporary. + * hppa-tdep.c (frameless_function_invocation): If no unwind descriptor was found, then assume this was not a frameless function invocation. diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 54481e2b191..ad3c3a61abc 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -344,8 +344,8 @@ call_dummy ldsid (0,r22), r4 ldil 0, r1 ; _sr4export will be placed here. ldo 0(r1), r1 - ldsid (0,r1), r19 - combt,=,n r3, r19, text_space ; If target is in data space, do a + ldsid (0,r1), r20 + combt,=,n r3, r20, text_space ; If target is in data space, do a ble 0(sr5, r22) ; "normal" procedure call copy r31, r2 break 4, 8 @@ -388,7 +388,7 @@ text_space ; Otherwise, go through _sr4export, #define CALL_DUMMY {0x4BDA3FB9, 0x4BD93FB1, 0x4BD83FA9, 0x4BD73FA1,\ 0x37C13FB9, 0x24201004, 0x2C391005, 0x24311006,\ 0x2C291007, 0x22C00000, 0x36D60000, 0x02C010A4,\ - 0x20200000, 0x34210000, 0x002010b3, 0x82642022,\ + 0x20200000, 0x34210000, 0x002010b4, 0x82832022,\ 0xe6c06000, 0x081f0242, 0x00010004, 0x00151820,\ 0xe6c00002, 0xe4202000, 0x6bdf3fd1, 0x00010004,\ 0x00151820, 0xe6c00002, 0x08000240, 0x08000240} diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 7729fdfd420..fa44b1250ca 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -1074,6 +1074,20 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p) dyncall_addr = SYMBOL_VALUE_ADDRESS (msymbol); + /* FUN could be a procedure label, in which case we have to get + its real address and the value of its GOT/DP. */ + if (fun & 0x2) + { + /* Get the GOT/DP value for the target function. It's + at *(fun+4). Note the call dummy is *NOT* allowed to + trash %r19 before calling the target function. */ + write_register (19, read_memory_integer ((fun & ~0x3) + 4, 4)); + + /* Now get the real address for the function we are calling, it's + at *fun. */ + fun = (CORE_ADDR) read_memory_integer (fun & ~0x3, 4); + } + /* If we are calling an import stub (eg calling into a dynamic library) then have sr4export call the magic __d_plt_call routine which is linked in from end.o. (You can't use _sr4export to call the import stub as -- 2.30.2