b3eda9
commit 7f1dd9d5aec1f1fd4eb0ae3a311358a914f1d73f
b3eda9
Author: Julian Seward <jseward@acm.org>
b3eda9
Date:   Tue Nov 20 10:18:29 2018 +0100
b3eda9
b3eda9
    get_otrack_shadow_offset_wrk for ppc32 and ppc64: add missing cases for XER_OV32, XER_CA32 and C_FPCC.
b3eda9
    
b3eda9
    The missing cases were discovered whilst testing fixes for bug 386945, but are
b3eda9
    otherwise unrelated to that bug.
b3eda9
b3eda9
diff --git a/memcheck/mc_machine.c b/memcheck/mc_machine.c
b3eda9
index 5ed101f..4ce746e 100644
b3eda9
--- a/memcheck/mc_machine.c
b3eda9
+++ b/memcheck/mc_machine.c
b3eda9
@@ -120,11 +120,11 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
b3eda9
    Int  o    = offset;
b3eda9
    tl_assert(sz > 0);
b3eda9
 
b3eda9
-#if defined(VGA_ppc64be)
b3eda9
+#  if defined(VGA_ppc64be)
b3eda9
    tl_assert(host_is_big_endian());
b3eda9
-#elif defined(VGA_ppc64le)
b3eda9
+#  elif defined(VGA_ppc64le)
b3eda9
    tl_assert(host_is_little_endian());
b3eda9
-#endif
b3eda9
+#  endif
b3eda9
 
b3eda9
    if (sz == 8 || sz == 4) {
b3eda9
       /* The point of this is to achieve
b3eda9
@@ -132,11 +132,11 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
b3eda9
             return GOF(GPRn);
b3eda9
          by testing ox instead of o, and setting ox back 4 bytes when sz == 4.
b3eda9
       */
b3eda9
-#if defined(VGA_ppc64le)
b3eda9
+#     if defined(VGA_ppc64le)
b3eda9
       Int ox = o;
b3eda9
-#else
b3eda9
+#     else
b3eda9
       Int ox = sz == 8 ? o : (o - 4);
b3eda9
-#endif
b3eda9
+#     endif
b3eda9
       if (ox == GOF(GPR0)) return ox;
b3eda9
       if (ox == GOF(GPR1)) return ox;
b3eda9
       if (ox == GOF(GPR2)) return ox;
b3eda9
@@ -240,11 +240,13 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
b3eda9
    if (o == GOF(VSR31) && sz == 8) return o;
b3eda9
 
b3eda9
    /* For the various byte sized XER/CR pieces, use offset 8
b3eda9
-      in VSR0 .. VSR19. */
b3eda9
+      in VSR0 .. VSR21. */
b3eda9
    tl_assert(SZB(VSR0) == 16);
b3eda9
    if (o == GOF(XER_SO) && sz == 1) return 8 +GOF(VSR0);
b3eda9
    if (o == GOF(XER_OV) && sz == 1) return 8 +GOF(VSR1);
b3eda9
+   if (o == GOF(XER_OV32) && sz == 1) return 8 +GOF(VSR20);
b3eda9
    if (o == GOF(XER_CA) && sz == 1) return 8 +GOF(VSR2);
b3eda9
+   if (o == GOF(XER_CA32) && sz == 1) return 8 +GOF(VSR21);
b3eda9
    if (o == GOF(XER_BC) && sz == 1) return 8 +GOF(VSR3);
b3eda9
 
b3eda9
    if (o == GOF(CR0_321) && sz == 1) return 8 +GOF(VSR4);
b3eda9
@@ -388,6 +390,7 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
b3eda9
    if (o == GOF(IP_AT_SYSCALL) && sz == 4) return -1; /* slot unused */
b3eda9
    if (o == GOF(FPROUND)   && sz == 1) return -1;
b3eda9
    if (o == GOF(DFPROUND)  && sz == 1) return -1;
b3eda9
+   if (o == GOF(C_FPCC)    && sz == 1) return -1;
b3eda9
    if (o == GOF(VRSAVE)    && sz == 4) return -1;
b3eda9
    if (o == GOF(EMNOTE)    && sz == 4) return -1;
b3eda9
    if (o == GOF(CMSTART)   && sz == 4) return -1;
b3eda9
@@ -440,11 +443,13 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
b3eda9
    if (o == GOF(VSR31) && sz == 8) return o;
b3eda9
 
b3eda9
    /* For the various byte sized XER/CR pieces, use offset 8
b3eda9
-      in VSR0 .. VSR19. */
b3eda9
+      in VSR0 .. VSR21. */
b3eda9
    tl_assert(SZB(VSR0) == 16);
b3eda9
    if (o == GOF(XER_SO) && sz == 1) return 8 +GOF(VSR0);
b3eda9
    if (o == GOF(XER_OV) && sz == 1) return 8 +GOF(VSR1);
b3eda9
+   if (o == GOF(XER_OV32) && sz == 1) return 8 +GOF(VSR20);
b3eda9
    if (o == GOF(XER_CA) && sz == 1) return 8 +GOF(VSR2);
b3eda9
+   if (o == GOF(XER_CA32) && sz == 1) return 8 +GOF(VSR21);
b3eda9
    if (o == GOF(XER_BC) && sz == 1) return 8 +GOF(VSR3);
b3eda9
 
b3eda9
    if (o == GOF(CR0_321) && sz == 1) return 8 +GOF(VSR4);