/*--- 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;
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;
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;
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);
{
}
-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;
}
## 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)().
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;
/*--- 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;
}
}
-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;
{
}
-IRBB* TL_(instrument)(IRBB* bb, VexGuestLayout* layout, IRType hWordTy)
+IRBB* TL_(instrument)(IRBB* bb, VexGuestLayout* layout,
+ IRType gWordTy, IRType hWordTy)
{
return bb;
}