aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-nto-tdep.c
diff options
context:
space:
mode:
authorAleksandar Ristovski <aristovski@qnx.com>2009-06-11 20:55:19 +0000
committerAleksandar Ristovski <aristovski@qnx.com>2009-06-11 20:55:19 +0000
commit19a934d888c8da9d273367a6981968b7fc299b55 (patch)
tree9ba5401b5081e6cbfe85be67f2c4d2f2637b3824 /gdb/i386-nto-tdep.c
parent80b1849c68dcde61c3e2bf5e6a0cdb61336baea4 (diff)
downloadgdb-19a934d888c8da9d273367a6981968b7fc299b55.zip
gdb-19a934d888c8da9d273367a6981968b7fc299b55.tar.gz
gdb-19a934d888c8da9d273367a6981968b7fc299b55.tar.bz2
* i386-nto-tdep.c (I386_NTO_SIGCONTEXT_OFFSET): Remove define.
(i386nto_sigcontext_addr): Change the way context address is calculated. (i386nto_init_abi): Remove usage of deprecated sc_reg_offset and sc_sp_offset and set sc_reg_offset and sc_num_regs.
Diffstat (limited to 'gdb/i386-nto-tdep.c')
-rw-r--r--gdb/i386-nto-tdep.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/i386-nto-tdep.c b/gdb/i386-nto-tdep.c
index cbe12e3..0528931 100644
--- a/gdb/i386-nto-tdep.c
+++ b/gdb/i386-nto-tdep.c
@@ -287,8 +287,6 @@ i386nto_sigtramp_p (struct frame_info *this_frame)
return name && strcmp ("__signalstub", name) == 0;
}
-#define I386_NTO_SIGCONTEXT_OFFSET 136
-
/* Assuming THIS_FRAME is a QNX Neutrino sigtramp routine, return the
address of the associated sigcontext structure. */
@@ -296,12 +294,14 @@ static CORE_ADDR
i386nto_sigcontext_addr (struct frame_info *this_frame)
{
char buf[4];
- CORE_ADDR sp;
+ CORE_ADDR ptrctx;
- get_frame_register (this_frame, I386_ESP_REGNUM, buf);
- sp = extract_unsigned_integer (buf, 4);
+ /* We store __ucontext_t addr in EDI register. */
+ get_frame_register (this_frame, I386_EDI_REGNUM, buf);
+ ptrctx = extract_unsigned_integer (buf, 4);
+ ptrctx += 24 /* Context pointer is at this offset. */;
- return sp + I386_NTO_SIGCONTEXT_OFFSET;
+ return ptrctx;
}
static void
@@ -340,8 +340,8 @@ i386nto_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->sigtramp_p = i386nto_sigtramp_p;
tdep->sigcontext_addr = i386nto_sigcontext_addr;
- tdep->sc_pc_offset = 56;
- tdep->sc_sp_offset = 68;
+ tdep->sc_reg_offset = i386nto_gregset_reg_offset;
+ tdep->sc_num_regs = ARRAY_SIZE (i386nto_gregset_reg_offset);
/* Setjmp()'s return PC saved in EDX (5). */
tdep->jb_pc_offset = 20; /* 5x32 bit ints in. */