mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
Track Vex API change in rev 1062: pass both the guest and host word
sizes to the instrumentatation functions. Make most of the tools abort if they are not the same; we can't handle that case yet. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3397
This commit is contained in:
parent
f1a3994582
commit
cfdf00d9bd
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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)().
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user