This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] sh-tdep.c: Fix erroneus register skipping in sh_print_registers_info


On Mar  5 17:31, Elena Zannoni wrote:
> 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

Thanks, applied.

Corinna

-- 
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]