diff options
author | njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2005-08-12 23:47:51 +0000 |
---|---|---|
committer | njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2005-08-12 23:47:51 +0000 |
commit | 20677cc8ca07b5881279667f3759517bebfc29cb (patch) | |
tree | 81c81342846705a3efc92e37aca8f026993c385f /cachegrind | |
parent | 09ea9c4eadaafff7777d6a5af2178603d6eee99f (diff) |
Cachegrind should not assert when it encounters a client request.
BACKPORT TO 3_0_X
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4391 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'cachegrind')
-rw-r--r-- | cachegrind/cg_main.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c index 159c5f88..98970562 100644 --- a/cachegrind/cg_main.c +++ b/cachegrind/cg_main.c @@ -576,12 +576,6 @@ void instrumentInstr(IRBB* bbOut, instr_info* i_node, Bool bbSeenBefore, if (storeAddrExpr) tl_assert(wordTy == typeOfIRExpr(bbOut->tyenv, storeAddrExpr)); - - // Nb: instrLen will be zero if Vex failed to decode it. - tl_assert( 0 == instrLen || - (instrLen >= VG_MIN_INSTR_SZB && - instrLen <= VG_MAX_INSTR_SZB) ); - // Large (eg. 28B, 108B, 512B on x86) data-sized instructions will be // done inaccurately, but they're very rare and this avoids errors from // hitting more than two cache lines in the simulation. @@ -703,6 +697,14 @@ static IRBB* cg_instrument ( IRBB* bbIn, VexGuestLayout* layout, tl_assert(!addedInstrumentation); addedInstrumentation = True; + // Nb: instrLen will be zero if Vex failed to decode it. + // Also Client requests can appear to be very large (eg. 18 + // bytes on x86) because they are really multiple instructions. + tl_assert( 0 == instrLen || + bbIn->jumpkind == Ijk_ClientReq || + (instrLen >= VG_MIN_INSTR_SZB && + instrLen <= VG_MAX_INSTR_SZB) ); + // Add instrumentation before this statement. instrumentInstr(bbOut, &bbInfo->instrs[ bbInfo_i ], bbSeenBefore, instrAddr, instrLen, dataSize, loadAddrExpr, storeAddrExpr); |