From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7142 invoked by alias); 5 Mar 2004 22:36:53 -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 7124 invoked from network); 5 Mar 2004 22:36:52 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 5 Mar 2004 22:36:53 -0000 Received: by localhost.redhat.com (Postfix, from userid 469) id 60A541A448D; Fri, 5 Mar 2004 17:31:22 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16456.65466.312420.773141@localhost.redhat.com> Date: Fri, 05 Mar 2004 22:36:00 -0000 To: gdb-patches@sources.redhat.com Subject: Re: [RFA] sh-tdep.c: Fix erroneus register skipping in sh_print_registers_info In-Reply-To: <20040218135942.GA29776@cygbert.vinschen.de> References: <20040218135942.GA29776@cygbert.vinschen.de> X-SW-Source: 2004-03.o/txt/msg00114.txt Message-ID: <20040305223600.g-f9vs88YHinBZZWnNVZvjfPsXxBFdbtWEIviHZq4Rw@z> Corinna Vinschen writes: > Hi, > > the below patch fixes a long standing bug in sh_print_registers_info. > When the print loop encounters a float type register and fpregs is > not set, then the loop counter (regnum) is not just incremented by > one, but instead it's incremented by FP_LAST_REGNUM - FP0_REGNUM. > > The problem with this is, that FPUL is also a float type register. > FPUL is two register numbers below FP0_REGNUM. So when the loop > arrives at FPUL, it skips the next 16 registers. The next evaluated > register then (fr14) is still a float type register, so the loop > skips again 16 registers. As a result, the register set is never > printed completely when calling `info registers'. > > The below patch fixes that and shortens the code slightly by using > a "for" loop instead of "while". > > > Corinna > > > ChangeLog: > > * sh-tdep.c (sh_print_registers_info): Use for loop. > Don't skip multiple registers when a float register is encountered. > ok