i am struggling On finding a function with prototype mul(float,float)
i try to use RTN_FindByName
but the output is still empty.
VOID Arg1Before(CHAR * name, ADDRINT size)
{
TraceFile << name << "(" << size << ")" << endl;
}
VOID MulAfter(ADDRINT ret)
{
TraceFile << " returns " << ret << endl;
}
VOID Image(IMG img, VOID *v)
{
// Instrument the mul() and div() functions. Print the input argument
// of each mul() or div(), and the return value of mul().
//
// Find the mul() function.
RTN mulRtn = RTN_FindByName(img, MUL);
if (RTN_Valid(mulRtn))
{
RTN_Open(mulRtn);
// Instrument mul() to print the input argument value and the return value.
RTN_InsertCall(mulRtn, IPOINT_BEFORE, (AFUNPTR)Arg1Before,
IARG_ADDRINT, MUL,
IARG_FUNCARG_ENTRYPOINT_VALUE, 0,
IARG_END);
RTN_InsertCall(mulRtn, IPOINT_AFTER, (AFUNPTR)MulAfter,
IARG_FUNCRET_EXITPOINT_VALUE, IARG_END);
RTN_Close(mulRtn);
}
}
There, MUL
is a constant which is "mul". Obviously, i have included pin.H. the problem is that my traceFile is still empty