From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27826 invoked by alias); 23 Apr 2002 09:44:06 -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 27777 invoked from network); 23 Apr 2002 09:43:53 -0000 Received: from unknown (HELO fw-cam.cambridge.arm.com) (193.131.176.3) by sources.redhat.com with SMTP; 23 Apr 2002 09:43:53 -0000 Received: by fw-cam.cambridge.arm.com; id KAA25359; Tue, 23 Apr 2002 10:43:50 +0100 (BST) Received: from unknown(172.16.1.2) by fw-cam.cambridge.arm.com via smap (V5.5) id xma025093; Tue, 23 Apr 02 10:43:27 +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 KAA08154; Tue, 23 Apr 2002 10:43: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 KAA00581; Tue, 23 Apr 2002 10:43:26 +0100 (BST) Message-Id: <200204230943.KAA00581@cam-mail2.cambridge.arm.com> To: Michael Snyder cc: 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 "Mon, 22 Apr 2002 16:53:10 PDT." <200204222353.g3MNrAD11515@reddwarf.sfbay.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 23 Apr 2002 02:44:00 -0000 From: Richard Earnshaw X-SW-Source: 2002-04/txt/msg00834.txt.bz2 > > I know that some of these tweaks to arm_skip_prologue will also > suggest similar tweaks to arm_scan_prologue. I'll do those next. > Wouldn't it be nice if the two shared code? ;-) > > 2002-04-22 Michael Snyder > > * arm-tdep.c (arm_skip_prologue): Better handling for frameless > functions. Treat "mov ip, sp" as optional. Recognize > "str lr, [sp, #-nn]". > In principal OK, but see embedded notes. > by disassembling the instructions. */ > skip_pc = pc; > inst = read_memory_integer (skip_pc, 4); > ! if (inst == 0xe1a0c00d) /* mov ip, sp */ > ! { > ! skip_pc += 4; > ! inst = read_memory_integer (skip_pc, 4); > ! } 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. > > ! /* Some prologues begin with "str lr, [sp, #-nn]". */ > ! if ((inst & 0xffffff00) == 0xe52de000) /* str lr, [sp, #-nn] */ > { > skip_pc += 4; > inst = read_memory_integer (skip_pc, 4); > } This should only ever be "str lr, [sp, #-4]!" (note the writeback). What about an "stmfd sp!, {...., lr}" (non-frame) prologue instruction. > > ! if ((inst & 0xfffffff0) == 0xe92d0000) /* stmfd sp!,{a1,a2,a3,a4} */ > ! { > ! skip_pc += 4; > ! inst = read_memory_integer (skip_pc, 4); > ! } > > ! if ((inst & 0xfffff800) == 0xe92dd800) /* stmfd sp!,{fp,ip,lr,pc} */ > ! { > ! skip_pc += 4; > ! inst = read_memory_integer (skip_pc, 4); > ! } > R.