PStack
2.0
Stack trace printer for MSVC and GCC binaries
|
The main entry point for the Addr2Ln executable. More...
#include <cstring>
#include <psystem/framework/iomanip.hpp>
#include <psystem/framework/memory.hpp>
#include <addr2ln/addr2ln_options.hpp>
#include <psystem/dll_export_iterator.hpp>
#include <psystem/dll_export_view.hpp>
#include <psystem/image_symbol_iterator.hpp>
#include <psystem/symbol.hpp>
#include <psystem/symbol_file_module.hpp>
#include <psystem/symbol_view.hpp>
#include <psystem/exception/base_exception.hpp>
#include <psystem/exception/system_exception.hpp>
#include <psystem/exception/ui_exception.hpp>
Functions | |
static std::unique_ptr< psystem::symbol > | check_debug_symbols (psystem::symbol_view const *sym_view, psystem::address_t const *module_base, psystem::address_t const address) |
Look for a symbol in a module's debug information. More... | |
static std::unique_ptr< psystem::symbol > | check_dll_exports (psystem::dll_export_view const *exp_view, psystem::address_t const *module_base, psystem::address_t const address) |
Assuming a DLL, look for a symbol in the DLL exports table. More... | |
static void | dump_symbols (std::string const &file_name) |
Open an executable module and dump the list of symbols to stdout . More... | |
static std::unique_ptr< psystem::symbol > | find_symbol (std::string const &file_name, psystem::address_t const *module_base, psystem::address_t const address) |
Given an executable file, find the symbol that resides at the given address. More... | |
int | main (int argc, char const *argv[]) |
The main entry point for the Addr2Ln application. More... | |
The main entry point for the Addr2Ln executable.
|
static |
Look for a symbol in a module's debug information.
[in] | sym_view | The "view" instance to the debugging symbol information. This may be nullptr . If so, the function will interpret this as a no-op. |
[in] | module_base | (Optional) A pointer to the address that specifies the base-address for file_name if it were loaded (e.g., as a DLL). This may be nullptr if you wish to use the "default" base address, which is usually encoded in the module itself. |
[in] | address | The address to check for a symbol. |
nullptr
if none was found.psystem::exception::system_exception | If the file could not be opened, or if it is not a recognized file type. |
|
static |
Assuming a DLL, look for a symbol in the DLL exports table.
[in] | exp_view | The "view" instance any DLL export information. This may be nullptr . If so, the function will interpret this as a no-op. |
[in] | module_base | (Optional) A pointer to the address that specifies the base-address for file_name if it were loaded (e.g., as a DLL). This may be nullptr if you wish to use the "default" base address, which is usually encoded in the module itself. |
[in] | address | The address to check for a symbol. |
nullptr
if none was found.psystem::exception::system_exception | If the file could not be opened, or if it is not a recognized file type. |
|
static |
Open an executable module and dump the list of symbols to stdout
.
This is a debugging function. If the specified file does not point to a recognized file type, this method simply throws an exception. If it contains no symbols, the function succeeds, but does not print any output.
[in] | file_name | The file to open, examine, and dump contents. |
psystem::exception::system_exception | If the file could not be opened, or if it is not a recognized file type. |
|
static |
Given an executable file, find the symbol that resides at the given address.
This function checks both the debugging information and the DLL exports (if either are present).
As a side-effect of this method, the given file may be mapped into memory and un-mapped. The method caches nothing.
[in] | file_name | The file to open and examine. |
[in] | module_base | (Optional) A pointer to the address that specifies the base-address for file_name if it were loaded (e.g., as a DLL). This may be nullptr if you wish to use the "default" base address, which is usually encoded in the module itself. |
[in] | address | The address to check for a symbol. |
nullptr
if none was found.psystem::exception::system_exception | If the file could not be opened, or if it is not a recognized file type. |
int main | ( | int | argc, |
char const * | argv[] | ||
) |
The main entry point for the Addr2Ln application.
See addr2ln::addr2ln_options for details on supported command-line options.
[in] | argc | The count of command-line arguments. |
[in] | argv | The array of strings that specify command-line arguments. |