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 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/callgrind/main.c b/callgrind/main.c
index c44f360..ac71f52 100644
--- a/callgrind/main.c
+++ b/callgrind/main.c
@@ -905,10 +905,9 @@
 			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 @@
    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 @@
 	    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.