From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32360 invoked by alias); 23 Jul 2004 13:43:51 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32339 invoked from network); 23 Jul 2004 13:43:50 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.77.109) by sourceware.org with SMTP; 23 Jul 2004 13:43:50 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i6NDhnPL002378 for ; Fri, 23 Jul 2004 15:43:49 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i6NDhnAA020954 for ; Fri, 23 Jul 2004 15:43:49 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i6NDhnoK020951; Fri, 23 Jul 2004 15:43:49 +0200 (CEST) Date: Fri, 23 Jul 2004 13:43:00 -0000 Message-Id: <200407231343.i6NDhnoK020951@elgar.kettenis.dyndns.org> From: Mark Kettenis To: gdb-patches@sources.redhat.com Subject: [PATCH] Fix OpenBSD signal trampoline recognition X-SW-Source: 2004-07/txt/msg00324.txt.bz2 Committed, Mark Index: ChangeLog from Mark Kettenis * 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;