|
From: Huanghao (A. SingleAS) <ale...@hu...> - 2014-04-28 11:57:32
|
Hi Valarind team,
I have one question to your team, you may help me a lot.
I want to get the stored value that Store IR stores in the Store IR's help function.
And I write code as following in blue:
static
IRSB* xxx_instrument ( VgCallbackClosure* closure,
IRSB* sbIn,
VexGuestLayout* layout,
VexGuestExtents* vge,
IRType gWordTy, IRType hWordTy )
{
...
case Ist_Store: {
IRExpr* data = st->Ist.Store.data;
IRExpr* aexpr = st->Ist.Store.addr;
addMemEvent( sbOut,
aexpr, data, goff_sp );
break;
}
...
}
static
void addMemEvent(IRSB* sbOut, IRExpr* addr, IRExpr* data,
Int goff_sp)
{
...
hName = "xxx_handle_write";
hAddr = &xxx_handle_write;
argv = mkIRExprVec_2( addr, data);
di = unsafeIRDirty_0_N( 2/*regparms*/,
hName, VG_(fnptr_to_fnentry)( hAddr ),
argv );
addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
...
}
static VG_REGPARM(2)
void xxx_handle_write ( Addr addr, ULong data )
{
...
}
But I get failure when I execute it.
vex: priv/host_amd64_isel.c:627 (doHelperCall): Assertion `typeOfIRExpr(env->type_env, args[i]) == Ity_I64' failed.
vex storage: T total 734792 bytes allocated
vex storage: P total 640 bytes allocated
valgrind: the 'impossible' happened:
LibVEX called failure_exit().
==19901== at 0x3808AD7F: report_and_quit (m_libcassert.c:260)
==19901== by 0x3808ADE9: panic (m_libcassert.c:350)
==19901== by 0x3808AE38: vgPlain_core_panic_at (m_libcassert.c:355)
==19901== by 0x3808AE4A: vgPlain_core_panic (m_libcassert.c:360)
==19901== by 0x38016762: failure_exit (m_translate.c:731)
==19901== by 0x380B8408: vex_assert_fail (main_util.c:219)
==19901== by 0x382715D3: doHelperCall (host_amd64_isel.c:627)
==19901== by 0x38276B96: iselSB_AMD64 (host_amd64_isel.c:4457)
==19901== by 0x380B693F: LibVEX_Translate (main_main.c:823)
==19901== by 0x3801435E: vgPlain_translate (m_translate.c:1602)
==19901== by 0x380478ED: handle_chain_me (scheduler.c:1032)
==19901== by 0x38049445: vgPlain_scheduler (scheduler.c:1330)
==19901== by 0x38074477: run_a_thread_NORETURN (syswrap-linux.c:103)
Cound you please help me that how to make the functionality to be available?
Thanks in advance!
Best Regards
Alex
|