2002-08-13 Michael Snyder <msnyder@redhat.com>
authorMichael Snyder <msnyder@vmware.com>
Tue, 17 Sep 2002 20:54:02 +0000 (20:54 +0000)
committerMichael Snyder <msnyder@vmware.com>
Tue, 17 Sep 2002 20:54:02 +0000 (20:54 +0000)
* mips-tdep.c (mips_pop_frame): Read saved values of floating
point registers without sign extension.

gdb/ChangeLog
gdb/mips-tdep.c

index 14d09fb87441b6f68e98a378d6be7a9549eb82eb..f2c1116a9a81bd4743f94d8b35401241dbfdc943 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-13  Michael Snyder  <msnyder@redhat.com>
+
+       * mips-tdep.c (mips_pop_frame): Read saved values of floating
+       point registers without sign extension.
+
 2002-09-17  Andrew Cagney  <cagney@redhat.com>
 
        * blockframe.c (deprecated_read_register_dummy): Rename
index 5071446d3111edfbb2a744a98c0a9c4aab2fe08c..683faa4e4fbc70b1596468f9e617e4dbcd865cfa 100644 (file)
@@ -3782,13 +3782,21 @@ mips_pop_frame (void)
   if (frame->saved_regs == NULL)
     FRAME_INIT_SAVED_REGS (frame);
   for (regnum = 0; regnum < NUM_REGS; regnum++)
-    {
-      if (regnum != SP_REGNUM && regnum != PC_REGNUM
-         && frame->saved_regs[regnum])
-       write_register (regnum,
-                       read_memory_integer (frame->saved_regs[regnum],
-                                            MIPS_SAVED_REGSIZE));
-    }
+    if (regnum != SP_REGNUM && regnum != PC_REGNUM
+       && frame->saved_regs[regnum])
+      {
+       /* Floating point registers must not be sign extended, 
+          in case MIPS_SAVED_REGSIZE = 4 but sizeof (FP0_REGNUM) == 8.  */
+
+       if (FP0_REGNUM <= regnum && regnum < FP0_REGNUM + 32)
+         write_register (regnum,
+                         read_memory_unsigned_integer (frame->saved_regs[regnum],
+                                                       MIPS_SAVED_REGSIZE));
+       else
+         write_register (regnum,
+                         read_memory_integer (frame->saved_regs[regnum],
+                                              MIPS_SAVED_REGSIZE));
+      }
 
   write_register (SP_REGNUM, new_sp);
   flush_cached_frames ();