From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27386 invoked by alias); 15 Mar 2008 00:04:03 -0000 Received: (qmail 27364 invoked by uid 22791); 15 Mar 2008 00:04:00 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 15 Mar 2008 00:03:28 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m2F03Q3D019872 for ; Fri, 14 Mar 2008 20:03:26 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m2F03QXd032532 for ; Fri, 14 Mar 2008 20:03:26 -0400 Received: from ironwood.lan (vpn-14-170.rdu.redhat.com [10.11.14.170]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m2F03PUC005037 for ; Fri, 14 Mar 2008 20:03:25 -0400 Date: Sat, 15 Mar 2008 00:04:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Subject: Re: [RFC] mips-tdep.c: Ignore use of sw after sd in prologue scanner Message-ID: <20080314170325.090af32c@ironwood.lan> In-Reply-To: <20080306224040.GA31830@caradoc.them.org> References: <20080306151249.122b91d3@ironwood.lan> <20080306224040.GA31830@caradoc.them.org> X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.5; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-03/txt/msg00208.txt.bz2 On Thu, 6 Mar 2008 17:40:40 -0500 Daniel Jacobowitz wrote: > Seems reasonable enough. Making it ABI-regsize-dependent would make > sense too. Thanks for looking it over. I decided that I liked the "ABI-regsize-dependent" approach better than my original patch. Here is what I've committed: * mips-tdep.c (mips32_scan_prologue): Use the ABI register size to decide whether to match instruction patterns using "sw" and "sd". Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.470 diff -u -p -r1.470 mips-tdep.c --- mips-tdep.c 13 Mar 2008 12:22:13 -0000 1.470 +++ mips-tdep.c 14 Mar 2008 23:55:32 -0000 @@ -1931,6 +1931,7 @@ mips32_scan_prologue (CORE_ADDR start_pc int seen_sp_adjust = 0; int load_immediate_bytes = 0; struct gdbarch *gdbarch = get_frame_arch (next_frame); + int regsize_is_64_bits = (mips_abi_regsize (gdbarch) == 8); /* Can be called when there's no process, and hence when there's no NEXT_FRAME. */ @@ -1973,11 +1974,13 @@ restart: break; seen_sp_adjust = 1; } - else if ((high_word & 0xFFE0) == 0xafa0) /* sw reg,offset($sp) */ + else if (((high_word & 0xFFE0) == 0xafa0) /* sw reg,offset($sp) */ + && !regsize_is_64_bits) { set_reg_offset (this_cache, reg, sp + low_word); } - else if ((high_word & 0xFFE0) == 0xffa0) /* sd reg,offset($sp) */ + else if (((high_word & 0xFFE0) == 0xffa0) /* sd reg,offset($sp) */ + && regsize_is_64_bits) { /* Irix 6.2 N32 ABI uses sd instructions for saving $gp and $ra. */ set_reg_offset (this_cache, reg, sp + low_word); @@ -2041,7 +2044,8 @@ restart: } } } - else if ((high_word & 0xFFE0) == 0xafc0) /* sw reg,offset($30) */ + else if ((high_word & 0xFFE0) == 0xafc0 /* sw reg,offset($30) */ + && !regsize_is_64_bits) { set_reg_offset (this_cache, reg, frame_addr + low_word); }