]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips32: Fix the problem with reading the guest_FCSR register from the wrong guest...
authorDejan Jevtic <dejan.jevtic@valgrind.org>
Mon, 3 Mar 2014 14:13:37 +0000 (14:13 +0000)
committerDejan Jevtic <dejan.jevtic@valgrind.org>
Mon, 3 Mar 2014 14:13:37 +0000 (14:13 +0000)
When Valgrind isn't executed in mode64, register fcsr need to read from the VexGuestMIPS32State.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2832

VEX/priv/guest_mips_toIR.c

index d95d58303e9d8ebdfece2d8a3f79c0a48d050752..51e7cfc7ed042c63f2ef363ae9f23067b26c3e5e 100644 (file)
@@ -1140,7 +1140,10 @@ static void calculateFCSR(UInt fs, UInt ft, UInt inst, Bool sz32, UInt opN)
       vex_bzero(&d->fxState, sizeof(d->fxState));
 
       d->fxState[0].fx     = Ifx_Read;  /* read */
-      d->fxState[0].offset = offsetof(VexGuestMIPS64State, guest_FCSR);
+      if (mode64)
+         d->fxState[0].offset = offsetof(VexGuestMIPS64State, guest_FCSR);
+      else
+         d->fxState[0].offset = offsetof(VexGuestMIPS32State, guest_FCSR);
       d->fxState[0].size   = sizeof(UInt);
       d->fxState[1].fx     = Ifx_Read;  /* read */
       d->fxState[1].offset = floatGuestRegOffset(fs);
@@ -1160,7 +1163,10 @@ static void calculateFCSR(UInt fs, UInt ft, UInt inst, Bool sz32, UInt opN)
       vex_bzero(&d->fxState, sizeof(d->fxState));
 
       d->fxState[0].fx     = Ifx_Read;  /* read */
-      d->fxState[0].offset = offsetof(VexGuestMIPS64State, guest_FCSR);
+      if (mode64)
+         d->fxState[0].offset = offsetof(VexGuestMIPS64State, guest_FCSR);
+      else
+         d->fxState[0].offset = offsetof(VexGuestMIPS32State, guest_FCSR);
       d->fxState[0].size   = sizeof(UInt);
       d->fxState[1].fx     = Ifx_Read;  /* read */
       d->fxState[1].offset = floatGuestRegOffset(fs);