]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
DRD, --trace-addr: enable support for Ity_F32 and Ity_F64 / temporarily disable suppo...
authorBart Van Assche <bvanassche@acm.org>
Tue, 13 Dec 2011 08:53:23 +0000 (08:53 +0000)
committerBart Van Assche <bvanassche@acm.org>
Tue, 13 Dec 2011 08:53:23 +0000 (08:53 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12304

drd/drd_load_store.c
drd/tests/annotate_trace_memory.stderr.exp-32bit
drd/tests/annotate_trace_memory_xml.stderr.exp-32bit

index 505edb7d92b093ed8e89362c9a5d64317e527537..218dfc671f7d9988157ebb5da39f06bb43b762b9 100644 (file)
@@ -343,6 +343,37 @@ static void instr_trace_mem_store(IRSB* const bb, IRExpr* const addr_expr,
    ty_data_expr = typeOfIRExpr(bb->tyenv, data_expr);
    size = sizeofIRType(ty_data_expr);
 
+#if 0
+   // Test code
+   if (ty_data_expr == Ity_I32) {
+      IRTemp tmp = newIRTemp(bb->tyenv, Ity_F32);
+      data_expr = IRExpr_Unop(Iop_ReinterpI32asF32, data_expr);
+      addStmtToIRSB(bb, IRStmt_WrTmp(tmp, data_expr));
+      data_expr = IRExpr_RdTmp(tmp);
+      ty_data_expr = Ity_F32;
+   } else if (ty_data_expr == Ity_I64) {
+      IRTemp tmp = newIRTemp(bb->tyenv, Ity_F64);
+      data_expr = IRExpr_Unop(Iop_ReinterpI64asF64, data_expr);
+      addStmtToIRSB(bb, IRStmt_WrTmp(tmp, data_expr));
+      data_expr = IRExpr_RdTmp(tmp);
+      ty_data_expr = Ity_F64;
+   }
+#endif
+
+   if (ty_data_expr == Ity_F32) {
+      IRTemp tmp = newIRTemp(bb->tyenv, Ity_I32);
+      addStmtToIRSB(bb, IRStmt_WrTmp(tmp, IRExpr_Unop(Iop_ReinterpF32asI32,
+                                                      data_expr)));
+      data_expr = IRExpr_RdTmp(tmp);
+      ty_data_expr = Ity_I32;
+   } else if (ty_data_expr == Ity_F64) {
+      IRTemp tmp = newIRTemp(bb->tyenv, Ity_I64);
+      addStmtToIRSB(bb, IRStmt_WrTmp(tmp, IRExpr_Unop(Iop_ReinterpF64asI64,
+                                                      data_expr)));
+      data_expr = IRExpr_RdTmp(tmp);
+      ty_data_expr = Ity_I64;
+   }
+
    if (size == sizeof(HWord)
        && (ty_data_expr == Ity_I32 || ty_data_expr == Ity_I64))
    {
@@ -369,10 +400,7 @@ static void instr_trace_mem_store(IRSB* const bb, IRExpr* const addr_expr,
                        IRStmt_WrTmp(tmp, IRExpr_Unop(widen_op, data_expr)));
          data_expr = IRExpr_RdTmp(tmp);
       } else {
-         /*
-          * Replace anything wider than a HWord and also Ity_F32, Ity_F64,
-          * Ity_F128 and Ity_V128 by zero.
-          */
+         /* Replace anything wider than a HWord with zero. */
          data_expr = mkIRExpr_HWord(0);
       }
    }
@@ -626,18 +654,10 @@ IRSB* DRD_(instrument)(VgCallbackClosure* const closure,
 
             if (UNLIKELY(DRD_(any_address_is_traced)())) {
                if (cas->dataHi) {
-                  IRExpr* data_expr;
-
                   tl_assert(typeOfIRExpr(bb->tyenv, cas->dataLo) == Ity_I32);
-                  data_expr
-                     = IRExpr_Binop(
-                          Iop_Or64,
-                          IRExpr_Binop(
-                             Iop_Shl64,
-                             IRExpr_Unop(Iop_32Uto64, cas->dataHi),
-                             mkIRExpr_HWord(32)),
-                          IRExpr_Unop(Iop_32Uto64, cas->dataLo));
-                  instr_trace_mem_store(bb, cas->addr, data_expr);
+                  tl_assert(dataSize == 8);
+                  instr_trace_mem_store(bb, cas->addr,
+                                        IRExpr_Const(IRConst_U64(0)));
                } else {
                   instr_trace_mem_store(bb, cas->addr, cas->dataLo);
                }
index 3ef51f1b87415e657d830e3223c293ca6de44e19..b87babbed9c6c052fec61592f83cc89f52b5fb46 100644 (file)
@@ -4,7 +4,7 @@ store 0x........ size 4 val 1065353216/0x........ (thread x / vc ...)
    at 0x........: main (annotate_trace_memory.c:?)
 load  0x........ size 4 (thread x / vc ...)
    at 0x........: main (annotate_trace_memory.c:?)
-store 0x........ size 4 val 0/0x........ (thread x / vc ...)
+store 0x........ size 4 val 1077936128/0x........ (thread x / vc ...)
    at 0x........: main (annotate_trace_memory.c:?)
 double
 store 0x........ size 8 (thread x / vc ...)
index a5759b9a3d398707f7fc8ad0727597ae7c127e06..27b9bb60e0ad15363fe83ee71f15522ee9207d21 100644 (file)
@@ -53,7 +53,7 @@ float
     </frame>
   </stack>
   </trace>
-  <trace><text>store 0x........ size 4 val 0/0x........ (thread x / vc ...)</text>
+  <trace><text>store 0x........ size 4 val 1077936128/0x........ (thread x / vc ...)</text>
   <stack>
     <frame>
       <ip>0x........</ip>