From: Julian Seward Date: Tue, 8 Nov 2011 19:32:57 +0000 (+0000) Subject: When doing instrumentation, pay attention to the Ist.IMark.delta X-Git-Tag: svn/VALGRIND_3_8_0~591 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95f980821ab613d88eb32e4b71d5d184cbfe3d3c;p=thirdparty%2Fvalgrind.git When doing instrumentation, pay attention to the Ist.IMark.delta fields. This makes the --ct-verbose=1 output make a lot more sense for Thumb code. Should have no effect on any other platform. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12260 --- diff --git a/callgrind/main.c b/callgrind/main.c index c44f360fa3..ac71f52c01 100644 --- a/callgrind/main.c +++ b/callgrind/main.c @@ -905,10 +905,9 @@ IRSB* CLG_(instrument)( VgCallbackClosure* closure, VexGuestExtents* vge, IRType gWordTy, IRType hWordTy ) { - Int i, isize; + Int i; IRStmt* st; Addr origAddr; - Addr64 cia; /* address of current insn */ InstrInfo* curr_inode = NULL; ClgState clgs; UInt cJumps = 0; @@ -944,10 +943,9 @@ IRSB* CLG_(instrument)( VgCallbackClosure* closure, st = sbIn->stmts[i]; CLG_ASSERT(Ist_IMark == st->tag); - origAddr = (Addr)st->Ist.IMark.addr; - cia = st->Ist.IMark.addr; - isize = st->Ist.IMark.len; - CLG_ASSERT(origAddr == st->Ist.IMark.addr); // XXX: check no overflow + origAddr = (Addr)st->Ist.IMark.addr + (Addr)st->Ist.IMark.delta; + CLG_ASSERT(origAddr == st->Ist.IMark.addr + + st->Ist.IMark.delta); // XXX: check no overflow /* Get BB struct (creating if necessary). * JS: The hash table is keyed with orig_addr_noredir -- important! @@ -977,8 +975,8 @@ IRSB* CLG_(instrument)( VgCallbackClosure* closure, break; case Ist_IMark: { - cia = st->Ist.IMark.addr; - isize = st->Ist.IMark.len; + Addr64 cia = st->Ist.IMark.addr + st->Ist.IMark.delta; + Int isize = st->Ist.IMark.len; CLG_ASSERT(clgs.instr_offset == (Addr)cia - origAddr); // If Vex fails to decode an instruction, the size will be zero. // Pretend otherwise.