aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1994-04-06 00:56:36 +0000
committerJeff Law <law@redhat.com>1994-04-06 00:56:36 +0000
commit4f9159141072fd265ad28b800df492cd7977d506 (patch)
treedf84627ba9119ac6ec728c5995335f9ffcbfee98
parent117dbbc60929a7b08250e1306c8988a34991151b (diff)
downloadgdb-4f9159141072fd265ad28b800df492cd7977d506.zip
gdb-4f9159141072fd265ad28b800df492cd7977d506.tar.gz
gdb-4f9159141072fd265ad28b800df492cd7977d506.tar.bz2
* 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.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/config/pa/tm-hppa.h6
-rw-r--r--gdb/hppa-tdep.c14
3 files changed, 22 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 310a1d2..9e4981b 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 54481e2..ad3c3a6 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 7729fdf..fa44b12 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