From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7077 invoked by alias); 25 Sep 2003 14:24:23 -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 7069 invoked from network); 25 Sep 2003 14:24:20 -0000 Received: from unknown (HELO dublin.act-europe.fr) (212.157.227.154) by sources.redhat.com with SMTP; 25 Sep 2003 14:24:20 -0000 Received: from localhost (localhost [127.0.0.1]) by amavis.act-europe.fr (Postfix) with ESMTP id 9063A229FCC for ; Thu, 25 Sep 2003 16:24:18 +0200 (MET DST) Received: from dublin.act-europe.fr ([127.0.0.1]) by localhost (dublin.act-europe.fr [127.0.0.1:10024]) (amavisd-new) with ESMTP id 00816-08 for ; Thu, 25 Sep 2003 16:24:08 +0200 (MET DST) Received: from berne.int.act-europe.fr (berne.act-europe.fr [10.10.0.165]) by dublin.act-europe.fr (Postfix) with ESMTP id 577CF229FF2 for ; Thu, 25 Sep 2003 16:24:01 +0200 (MET DST) Received: by berne.int.act-europe.fr (Postfix, from userid 560) id F073C592B; Thu, 25 Sep 2003 10:24:00 -0400 (EDT) Date: Thu, 25 Sep 2003 14:24:00 -0000 From: Jerome Guitton To: gdb-patches@sources.redhat.com Subject: [commit] ARM : prologue scan Message-ID: <20030925142400.GA15127@act-europe.fr> References: <20030722114709.GB3100@act-europe.fr> <200309051014.h85AEGl21565@pc960.cambridge.arm.com> <20030909102315.GQ26104@act-europe.fr> <20030923190323.GA13529@act-europe.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline In-Reply-To: <20030923190323.GA13529@act-europe.fr> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new X-SW-Source: 2003-09/txt/msg00558.txt.bz2 --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 208 Jerome Guitton (guitton@act-europe.fr): > I still don't have committed this change, for the simple reason that I don't patch merged with the current version of arm-tdep.c (head), and committed. -- Jerome --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="arm_bt.dif" Content-length: 3478 2003-09-25 Jerome Guitton * arm-tdep.c (arm_skip_prologue): Handle "sub ip, sp #n" and "add ip, sp #n" in the prologue. (arm_scan_prologue): Ditto. Index: arm-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/arm-tdep.c,v retrieving revision 1.150 diff -c -r1.150 arm-tdep.c *** arm-tdep.c 14 Sep 2003 16:32:12 -0000 1.150 --- arm-tdep.c 25 Sep 2003 14:15:51 -0000 *************** *** 455,460 **** --- 455,466 ---- if (inst == 0xe1a0c00d) /* mov ip, sp */ continue; + if ((inst & 0xfffff000) == 0xe28dc000) /* add ip, sp #n */ + continue; + + if ((inst & 0xfffff000) == 0xe24dc000) /* sub ip, sp #n */ + continue; + /* Some prologues begin with "str lr, [sp, #-4]!". */ if (inst == 0xe52de004) /* str lr, [sp, #-4]! */ continue; *************** *** 707,713 **** static void arm_scan_prologue (struct frame_info *next_frame, struct arm_prologue_cache *cache) { ! int regno, sp_offset, fp_offset; CORE_ADDR prologue_start, prologue_end, current_pc; CORE_ADDR prev_pc = frame_pc_unwind (next_frame); --- 713,719 ---- static void arm_scan_prologue (struct frame_info *next_frame, struct arm_prologue_cache *cache) { ! int regno, sp_offset, fp_offset, ip_offset; CORE_ADDR prologue_start, prologue_end, current_pc; CORE_ADDR prev_pc = frame_pc_unwind (next_frame); *************** *** 808,814 **** in which case it is often (but not always) replaced by "str lr, [sp, #-4]!". - Michael Snyder, 2002-04-23] */ ! sp_offset = fp_offset = 0; for (current_pc = prologue_start; current_pc < prologue_end; --- 814,820 ---- in which case it is often (but not always) replaced by "str lr, [sp, #-4]!". - Michael Snyder, 2002-04-23] */ ! sp_offset = fp_offset = ip_offset = 0; for (current_pc = prologue_start; current_pc < prologue_end; *************** *** 818,823 **** --- 824,846 ---- if (insn == 0xe1a0c00d) /* mov ip, sp */ { + ip_offset = 0; + continue; + } + else if ((insn & 0xfffff000) == 0xe28dc000) /* add ip, sp #n */ + { + unsigned imm = insn & 0xff; /* immediate value */ + unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */ + imm = (imm >> rot) | (imm << (32 - rot)); + ip_offset = imm; + continue; + } + else if ((insn & 0xfffff000) == 0xe24dc000) /* sub ip, sp #n */ + { + unsigned imm = insn & 0xff; /* immediate value */ + unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */ + imm = (imm >> rot) | (imm << (32 - rot)); + ip_offset = -imm; continue; } else if (insn == 0xe52de004) /* str lr, [sp, #-4]! */ *************** *** 859,865 **** unsigned imm = insn & 0xff; /* immediate value */ unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */ imm = (imm >> rot) | (imm << (32 - rot)); ! fp_offset = -imm; cache->framereg = ARM_FP_REGNUM; } else if ((insn & 0xfffff000) == 0xe24dd000) /* sub sp, sp #n */ --- 882,888 ---- unsigned imm = insn & 0xff; /* immediate value */ unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */ imm = (imm >> rot) | (imm << (32 - rot)); ! fp_offset = -imm + ip_offset; cache->framereg = ARM_FP_REGNUM; } else if ((insn & 0xfffff000) == 0xe24dd000) /* sub sp, sp #n */ --x+6KMIRAuhnl3hBn--