]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Index the BB_info table by redirected guest address, not
authorJulian Seward <jseward@acm.org>
Sun, 22 Jan 2006 01:12:51 +0000 (01:12 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 22 Jan 2006 01:12:51 +0000 (01:12 +0000)
non-redirected guest address.  This is a small but significant change
needed to make function wrapping work.  The problem is that with
function wrapping two different translations are associated with the
non-redirected address (of a wrapped function entry point), and so
cachegrind asserts.  Whereas the redirected guest addresses reflect
the reality of only one translation associated with each address.  So
use them instead.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5582

cachegrind/cg_main.c

index 7fa516bb90c966d933a20b1acf0d62edc41ee31b..75d031f179e77fa36a663922312210b9b4530e32 100644 (file)
@@ -745,8 +745,9 @@ IRBB* cg_instrument ( VgCallbackClosure* closure,
    cia = st->Ist.IMark.addr;
 
    // Set up running state and get block info
+   tl_assert(closure->readdr == vge->base[0]);
    cgs.events_used = 0;
-   cgs.bbInfo      = get_BB_info(bbIn, (Addr)closure->nraddr);
+   cgs.bbInfo      = get_BB_info(bbIn, (Addr)closure->readdr);
    cgs.bbInfo_i    = 0;
 
    if (DEBUG_CG)
@@ -1231,7 +1232,7 @@ static
 void cg_discard_basic_block_info ( Addr64 orig_addr64, VexGuestExtents vge )
 {
    BB_info* bbInfo;
-   Addr     orig_addr = (Addr)orig_addr64;
+   Addr     orig_addr = (Addr)vge.base[0];
 
    tl_assert(vge.n_used > 0);