PR 6878
[deliverable/binutils-gdb.git] / gdb / frame.c
index 0fd21e4eabed67b79547de05ff27fb14a7fc4e76..a877494307624b03bdde5b6e1d62a57a33d43cc2 100644 (file)
@@ -798,6 +798,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum,
   struct gdbarch *gdbarch = get_frame_arch (frame);
   int i;
   int maxsize;
+  int numregs;
 
   /* Skip registers wholly inside of OFFSET.  */
   while (offset >= register_size (gdbarch, regnum))
@@ -809,8 +810,8 @@ get_frame_register_bytes (struct frame_info *frame, int regnum,
   /* Ensure that we will not read beyond the end of the register file.
      This can only ever happen if the debug information is bad.  */
   maxsize = -offset;
-  for (i = regnum;
-       i < gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch); i++)
+  numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+  for (i = regnum; i < numregs; i++)
     {
       int thissize = register_size (gdbarch, i);
       if (thissize == 0)
This page took 0.02476 seconds and 4 git commands to generate.