]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Track the IMark changes in VEX r3055.
authorFlorian Krohm <florian@eich-krohm.de>
Fri, 2 Jan 2015 17:32:40 +0000 (17:32 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Fri, 2 Jan 2015 17:32:40 +0000 (17:32 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14844

cachegrind/cg_main.c
callgrind/main.c
coregrind/m_translate.c
exp-bbv/bbv_main.c
exp-sgcheck/h_main.c
exp-sgcheck/sg_main.c
helgrind/hg_main.c
memcheck/mc_translate.c

index 685b973e7115d6e5d6612dd5b52252e7939270b5..ec9c6e9d884b5059bf66a87059d5a5100c2e569b 100644 (file)
@@ -1045,9 +1045,10 @@ IRSB* cg_instrument ( VgCallbackClosure* closure,
                       const VexArchInfo* archinfo_host,
                       IRType gWordTy, IRType hWordTy )
 {
-   Int        i, isize;
+   Int        i;
+   UInt       isize;
    IRStmt*    st;
-   Addr64     cia; /* address of current insn */
+   Addr       cia; /* address of current insn */
    CgState    cgs;
    IRTypeEnv* tyenv = sbIn->tyenv;
    InstrInfo* curr_inode = NULL;
@@ -1242,7 +1243,7 @@ IRSB* cg_instrument ( VgCallbackClosure* closure,
                   we can pass it to the branch predictor simulation
                   functions easily. */
                Bool     inverted;
-               Addr64   nia, sea;
+               Addr     nia, sea;
                IRConst* dst;
                IRType   tyW    = hWordTy;
                IROp     widen  = tyW==Ity_I32  ? Iop_1Uto32  : Iop_1Uto64;
@@ -1257,15 +1258,13 @@ IRSB* cg_instrument ( VgCallbackClosure* closure,
                   inverted by the ir optimiser.  To do that, figure out
                   the next (fallthrough) instruction's address and the
                   side exit address and see if they are the same. */
-               nia = cia + (Addr64)isize;
-               if (tyW == Ity_I32)
-                  nia &= 0xFFFFFFFFULL;
+               nia = cia + isize;
 
                /* Side exit address */
                dst = st->Ist.Exit.dst;
                if (tyW == Ity_I32) {
                   tl_assert(dst->tag == Ico_U32);
-                  sea = (Addr64)(UInt)dst->Ico.U32;
+                  sea = dst->Ico.U32;
                } else {
                   tl_assert(tyW == Ity_I64);
                   tl_assert(dst->tag == Ico_U64);
index 6845d9d40ee137eb6fe0f7c4b199a62718c0cb3d..05df95d35cfa53d93da40179efb589824bb17569 100644 (file)
@@ -880,7 +880,7 @@ void CLG_(collectBlockInfo)(IRSB* sbIn,
          if (Ist_IMark == st->tag) {
              inPreamble = False;
 
-             instrAddr = (Addr)ULong_to_Ptr(st->Ist.IMark.addr);
+             instrAddr = st->Ist.IMark.addr;
              instrLen  = st->Ist.IMark.len;
 
              (*instrs)++;
@@ -994,7 +994,7 @@ IRSB* CLG_(instrument)( VgCallbackClosure* closure,
    st = sbIn->stmts[i];
    CLG_ASSERT(Ist_IMark == st->tag);
 
-   origAddr = (Addr)st->Ist.IMark.addr + (Addr)st->Ist.IMark.delta;
+   origAddr = st->Ist.IMark.addr + st->Ist.IMark.delta;
    CLG_ASSERT(origAddr == st->Ist.IMark.addr 
                           + st->Ist.IMark.delta);  // XXX: check no overflow
 
@@ -1026,9 +1026,9 @@ IRSB* CLG_(instrument)( VgCallbackClosure* closure,
            break;
 
         case Ist_IMark: {
-            Addr64 cia   = st->Ist.IMark.addr + st->Ist.IMark.delta;
-            Int    isize = st->Ist.IMark.len;
-            CLG_ASSERT(clgs.instr_offset == (Addr)cia - origAddr);
+            Addr   cia   = st->Ist.IMark.addr + st->Ist.IMark.delta;
+            UInt   isize = st->Ist.IMark.len;
+            CLG_ASSERT(clgs.instr_offset == cia - origAddr);
            // If Vex fails to decode an instruction, the size will be zero.
            // Pretend otherwise.
            if (isize == 0) isize = VG_MIN_INSTR_SZB;
index 212ed6f651eaa6b71d5fb8a56faeb44d3d345ca5..6c3c8995290df1bb0162396ad67213834369eeff 100644 (file)
@@ -202,11 +202,11 @@ static void update_SP_aliases(Long delta)
 /* Given a guest IP, get an origin tag for a 1-element stack trace,
    and wrap it up in an IR atom that can be passed as the origin-tag
    value for a stack-adjustment helper function. */
-static IRExpr* mk_ecu_Expr ( Addr64 guest_IP )
+static IRExpr* mk_ecu_Expr ( Addr guest_IP )
 {
    UInt ecu;
    ExeContext* ec
-      = VG_(make_depth_1_ExeContext_from_Addr)( (Addr)guest_IP );
+      = VG_(make_depth_1_ExeContext_from_Addr)( guest_IP );
    vg_assert(ec);
    ecu = VG_(get_ECU_from_ExeContext)( ec );
    vg_assert(VG_(is_plausible_ECU)(ecu));
@@ -280,7 +280,7 @@ IRSB* vg_SP_update_pass ( void*             closureV,
 
    /* Set up stuff for tracking the guest IP */
    Bool   curr_IP_known = False;
-   Addr64 curr_IP       = 0;
+   Addr   curr_IP       = 0;
 
    /* Set up BB */
    IRSB* bb     = emptyIRSB();
index 82ac7ea872c7b403ca0fd0e199b5cd4d4ad42950..d7008c1d9a482da1cf78847b9c74fb1024bc9284 100644 (file)
@@ -257,7 +257,7 @@ static VG_REGPARM(1) void per_instruction_BBV_fldcw(struct BB_info *bbInfo)
    /* Check if the instruction pointed to is one that needs */
    /*   special handling.  If so, set a bit in the return   */
    /*   value indicating what type.                         */
-static Int get_inst_type(Int len, Addr addr)
+static Int get_inst_type(UInt len, Addr addr)
 {
    int result=0;
 
@@ -342,7 +342,7 @@ static IRSB* bbv_instrument ( VgCallbackClosure* closure,
    IRSB     *sbOut;
    IRStmt   *st;
    struct BB_info  *bbInfo;
-   Addr64   origAddr,ourAddr;
+   Addr     origAddr,ourAddr;
    IRDirty  *di;
    IRExpr   **argv, *arg1;
    Int      regparms,opcode_type;
index ed1ac1dccafdb49555d27f44f5dc4a48eef28d85..fc2650d2bd4f05f3374355ae7aef6abb10b1aaec 100644 (file)
@@ -628,7 +628,7 @@ IRSB* h_instrument ( VgCallbackClosure* closure,
    tl_assert(sizeof(Addr)   == sizeof(void*));
    tl_assert(sizeof(ULong)  == 8);
    tl_assert(sizeof(Long)   == 8);
-   tl_assert(sizeof(Addr64) == 8);
+   tl_assert(sizeof(Addr)   == sizeof(void*));
    tl_assert(sizeof(UInt)   == 4);
    tl_assert(sizeof(Int)    == 4);
 
index f6f5fc418d27188f76cac3c4ae7b8bfda3b15887..22c1000d31d98bb9d8c7784082011468aa9617a9 100644 (file)
@@ -2063,7 +2063,7 @@ static void shadowStack_unwind ( ThreadId tid, Addr sp_now )
 
 struct _SGEnv {
    /* the current insn's IP */
-   Addr64 curr_IP;
+   Addr curr_IP;
    /* whether the above is actually known */
    Bool curr_IP_known;
    /* if we find a mem ref, is it the first for this insn?  Used for
@@ -2224,7 +2224,7 @@ void sg_instrument_IRStmt ( /*MOD*/struct _SGEnv * env,
 
       case Ist_IMark:
          env->curr_IP_known = True;
-         env->curr_IP       = (Addr)st->Ist.IMark.addr;
+         env->curr_IP       = st->Ist.IMark.addr;
          env->firstRef      = True;
          break;
 
index 3f130743cc6930b823f50387cfe16cb1706fce96..f9917eadc95e11b06d9c94dd9716bbda92544ec5 100644 (file)
@@ -4445,13 +4445,13 @@ static void instrument_mem_access ( IRSB*   sbOut,
 /* Figure out if GA is a guest code address in the dynamic linker, and
    if so return True.  Otherwise (and in case of any doubt) return
    False.  (sidedly safe w/ False as the safe value) */
-static Bool is_in_dynamic_linker_shared_object( Addr64 ga )
+static Bool is_in_dynamic_linker_shared_object( Addr ga )
 {
    DebugInfo* dinfo;
    const HChar* soname;
    if (0) return False;
 
-   dinfo = VG_(find_DebugInfo)( (Addr)ga );
+   dinfo = VG_(find_DebugInfo)( ga );
    if (!dinfo) return False;
 
    soname = VG_(DebugInfo_get_soname)(dinfo);
@@ -4485,10 +4485,10 @@ IRSB* hg_instrument ( VgCallbackClosure* closure,
 {
    Int     i;
    IRSB*   bbOut;
-   Addr64  cia; /* address of current insn */
+   Addr    cia; /* address of current insn */
    IRStmt* st;
    Bool    inLDSO = False;
-   Addr64  inLDSOmask4K = 1; /* mismatches on first check */
+   Addr    inLDSOmask4K = 1; /* mismatches on first check */
 
    const Int goff_sp = layout->offset_SP;
 
@@ -4546,12 +4546,12 @@ IRSB* hg_instrument ( VgCallbackClosure* closure,
                Avoid flooding is_in_dynamic_linker_shared_object with
                requests by only checking at transitions between 4K
                pages. */
-            if ((cia & ~(Addr64)0xFFF) != inLDSOmask4K) {
-               if (0) VG_(printf)("NEW %#lx\n", (Addr)cia);
-               inLDSOmask4K = cia & ~(Addr64)0xFFF;
+            if ((cia & ~(Addr)0xFFF) != inLDSOmask4K) {
+               if (0) VG_(printf)("NEW %#lx\n", cia);
+               inLDSOmask4K = cia & ~(Addr)0xFFF;
                inLDSO = is_in_dynamic_linker_shared_object(cia);
             } else {
-               if (0) VG_(printf)("old %#lx\n", (Addr)cia);
+               if (0) VG_(printf)("old %#lx\n", cia);
             }
             break;
 
index e4516c769aea0446ad2f70c6083a5990be6bebf3..31249f19b4a91e86afb0e3d43de1778a0293027b 100644 (file)
@@ -6221,7 +6221,6 @@ IRSB* MC_(instrument) ( VgCallbackClosure* closure,
    tl_assert(sizeof(Addr)   == sizeof(void*));
    tl_assert(sizeof(ULong)  == 8);
    tl_assert(sizeof(Long)   == 8);
-   tl_assert(sizeof(Addr64) == 8);
    tl_assert(sizeof(UInt)   == 4);
    tl_assert(sizeof(Int)    == 4);