Pin
Functions
Pin Process API

Functions

NORETURN VOID LEVEL_PINCLIENT::PIN_ExitProcess (INT32 exitCode)
INT LEVEL_PINCLIENT::PIN_GetPid ()
NORETURN VOID LEVEL_PINCLIENT::PIN_ExitApplication (INT32 status)

Detailed Description

These APIs provide information about the instrumented process. They are available in any thread, including any internal thread spawned by the tool.


Function Documentation

NORETURN VOID LEVEL_PINCLIENT::PIN_ExitApplication ( INT32  status)

Terminate the current process after calling the relevant thread and process exit callbacks. This call behaves "as if" the application process itself had executed a process termination system call. It therefore does perform all the finalization actions Pin normally takes on application process exit, including calling registered thread and process fini-functions, unlike PIN_ExitProcess, which exits immediately.

This API may be called from an instrumentation callback function or an analysis routine. However, it should not be called from any FINI_CALLBACK or THREAD_FINI_CALLBACK routines. It may be called by an application thread or a tool internal thread (that was created via PIN_SpawnInternalThread).

Be aware, that when called from an internal thread, the calling thread will not exit until after the tool's fini callbacks return. Therefore, to avoid deadlock, your fini callbacks should not wait for that internal thread to exit.

Parameters:
[in]statusThe result argument to exit
Returns:
This function does not return.
Note:
The vm and pin client locks are obtained during the call of this API.
Availability:
Mode: JIT
O/S: Linux,Windows,BSD
CPU: All
NORETURN VOID LEVEL_PINCLIENT::PIN_ExitProcess ( INT32  exitCode)

Terminate the current process immediately, without calling any thread or process fini callbacks that may be registered. (See PIN_ExitApplication, if you want fini callbacks to be called).

This function should be used only for abnormal termination of the instrumented process. Normally, the process is terminated when Pin executes a process termination system call on behalf of the application.

Parameters:
[in]exitCodeexit code of the process to be reported to the operating system.
Returns:
the function never returns.
Availability:
Mode: JIT & Probe
O/S: Linux, Windows & OS X*
CPU: All
INT LEVEL_PINCLIENT::PIN_GetPid ( )

Returns current process id

Availability:
Mode: JIT & Probe
O/S: Linux, Windows & OS X*
CPU: All
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator