aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparc64obsd-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-07-23 13:43:36 +0000
committerMark Kettenis <kettenis@gnu.org>2004-07-23 13:43:36 +0000
commit24f033e800a318cbfa00f79a06e037c98fe5883f (patch)
tree70f69df685670ab51af26831a7357d9205757aad /gdb/sparc64obsd-tdep.c
parent90f3cecd6ae6ffb2adb87e4d46a4317e0a7bcf10 (diff)
downloadgdb-24f033e800a318cbfa00f79a06e037c98fe5883f.zip
gdb-24f033e800a318cbfa00f79a06e037c98fe5883f.tar.gz
gdb-24f033e800a318cbfa00f79a06e037c98fe5883f.tar.bz2
* sparc64obsd-tdep.c (sparc64obsd_pc_in_sigtramp): Adjust for
changed signal trampoline in OpenBSD 3.5-current.
Diffstat (limited to 'gdb/sparc64obsd-tdep.c')
-rw-r--r--gdb/sparc64obsd-tdep.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gdb/sparc64obsd-tdep.c b/gdb/sparc64obsd-tdep.c
index b74679c..8ad88b5 100644
--- a/gdb/sparc64obsd-tdep.c
+++ b/gdb/sparc64obsd-tdep.c
@@ -83,17 +83,30 @@ sparc64obsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
{
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;