From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16685 invoked by alias); 23 Apr 2002 23:00:54 -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 16652 invoked from network); 23 Apr 2002 23:00:51 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 23 Apr 2002 23:00:51 -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 QAA07923; Tue, 23 Apr 2002 16:00:43 -0700 (PDT) Message-ID: <3CC5E4C3.5B245D73@redhat.com> Date: Tue, 23 Apr 2002 16:00: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: multipart/mixed; boundary="------------7FF5AECA9B1B33850A3605E5" X-SW-Source: 2002-04/txt/msg00884.txt.bz2 This is a multi-part message in MIME format. --------------7FF5AECA9B1B33850A3605E5 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-length: 234 Richard Earnshaw wrote: [...] > This should only ever be "str lr, [sp, #-4]!" (note the writeback). Richard, how's this revised patch? Do you think that, if we detect the str lr, [sp, -4]! we should just return pc + 4 immediately? --------------7FF5AECA9B1B33850A3605E5 Content-Type: text/plain; charset=us-ascii; name="frameless.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="frameless.patch" Content-length: 2176 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, #-4]". Index: arm-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/arm-tdep.c,v retrieving revision 1.51 diff -p -r1.51 arm-tdep.c *** arm-tdep.c 22 Apr 2002 23:22:04 -0000 1.51 --- arm-tdep.c 23 Apr 2002 00:00:30 -0000 *************** arm_skip_prologue (CORE_ADDR pc) *** 446,467 **** by disassembling the instructions. */ skip_pc = pc; inst = read_memory_integer (skip_pc, 4); ! if (inst != 0xe1a0c00d) /* mov ip, sp */ ! return pc; ! skip_pc += 4; ! inst = read_memory_integer (skip_pc, 4); ! 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} */ ! return pc; ! skip_pc += 4; ! inst = read_memory_integer (skip_pc, 4); /* Any insns after this point may float into the code, if it makes for better instruction scheduling, so we skip them only if we --- 446,475 ---- 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); ! } ! /* Some prologues begin with "str lr, [sp, #-4]!". */ ! if (inst == 0xe52de004) /* str lr, [sp, #-nn]! */ { skip_pc += 4; inst = read_memory_integer (skip_pc, 4); } ! 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); ! } /* Any insns after this point may float into the code, if it makes for better instruction scheduling, so we skip them only if we --------------7FF5AECA9B1B33850A3605E5--