PStack
2.0
Stack trace printer for MSVC and GCC binaries
|
Provide an facility (using DbgHelp) for reading and mapping debugger symbols. More...
#include <dbghelp_symbol_engine.hpp>
Construction / Destruction | |
dbghelp_symbol_engine (HANDLE h_process) | |
Construct an instance of the symbol engine. More... | |
~dbghelp_symbol_engine () | |
Free previously allocated resources for debug symbol usage. More... | |
Public Interface | |
std::unique_ptr< symbol > | find_symbol (address_t address) |
Create a psystem::symbol instance for a symbol at the provided memory address. More... | |
Member Data | |
HANDLE const | m_process_handle |
An open handle to the process used to gather symbol information. | |
Additional Inherited Members | |
Protected Member Functions inherited from psystem::not_copyable | |
not_copyable (not_copyable const &)=delete | |
Delete the copy constructor. | |
not_copyable & | operator= (not_copyable const &)=delete |
Delete the assignment operator. | |
constexpr | not_copyable () noexcept |
A simple CTOR suitable for noexcept and constexpr uses. | |
~not_copyable () noexcept | |
A simple CTOR suitable for noexcept uses. | |
Provide an facility (using DbgHelp) for reading and mapping debugger symbols.
The DbgHelp library is a Windows-specific library for reading debugging symbols, mapping them to addresses, and even gathering source code locations where available. This interface encapsulates the library for use with the rest of the PSystem modules.
A governing philosophy of symbol engines in psystem is that they do not maintain any stateful information for the symbols themselves, they only provide a consistent facade for one or more symbol APIs.
|
explicit |
Construct an instance of the symbol engine.
[in] | h_process | An open handle to the process for which symbols should be loaded. |
psystem::exception::system_exception | If there was an error initializing the DbgHelp symbol server with the given process handle. |
psystem::dbghelp_symbol_engine::~dbghelp_symbol_engine | ( | ) |
Free previously allocated resources for debug symbol usage.
Create a psystem::symbol instance for a symbol at the provided memory address.
This is a factory method. After calling this method, ownership is transferred directly to the caller. Invoking this multiple times with the same address results in multiple symbol instances. It is not idempotent.
[in] | address | The address to match to a debugger symbol. |
std::unique_ptr
to a new instance of psystem::symbol with the information. If not, this method returns nullptr
. psystem::exception::system_exception | If there was a system error accessing the symbol from DbgHelp. |