diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c index e93981aad..bcb937a59 100644 --- a/addrcheck/ac_main.c +++ b/addrcheck/ac_main.c @@ -986,7 +986,8 @@ void ac_fpu_ACCESS_check_SLOWLY ( Addr addr, SizeT size, Bool isWrite ) /*--- Our instrumenter ---*/ /*------------------------------------------------------------*/ -IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy ) +IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, + IRType gWordTy, IRType hWordTy ) { Int i, hsz; IRStmt* st; @@ -995,9 +996,15 @@ IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy ) IRExpr* guard; IRDirty* di; Bool isLoad; + IRBB* bb; + + if (gWordTy != hWordTy) { + /* We don't currently support this case. */ + VG_(tool_panic)("host/guest word size mismatch"); + } /* Set up BB */ - IRBB* bb = emptyIRBB(); + bb = emptyIRBB(); bb->tyenv = dopyIRTypeEnv(bb_in->tyenv); bb->next = dopyIRExpr(bb_in->next); bb->jumpkind = bb_in->jumpkind; diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c index d6e18ee2e..40fd86c3c 100644 --- a/cachegrind/cg_main.c +++ b/cachegrind/cg_main.c @@ -559,7 +559,8 @@ void endOfInstr(IRBB* bbOut, instr_info* i_node, Bool bbSeenBefore, addStmtToIRBB( bbOut, IRStmt_Dirty(di) ); } -IRBB* TL_(instrument) ( IRBB* bbIn, VexGuestLayout* layout, IRType hWordTy ) +IRBB* TL_(instrument) ( IRBB* bbIn, VexGuestLayout* layout, + IRType gWordTy, IRType hWordTy ) { Int i, dataSize = 0, bbInfo_i; IRBB* bbOut; @@ -570,6 +571,11 @@ IRBB* TL_(instrument) ( IRBB* bbIn, VexGuestLayout* layout, IRType hWordTy ) UInt instrLen; IRExpr *loadAddrExpr, *storeAddrExpr; + if (gWordTy != hWordTy) { + /* We don't currently support this case. */ + VG_(tool_panic)("host/guest word size mismatch"); + } + /* Set up BB */ bbOut = emptyIRBB(); bbOut->tyenv = dopyIRTypeEnv(bbIn->tyenv); diff --git a/corecheck/cc_main.c b/corecheck/cc_main.c index 260157087..0d815120b 100644 --- a/corecheck/cc_main.c +++ b/corecheck/cc_main.c @@ -51,7 +51,8 @@ void TL_(post_clo_init)(void) { } -IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy ) +IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, + IRType gWordTy, IRType hWordTy ) { return bb_in; } diff --git a/coregrind/toolfuncs.def b/coregrind/toolfuncs.def index 1806c3bcb..4fa66dec5 100644 --- a/coregrind/toolfuncs.def +++ b/coregrind/toolfuncs.def @@ -26,7 +26,7 @@ void, post_clo_init ## Instrument a basic block. Must be a true function, ie. the same input ## always results in the same output, because basic blocks can be ## retranslated. Unless you're doing something really strange... -IRBB*, instrument, IRBB* bb, VexGuestLayout* layout, IRType hWordTy +IRBB*, instrument, IRBB* bb, VexGuestLayout* layout, IRType gWordTy, IRType hWordTy ## Finish up, print out any results, etc. `exitcode' is program's exit ## code. The shadow can be found with VG_(get_exit_status_shadow)(). diff --git a/lackey/lk_main.c b/lackey/lk_main.c index ef05d90c6..55fdc7e1c 100644 --- a/lackey/lk_main.c +++ b/lackey/lk_main.c @@ -129,13 +129,20 @@ void TL_(post_clo_init)(void) Which gives us the right answer. And just to avoid two C calls, we fold the basic-block-beginning call in with add_one_BB(). Phew. */ -IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy ) +IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, + IRType gWordTy, IRType hWordTy ) { IRDirty* di; Int i; + IRBB* bb; + + if (gWordTy != hWordTy) { + /* We don't currently support this case. */ + VG_(tool_panic)("host/guest word size mismatch"); + } /* Set up BB */ - IRBB* bb = emptyIRBB(); + bb = emptyIRBB(); bb->tyenv = dopyIRTypeEnv(bb_in->tyenv); bb->next = dopyIRExpr(bb_in->next); bb->jumpkind = bb_in->jumpkind; diff --git a/massif/ms_main.c b/massif/ms_main.c index 9ce0407df..1576b5fe6 100644 --- a/massif/ms_main.c +++ b/massif/ms_main.c @@ -1210,8 +1210,10 @@ void TL_(post_clo_init)(void) /*--- Instrumentation ---*/ /*------------------------------------------------------------*/ -IRBB* TL_(instrument) ( IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy ) +IRBB* TL_(instrument) ( IRBB* bb_in, VexGuestLayout* layout, + IRType gWordTy, IRType hWordTy ) { + /* XXX Will Massif work when gWordTy != hWordTy ? */ return bb_in; } diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c index 5dc79be61..f6f984b03 100644 --- a/memcheck/mc_translate.c +++ b/memcheck/mc_translate.c @@ -2383,16 +2383,23 @@ static Bool checkForBogusLiterals ( /*FLAT*/ IRStmt* st ) } -IRBB* TL_(instrument) ( IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy ) +IRBB* TL_(instrument) ( IRBB* bb_in, VexGuestLayout* layout, + IRType gWordTy, IRType hWordTy ) { Bool verboze = False; //True; Int i, j, first_stmt; IRStmt* st; MCEnv mce; + IRBB* bb; + + if (gWordTy != hWordTy) { + /* We don't currently support this case. */ + VG_(tool_panic)("host/guest word size mismatch"); + } /* Set up BB */ - IRBB* bb = emptyIRBB(); + bb = emptyIRBB(); bb->tyenv = dopyIRTypeEnv(bb_in->tyenv); bb->next = dopyIRExpr(bb_in->next); bb->jumpkind = bb_in->jumpkind; diff --git a/none/nl_main.c b/none/nl_main.c index c2fcb584f..2f136c2c6 100644 --- a/none/nl_main.c +++ b/none/nl_main.c @@ -46,7 +46,8 @@ void TL_(post_clo_init)(void) { } -IRBB* TL_(instrument)(IRBB* bb, VexGuestLayout* layout, IRType hWordTy) +IRBB* TL_(instrument)(IRBB* bb, VexGuestLayout* layout, + IRType gWordTy, IRType hWordTy) { return bb; }