From: Julian Seward Date: Sun, 22 Jan 2006 01:12:51 +0000 (+0000) Subject: Index the BB_info table by redirected guest address, not X-Git-Tag: svn/VALGRIND_3_2_0~329 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72341b358b2b7643adb288675d234f043c1315e8;p=thirdparty%2Fvalgrind.git Index the BB_info table by redirected guest address, not 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 --- diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c index 7fa516bb90..75d031f179 100644 --- a/cachegrind/cg_main.c +++ b/cachegrind/cg_main.c @@ -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);