From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21930 invoked by alias); 26 May 2005 06:37:51 -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 21898 invoked by uid 22791); 26 May 2005 06:37:39 -0000 Received: from cpe-138-130-119-179.nsw.bigpond.net.au (HELO takamaka.act-europe.fr) (138.130.119.179) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 26 May 2005 06:37:39 +0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 0F2B947958; Thu, 26 May 2005 16:37:35 +1000 (EST) Date: Thu, 26 May 2005 15:08:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: [RFA/alpha] Use correct register for FP branches in alpha_next_pc() Message-ID: <20050526063735.GL1530@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2005-05/txt/msg00557.txt.bz2 --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 891 Blush... Obvious mistake ... I looked at the 18 failures I currently have when running the following testcase (not yet approved): http://sources.redhat.com/ml/gdb-patches/2005-05/msg00546.html It turns out it was an obvious confusion between the register number embedded in the instruction, and hte register number as GDB knows it. Say for instance we have a conditional branch instruction on f16, right now we read register number 16, which is register a0, not f16! The fix I just committed seemed to be improving things, but only by chance :-/. With the attached patch, all tests now PASS. 2005-05-26 Joel Brobecker * alpha-tdep.c (alpha_next_pc): Use correct register number for floating-point branch instructions. Tested on alpha-tru64 5.1a. No regression, fixes all 18 failures observed in alpha-step.exp. OK to apply? -- Joel --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="alpha-tdep.c.diff" Content-length: 1147 Index: alpha-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/alpha-tdep.c,v retrieving revision 1.149 diff -u -p -r1.149 alpha-tdep.c --- alpha-tdep.c 20 May 2005 06:56:00 -0000 1.149 +++ alpha-tdep.c 26 May 2005 05:36:41 -0000 @@ -1372,6 +1372,7 @@ alpha_next_pc (CORE_ADDR pc) { unsigned int insn; unsigned int op; + int regno; int offset; LONGEST rav; char reg[8]; @@ -1404,7 +1405,19 @@ alpha_next_pc (CORE_ADDR pc) } /* Need to determine if branch is taken; read RA. */ - regcache_cooked_read (current_regcache, (insn >> 21) & 0x1f, reg); + regno = (insn >> 21) & 0x1f; + switch (op) + { + case 0x31: /* FBEQ */ + case 0x36: /* FBGE */ + case 0x37: /* FBGT */ + case 0x33: /* FBLE */ + case 0x32: /* FBLT */ + case 0x35: /* FBNE */ + regno += FP0_REGNUM; + } + + regcache_cooked_read (current_regcache, regno, reg); rav = extract_signed_integer (reg, 8); switch (op) --+QahgC5+KEYLbs62--