From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31428 invoked by alias); 24 Apr 2002 09:16:18 -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 31402 invoked from network); 24 Apr 2002 09:16:13 -0000 Received: from unknown (HELO fw-cam.cambridge.arm.com) (193.131.176.3) by sources.redhat.com with SMTP; 24 Apr 2002 09:16:13 -0000 Received: by fw-cam.cambridge.arm.com; id KAA22731; Wed, 24 Apr 2002 10:16:09 +0100 (BST) Received: from unknown(172.16.1.2) by fw-cam.cambridge.arm.com via smap (V5.5) id xma021908; Wed, 24 Apr 02 10:15:28 +0100 Received: from cam-mail2.cambridge.arm.com (localhost [127.0.0.1]) by cam-admin0.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id KAA08901; Wed, 24 Apr 2002 10:15:27 +0100 (BST) Received: from sun18.cambridge.arm.com (sun18.cambridge.arm.com [172.16.2.18]) by cam-mail2.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id KAA25848; Wed, 24 Apr 2002 10:15:26 +0100 (BST) Message-Id: <200204240915.KAA25848@cam-mail2.cambridge.arm.com> To: Michael Snyder cc: Richard.Earnshaw@arm.com, Michael Snyder , gdb-patches@sources.redhat.com, cagney@redhat.com, rearnsha@arm.com Reply-To: Richard.Earnshaw@arm.com Organization: ARM Ltd. X-Telephone: +44 1223 400569 (direct+voicemail), +44 1223 400400 (switchbd) X-Fax: +44 1223 400410 X-Address: ARM Ltd., 110 Fulbourn Road, Cherry Hinton, Cambridge CB1 9NJ. X-Url: http://www.arm.com/ Subject: Re: [RFA] More tweaks to arm_skip_prologue In-reply-to: Your message of "Tue, 23 Apr 2002 10:42:56 PDT." <3CC59D20.D9D1A0CA@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 24 Apr 2002 02:16:00 -0000 From: Richard Earnshaw X-SW-Source: 2002-04/txt/msg00923.txt.bz2 > > If the sequence doesn't start with mov ip, sp then we either have a > > scheduled prologue where the first instruction is messing with > > call-clobbered register, or we have a frameless prologue. I suspect that > > if are in this situation then we should use a different unwind function to > > keep things simpler. > > You know way more about the architecture than I do, but > check arm_scan_prologue -- it already does the same thing. > I'd like to bring them into sync, and then think about > possibly making them smarter. > I was thinking more along the lines of (in pseudo code) arm_skip_prologue (...) { if (first_instruction == "mov ip, lr") skip_atpcs_frame_prologue (...) else skip_prologue_maybe_frameless (...) Maybe we could even make the sub-functions common to the two existing uses. > > What about an "stmfd sp!, {...., lr}" (non-frame) prologue instruction. > > Can you give me a pattern to match for? > I haven't actually seen that instruction in a prologue. Try compiling the following with -O2 -fomit-frame-pointer. void f (int *); void h (int); void g (int a, int b) { f(&a); h(b); } You should get something like: _g: stmfd sp!, {r4, lr} @ Prologue sub sp, sp, #4 @ Prologue str r0, [sp, #0] @ Prologue mov r4, r1 @ [note 1] mov r0, sp bl _f mov r0, r4 bl _h add sp, sp, #4 ldmfd sp!, {r4, pc} [1] We should probably consider this instruction as part of the prologue as well, but it isn't clear we can detect this reliably (ie not get any false positives). It's possible that we could switch on any mov from r0-r3. R.