Iteration idioms:
// Forward pass over all routines in a section for( RTN rtn= SEC_RtnHead(sec); RTN_Valid(rtn); rtn = RTN_Next(rtn) ) // Reverse pass over all routines in a section for( RTN rtn= SEC_RtnTail(sec); RTN_Valid(rtn); rtn = RTN_Prev(rtn) )
|
Call back function used to instrument routines |
|
Add a function used to instrument at routine granularity
|
|
|
|
|
|
|
|
Close the given rtn. This must be called before opening a new rtn.
|
|
|
|
|
|
Return the name of a function. If more than one name is associated with this address, the first name found is returned.
|
|
an rtn to a funptr
|
|
Insert call relative to a rtn.
|
|
You must call RTN_Open() before the first time this is called for an rtn
|
|
|
|
Return TRUE if the given RTN is a candidate for probed function replacement, and FALSE otherwise. This API should be called before attempting to replace a function using RTN_ReplaceSignatureProbed() or RTN_ReplaceProbed(). Note that this routine does guarantee it is safe to place a probe, it merely indicates that certain conditions are not present.
|
|
|
|
|
|
|
|
Open the given rtn. This must be called before RTN_InsHead() or RTN_InsertCall().
|
|
|
|
Please use RTN_ReplaceSignature() for IA-32 and Intel(R) 64 architectures. Replace a routine in the application (replacedRtn) by another function defined in the Pintool (replacementFun). The replacement function is not instrumented. The signature of the replacement function must be the same as the replaced application routine. Replacement functions typically need to call the replaced routines, therefore this routine returns the address of the original function.
|
|
Replace a routine in the application (replacedRtn) by another function defined in the Pintool (replacementFun) using probes. The replacement function is not instrumented. The signature of the replacement function must be the same as the replaced application routine. Replacement functions typically need to call the replaced routines. However, calls to RTN_Funptr(replacedRtn) will be redirected to replacementFun. Replacement functions must instead call the returned function pointer, which is a copy of the entry point that is not redirected.
Use RTN_IsSafeForProbedReplacement() to determine if a function is a suitable candidate for probed function replacement.
|
|
Replace a routine in the application (replacedRtn) by another function defined in the Pintool (replacementFun). The replacement function is not instrumented. The signature of the replacement function can be different than the replaced application routine's signature. For instance, the context could be passed as an argument into the replacement functions. Replacement functions typically need to call the replaced routines, therefore this routine returns the address of the original function address.
Some restrictions apply using IARG_CONTEXT. See Instrumentation arguments for more information.
|
|
Replace a routine in the application (orgRtn) by another function defined in the Pintool (replacementFunptr) using probes. The replacement function is not instrumented. Replacement functions typically need to call the replaced routines. However, calls to RTN_Funptr(orgRtn) will be redirected to replacementFunptr. Replacement functions must instead call the returned function pointer, which is a copy of the entry point that is not redirected. The replacement function signature does not have to be the same as the replaced function. In fact while the replaced function may have the CALLINGSTD_REGPARMS calling convention, the replacement function calling convention must not be PIN_FAST_ANALYSIS_CALL (i.e. the replaced function may have register parameters, the replacement function must not). The replacement function arguments must be passed to the replacement function using the Pin IARG_TYPEs, in the same way as RTN_InsertCall(). A prototype of the routine in the application must also be passed in as an argument. See PROTO_Allocate for more information.
Use RTN_IsSafeForProbedReplacement() to determine if a function is a suitable candidate for probed function replacement. Some restrictions apply when using IARG_CONTEXT. See Instrumentation arguments for more information.
|
|
|
|
|
|
|
|
|