This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] sh-tdep.c: Fix erroneus register skipping in sh_print_registers_info
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 5 Mar 2004 17:31:22 -0500
- Subject: Re: [RFA] sh-tdep.c: Fix erroneus register skipping in sh_print_registers_info
- References: <20040218135942.GA29776@cygbert.vinschen.de>
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