Pin
|
Functions | |
void | LEVEL_PINCLIENT::PIN_GetSourceLocation (ADDRINT address, INT32 *column, INT32 *line, std::string *fileName) |
Access the debug information contained in an elf binary.
void LEVEL_PINCLIENT::PIN_GetSourceLocation | ( | ADDRINT | address, |
INT32 * | column, | ||
INT32 * | line, | ||
std::string * | fileName | ||
) |
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 dwarf2 information, which is the default for most modern compilers. Use -gdwarf-2 if you are using gcc 2.96.
macOS*: Compile your program with -g to include line number information. On macOS*, Pin currently understands the default debugging info (stab) generated by gcc. Support for dwarf2 will be added later. With stab, the column number is not available. So, we simply return 0 as the column number. Once we support dwarf2, we would have the column number as well.
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.
[in] | address | The code address to lookup. |
[out] | column | If column is non-zero, *column is set to the column number. Column number 0 indicates that there is no valid column information. |
[out] | line | If line is non-zero, *line is set to the line number. Line number 0 indicates that there is no valid line information. |
[out] | fileName | If 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 |