From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8409 invoked by alias); 23 Apr 2002 17:54:57 -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 8402 invoked from network); 23 Apr 2002 17:54:56 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 23 Apr 2002 17:54:56 -0000 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id KAA11357; Tue, 23 Apr 2002 10:54:54 -0700 (PDT) Message-ID: <3CC59D20.D9D1A0CA@redhat.com> Date: Tue, 23 Apr 2002 10:54:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Richard.Earnshaw@arm.com CC: Michael Snyder , gdb-patches@sources.redhat.com, cagney@redhat.com, rearnsha@arm.com Subject: Re: [RFA] More tweaks to arm_skip_prologue References: <200204230943.KAA00581@cam-mail2.cambridge.arm.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-04/txt/msg00857.txt.bz2 Richard Earnshaw wrote: > > > > > 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. 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. > > > > > ! /* 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). OK, I'll correct that. > 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.