|
From: <sv...@va...> - 2005-08-12 23:47:53
|
Author: njn
Date: 2005-08-13 00:47:51 +0100 (Sat, 13 Aug 2005)
New Revision: 4391
Log:
Cachegrind should not assert when it encounters a client request.
BACKPORT TO 3_0_X
Modified:
trunk/cachegrind/cg_main.c
Modified: trunk/cachegrind/cg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cachegrind/cg_main.c 2005-08-12 23:40:55 UTC (rev 4390)
+++ trunk/cachegrind/cg_main.c 2005-08-12 23:47:51 UTC (rev 4391)
@@ -576,12 +576,6 @@
if (storeAddrExpr)=20
tl_assert(wordTy =3D=3D typeOfIRExpr(bbOut->tyenv, storeAddrExpr))=
;
=20
-
- // Nb: instrLen will be zero if Vex failed to decode it.
- tl_assert( 0 =3D=3D instrLen ||
- (instrLen >=3D VG_MIN_INSTR_SZB &&=20
- instrLen <=3D 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 fr=
om
// hitting more than two cache lines in the simulation.
@@ -703,6 +697,14 @@
tl_assert(!addedInstrumentation);
addedInstrumentation =3D True;
=20
+ // 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 instructio=
ns.
+ tl_assert( 0 =3D=3D instrLen ||
+ bbIn->jumpkind =3D=3D Ijk_ClientReq ||
+ (instrLen >=3D VG_MIN_INSTR_SZB &&=20
+ instrLen <=3D VG_MAX_INSTR_SZB) );
+
// Add instrumentation before this statement.
instrumentInstr(bbOut, &bbInfo->instrs[ bbInfo_i ], bbSeenBe=
fore,
instrAddr, instrLen, dataSize, loadAddrExpr, store=
AddrExpr);
|