aboutsummaryrefslogtreecommitdiff
path: root/gdb/ia64-linux-tdep.c
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2003-10-15 22:55:32 +0000
committerJeff Johnston <jjohnstn@redhat.com>2003-10-15 22:55:32 +0000
commit51931cbbf6da866b4b5fed742cbf1e888b2ec44e (patch)
treecaef6a0ec94317a0e2300acf25d6da70e5bfaf78 /gdb/ia64-linux-tdep.c
parentc1da8dedaeee84f2f1fd7a8de26a5789853c2bae (diff)
downloadgdb-51931cbbf6da866b4b5fed742cbf1e888b2ec44e.zip
gdb-51931cbbf6da866b4b5fed742cbf1e888b2ec44e.tar.gz
gdb-51931cbbf6da866b4b5fed742cbf1e888b2ec44e.tar.bz2
2003-10-15 Jeff Johnston <jjohnstn@redhat.com>
* ia64-linux-tdep.c: Include gdbcore.h. (IA64_LINUX_SIGCONTEXT_OFFSET): Magic constant removed. (ia64_linux_sigcontext_register_addr): Find the address of the sigcontext area stored in the sigframe instead of using a magic offset constant.
Diffstat (limited to 'gdb/ia64-linux-tdep.c')
-rw-r--r--gdb/ia64-linux-tdep.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/gdb/ia64-linux-tdep.c b/gdb/ia64-linux-tdep.c
index 97f8814..25902c5 100644
--- a/gdb/ia64-linux-tdep.c
+++ b/gdb/ia64-linux-tdep.c
@@ -21,6 +21,7 @@
#include "defs.h"
#include "arch-utils.h"
+#include "gdbcore.h"
/* The sigtramp code is in a non-readable (executable-only) region
of memory called the ``gate page''. The addresses in question
@@ -47,40 +48,47 @@ ia64_linux_in_sigtramp (CORE_ADDR pc, char *func_name)
CORE_ADDR
ia64_linux_sigcontext_register_address (CORE_ADDR sp, int regno)
{
+ char buf[8];
+ CORE_ADDR sigcontext_addr = 0;
+
+ /* The address of the sigcontext area is found at offset 16 in the sigframe. */
+ read_memory (sp + 16, buf, 8);
+ sigcontext_addr = extract_unsigned_integer (buf, 8);
+
if (IA64_GR0_REGNUM <= regno && regno <= IA64_GR31_REGNUM)
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 200 + 8 * (regno - IA64_GR0_REGNUM);
+ return sigcontext_addr + 200 + 8 * (regno - IA64_GR0_REGNUM);
else if (IA64_BR0_REGNUM <= regno && regno <= IA64_BR7_REGNUM)
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 136 + 8 * (regno - IA64_BR0_REGNUM);
+ return sigcontext_addr + 136 + 8 * (regno - IA64_BR0_REGNUM);
else if (IA64_FR0_REGNUM <= regno && regno <= IA64_FR127_REGNUM)
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 464 + 16 * (regno - IA64_FR0_REGNUM);
+ return sigcontext_addr + 464 + 16 * (regno - IA64_FR0_REGNUM);
else
switch (regno)
{
case IA64_IP_REGNUM :
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 40;
+ return sigcontext_addr + 40;
case IA64_CFM_REGNUM :
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 48;
+ return sigcontext_addr + 48;
case IA64_PSR_REGNUM :
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 56; /* user mask only */
+ return sigcontext_addr + 56; /* user mask only */
/* sc_ar_rsc is provided, from which we could compute bspstore, but
I don't think it's worth it. Anyway, if we want it, it's at offset
64 */
case IA64_BSP_REGNUM :
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 72;
+ return sigcontext_addr + 72;
case IA64_RNAT_REGNUM :
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 80;
+ return sigcontext_addr + 80;
case IA64_CCV_REGNUM :
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 88;
+ return sigcontext_addr + 88;
case IA64_UNAT_REGNUM :
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 96;
+ return sigcontext_addr + 96;
case IA64_FPSR_REGNUM :
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 104;
+ return sigcontext_addr + 104;
case IA64_PFS_REGNUM :
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 112;
+ return sigcontext_addr + 112;
case IA64_LC_REGNUM :
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 120;
+ return sigcontext_addr + 120;
case IA64_PR_REGNUM :
- return sp + IA64_LINUX_SIGCONTEXT_OFFSET + 128;
+ return sigcontext_addr + 128;
default :
return 0;
}