From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16996 invoked by alias); 28 Jan 2014 22:03:10 -0000 Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org Received: (qmail 16978 invoked by uid 89); 28 Jan 2014 22:03:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: topped-with-meat.com Received: from toast.topped-with-meat.com (HELO topped-with-meat.com) (204.197.218.159) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 28 Jan 2014 22:03:09 +0000 Received: by topped-with-meat.com (Postfix, from userid 5281) id 9F62D74438; Tue, 28 Jan 2014 14:03:07 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: "Joseph S. Myers" Cc: Will Newton , , Subject: Re: [PATCH] ARM: Add SystemTap probes to longjmp and setjmp. In-Reply-To: Joseph S. Myers's message of Tuesday, 28 January 2014 21:35:02 +0000 References: <1390815426-10792-1-git-send-email-will.newton@linaro.org> Message-Id: <20140128220307.9F62D74438@topped-with-meat.com> Date: Tue, 28 Jan 2014 22:03:00 -0000 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=Rt9WckWK c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=6f7o3FWKcKMA:10 a=Z6MIti7PxpgA:10 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=oub3ERPjUfQA:10 a=jc38NH_oUzd4fpPJ2jAA:9 a=CjuIK1q_8ugA:10 X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00067.txt.bz2 > On Mon, 27 Jan 2014, Will Newton wrote: > > > @@ -50,6 +48,11 @@ ENTRY (__longjmp) > > ldr sp, [ip], #4 > > ldr lr, [ip], #4 > > #endif > > + /* longjmp probe expects longjmp first argument (4@r0), second > > + argument (-4@r1), and target address (4@r14), respectively. */ > > + LIBC_PROBE (longjmp, 3, 4@r0, -4@r1, 4@r14) > > The discussion on libc-alpha said this probe should be before unwinding; > shouldn't that mean before sp and lr are restored, so that at probe time > it's still possible to unwind through the caller of longjmp? Yes, the longjmp probe is conceptually "at entry to longjmp". So it needs to be just far enough in that you have demangled the pointers to make them available as the probe's arguments. The longmp_target probe is the one that should be as late as possible, so all the registers except the PC itself (or as close as the particular machine's implementation makes possible) reflect the state being restored.