* sh-tdep.c (sh_print_registers_info): Use for loop.
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 8 Mar 2004 10:18:13 +0000 (10:18 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 8 Mar 2004 10:18:13 +0000 (10:18 +0000)
Don't skip multiple registers when a float register is encountered.

gdb/ChangeLog
gdb/sh-tdep.c

index 814c2f3..0e625b7 100644 (file)
@@ -1,5 +1,10 @@
 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.
        * sh-tdep.c (sh_analyze_prologue): Align PC relative addressing
        to official SH documentation.
index d1e5f59..45833fc 100644 (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)