From: Aleksandar Ristovski <aristovski@qnx.com>
To: gdb-patches@sources.redhat.com
Subject: [patch] i386-nto-tdep.c - sigcontext
Date: Thu, 11 Jun 2009 18:53:00 -0000 [thread overview]
Message-ID: <h0rjqv$k9u$1@ger.gmane.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 450 bytes --]
Hello,
This is another cleanup patch for nto target (part of the
ongoing effort to get my local changes into mainline).
Thanks,
--
Aleksandar Ristovski
QNX Software Systems
ChangeLog:
* 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.
[-- Attachment #2: i386-nto-tdep.c-sigcontext_addr-20090611.patch --]
[-- Type: text/plain, Size: 1586 bytes --]
Index: gdb/i386-nto-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-nto-tdep.c,v
retrieving revision 1.33
diff -u -p -r1.33 i386-nto-tdep.c
--- gdb/i386-nto-tdep.c 11 Jun 2009 17:12:11 -0000 1.33
+++ gdb/i386-nto-tdep.c 11 Jun 2009 18:45:30 -0000
@@ -290,8 +290,6 @@ i386nto_sigtramp_p (struct frame_info *t
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. */
@@ -299,12 +297,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
@@ -343,8 +343,8 @@ i386nto_init_abi (struct gdbarch_info in
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. */
next reply other threads:[~2009-06-11 18:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 18:53 Aleksandar Ristovski [this message]
2009-06-11 20:33 ` Mark Kettenis
2009-06-11 20:41 ` Aleksandar Ristovski
2009-06-11 20:57 ` Aleksandar Ristovski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='h0rjqv$k9u$1@ger.gmane.org' \
--to=aristovski@qnx.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox