|
From: Julian S. <js...@ac...> - 2011-11-14 07:56:40
|
> Process the return address is obtained is good, but I do not know how to
> change that VEX would after I took over control of the handler to another
> location. Originally I wanted to make the transition to a value which is
> returned to my handler, but stumbled on the fact that the value returned
> by Dirty handler is I1 type, not I64.
>
> How can I generate code that assigns the I64 value? Or is there another way
> to get the same result?
>
> p.s. Sorry, English is not native language for me
> Sergey
>
> --- code ----
> ret_addr = newIRTemp(sbOut->tyenv,Ity_I64);
>
> di = unsafeIRDirty_1_N( ret_addr, 0, "ret_hook",
> VG_(fnptr_to_fnentry)( & ret_hook ),
> mkIRExprVec_2(
> getExprFromAddr(last_Mark->Ist.IMark.addr, hWordTy), sbIn->next) );
> addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
>
> sbOut->next = IRExpr_RdTmp(ret_addr);
> --- end code ----
>
> --- generated VEX code ----
>
> t84 = DIRTY 1:I1 ::: ret_hook{0x38000370}(0x400AEFE:I64,t27)
> goto {Return} t84
I think you have misinterpreted the printout. AFAICS the code you have
here is correct. t84 holds the return value, and I assume this is created
with
> ret_addr = newIRTemp(sbOut->tyenv,Ity_I64);
so it is a 64 bit value. The "1:I1" in the printout is unrelated to
the return type. Dirty helper calls can be conditional, and this is
the condition (a constant 1, of type I1), which just means this call
is unconditional.
J
|