From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4471 invoked by alias); 3 Mar 2004 21:20:53 -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 4458 invoked from network); 3 Mar 2004 21:20:52 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 3 Mar 2004 21:20:52 -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 i23LKD0u001319; Wed, 3 Mar 2004 22:20:13 +0100 (CET) (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 i23LKDEU001480; Wed, 3 Mar 2004 22:20:13 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i23LKC6P001477; Wed, 3 Mar 2004 22:20:12 +0100 (CET) Date: Wed, 03 Mar 2004 21:20:00 -0000 Message-Id: <200403032120.i23LKC6P001477@elgar.kettenis.dyndns.org> From: Mark Kettenis To: thorpej@wasabisystems.com CC: cagney@gnu.org, drow@false.org, gdb-patches@sources.redhat.com In-reply-to: (message from Jason Thorpe on Wed, 3 Mar 2004 12:46:40 -0800) Subject: Re: [rfa:NetBSD/ppc] Implement signal trampoline unwinder References: <40428C58.1020506@gnu.org> <20040301012656.GA16265@nevyn.them.org> <404292D7.9040100@gnu.org> <20040301024711.GA27915@nevyn.them.org> <200403010933.i219X4v3002550@elgar.kettenis.dyndns.org> <6FDEB6FE-6CA1-11D8-BE41-000A957650EC@wasabisystems.com> <40464374.7080106@gnu.org> X-SW-Source: 2004-03.o/txt/msg00062.txt From: Jason Thorpe Date: Wed, 3 Mar 2004 12:46:40 -0800 On Mar 3, 2004, at 12:43 PM, Andrew Cagney wrote: > Jason, am I correct to assume that the second SC here: > > (gdb) x/10i $lr > 0x7fffefdc: addi r3,r1,24 > 0x7fffefe0: li r0,295 > 0x7fffefe4: sc This is __sigreturn14 > 0x7fffefe8: li r0,1 > 0x7fffefec: sc and this is exit (process croaks if sigreturn failed). Andrew, This is the usual pattern. A sigreturn system call followed by an exit system call. There may be several versions of the sigreturn system call in an OS (besides __sigreturn14, NetBSD also has an older sigreturn system call). Before the system call there may be some code that does the call to the signal handler. If all instructions have the same length (as is the case on SPARC, and appears to be the case on PPC) it may be enough to check for the sigreturn system call (i.e. li r0,295; sc). Mark From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4471 invoked by alias); 3 Mar 2004 21:20:53 -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 4458 invoked from network); 3 Mar 2004 21:20:52 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 3 Mar 2004 21:20:52 -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 i23LKD0u001319; Wed, 3 Mar 2004 22:20:13 +0100 (CET) (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 i23LKDEU001480; Wed, 3 Mar 2004 22:20:13 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i23LKC6P001477; Wed, 3 Mar 2004 22:20:12 +0100 (CET) Date: Fri, 19 Mar 2004 00:09:00 -0000 Message-ID: <200403032120.i23LKC6P001477@elgar.kettenis.dyndns.org> From: Mark Kettenis To: thorpej@wasabisystems.com CC: cagney@gnu.org, drow@false.org, gdb-patches@sources.redhat.com In-reply-to: (message from Jason Thorpe on Wed, 3 Mar 2004 12:46:40 -0800) Subject: Re: [rfa:NetBSD/ppc] Implement signal trampoline unwinder References: <40428C58.1020506@gnu.org> <20040301012656.GA16265@nevyn.them.org> <404292D7.9040100@gnu.org> <20040301024711.GA27915@nevyn.them.org> <200403010933.i219X4v3002550@elgar.kettenis.dyndns.org> <6FDEB6FE-6CA1-11D8-BE41-000A957650EC@wasabisystems.com> <40464374.7080106@gnu.org> X-SW-Source: 2004-03/txt/msg00062.txt.bz2 Message-ID: <20040319000900.40FzIOlkhdFjbKAX2khQy_q458qHN9SdJgJK9aN0020@z> From: Jason Thorpe Date: Wed, 3 Mar 2004 12:46:40 -0800 On Mar 3, 2004, at 12:43 PM, Andrew Cagney wrote: > Jason, am I correct to assume that the second SC here: > > (gdb) x/10i $lr > 0x7fffefdc: addi r3,r1,24 > 0x7fffefe0: li r0,295 > 0x7fffefe4: sc This is __sigreturn14 > 0x7fffefe8: li r0,1 > 0x7fffefec: sc and this is exit (process croaks if sigreturn failed). Andrew, This is the usual pattern. A sigreturn system call followed by an exit system call. There may be several versions of the sigreturn system call in an OS (besides __sigreturn14, NetBSD also has an older sigreturn system call). Before the system call there may be some code that does the call to the signal handler. If all instructions have the same length (as is the case on SPARC, and appears to be the case on PPC) it may be enough to check for the sigreturn system call (i.e. li r0,295; sc). Mark