From: Mark Kettenis <kettenis@chello.nl>
To: gdb-patches@sources.redhat.com
Subject: [PATCH] Fix OpenBSD signal trampoline recognition
Date: Fri, 23 Jul 2004 13:43:00 -0000 [thread overview]
Message-ID: <200407231343.i6NDhnoK020951@elgar.kettenis.dyndns.org> (raw)
Committed,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* sparc64obsd-tdep.c (sparc64obsd_pc_in_sigtramp): Adjust for
changed signal trampoline in OpenBSD 3.5-current.
Index: sparc64obsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64obsd-tdep.c,v
retrieving revision 1.6
diff -u -p -r1.6 sparc64obsd-tdep.c
--- sparc64obsd-tdep.c 22 May 2004 15:16:22 -0000 1.6
+++ sparc64obsd-tdep.c 23 Jul 2004 13:42:26 -0000
@@ -83,17 +83,30 @@ sparc64obsd_pc_in_sigtramp (CORE_ADDR pc
{
CORE_ADDR start_pc = (pc & ~(sparc64obsd_page_size - 1));
unsigned long insn;
+ int offset = 0;
if (name)
return 0;
+ retry:
/* Check for "restore %g0, SYS_sigreturn, %g1". */
- insn = sparc_fetch_instruction (start_pc + 0xe8);
+ insn = sparc_fetch_instruction (start_pc + offset + 0xec);
if (insn != 0x83e82067)
- return 0;
+ {
+ if (offset == 0)
+ {
+ /* In OpenBSD 3.5 and earlier releases, the code
+ implementing the sigreturn system call was at a different
+ offset within the signal trampoline. Try again. */
+ offset = -4;
+ goto retry;
+ }
+
+ return 0;
+ }
/* Check for "t ST_SYSCALL". */
- insn = sparc_fetch_instruction (start_pc + 0xf0);
+ insn = sparc_fetch_instruction (start_pc + offset + 0xf4);
if (insn != 0x91d02000)
return 0;
next reply other threads:[~2004-07-23 13:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-23 13:43 Mark Kettenis [this message]
2004-07-23 16:02 ` Andrew Cagney
2004-07-30 22:45 ` Mark Kettenis
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=200407231343.i6NDhnoK020951@elgar.kettenis.dyndns.org \
--to=kettenis@chello.nl \
--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