Blame valgrind-3.14.0-get_otrack_shadow_offset_wrk-ppc.patch

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