Pin
Functions
DBG: Debugging using Pin

Functions

void PIN_GetSourceLocation (ADDRINT address, INT32 *column, INT32 *line, std::string *fileName)
 

Detailed Description

Access the debug information contained in an elf binary.

Function Documentation

◆ PIN_GetSourceLocation()

void PIN_GetSourceLocation ( ADDRINT  address,
INT32 *  column,
INT32 *  line,
std::string *  fileName 
)

PIN support for debugging information

Find the line number, file, and column number corresponding to a memory address.

Linux: Compile your program with -g to include line number information. Pin can only read dwarf4 information. If you using compiler which generates more advanced format, please use -gdwarf-4 flag to generate dwarf4 debugging information.

macOS*: Compile your program with -g to include line number information. Pin can only read dwarf4 information. If you using compiler which generates more advanced format, please use -gdwarf-4 flag to generate dwarf4 debugging information.

Windows: Executable/dll has to have program data base (.pdb) file in order to support this API.

This function can be used in any thread, including any internal thread spawned by the tool.

Note
In analysis routines, Client Lock should be obtained before calling this function
Parameters
[in]addressThe code address to lookup.
[out]columnIf column is non-zero, *column is set to the column number. Column number 0 indicates that there is no valid column information.
[out]lineIf line is non-zero, *line is set to the line number. Line number 0 indicates that there is no valid line information.
[out]fileNameIf fileName is non-zero, *fileName is set to the file name. Empty string ("") indicates that there is no valid file name information. File names are encoded in UTF8 (a superset of ASCII), this is supported for Linux (only for locales encoded in UTF8) and Windows
Note
The pin client lock is obtained during the call of this API.
Availability:
Mode: JIT & Probe
O/S: Linux, Windows & macOS*
CPU: All