* sh-tdep.c (sh_print_registers_info): Use for loop.

Don't skip multiple registers when a float register is encountered.
This commit is contained in:
Corinna Vinschen 2004-03-08 10:18:13 +00:00
parent a2b4a96c10
commit 3930f270e6
2 changed files with 10 additions and 17 deletions

View File

@ -1,3 +1,8 @@
2004-03-08 Corinna Vinschen <vinschen@redhat.com>
* sh-tdep.c (sh_print_registers_info): Use for loop.
Don't skip multiple registers when a float register is encountered.
2004-03-08 Corinna Vinschen <vinschen@redhat.com>
Fix PR tdep/1291.

View File

@ -1792,35 +1792,23 @@ sh_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
else
/* do all (or most) registers */
{
regnum = 0;
while (regnum < NUM_REGS)
for (regnum = 0; regnum < NUM_REGS; ++regnum)
{
/* If the register name is empty, it is undefined for this
processor, so don't display anything. */
if (REGISTER_NAME (regnum) == NULL
|| *(REGISTER_NAME (regnum)) == '\0')
{
regnum++;
continue;
}
continue;
if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) ==
TYPE_CODE_FLT)
{
/* true for "INFO ALL-REGISTERS" command */
if (fpregs)
{
/* true for "INFO ALL-REGISTERS" command */
sh_do_fp_register (gdbarch, file, regnum); /* FP regs */
regnum++;
}
else
regnum += (FP_LAST_REGNUM - FP0_REGNUM); /* skip FP regs */
sh_do_fp_register (gdbarch, file, regnum); /* FP regs */
}
else
{
sh_do_register (gdbarch, file, regnum); /* All other regs */
regnum++;
}
sh_do_register (gdbarch, file, regnum); /* All other regs */
}
if (fpregs)