PStack  2.0
Stack trace printer for MSVC and GCC binaries
psystem::symbol Class Reference

A container for data about a single debugger symbol. More...

#include <symbol.hpp>

Construction / Destruction

 symbol (address_t address, address_t code_offset, tstring const &name) noexcept
 Construct an instance of the psystem::symbol. More...
 

Public Interface

address_t get_address () const noexcept
 Access the memory location of the symbol. More...
 
address_t get_code_offset () const noexcept
 Access the code offset from the PC to the symbol start. More...
 
tstring get_name () const noexcept
 The symbol name. More...
 

Member Data

address_t m_address
 The memory location of the symbol.
 
address_t m_code_offset
 The distance from the function entry point of the PC (in the current frame context). More...
 
tstring m_name
 The symbol's (possibly mangled) name.
 

Detailed Description

A container for data about a single debugger symbol.

Debugger symbols have an address and hopefully a name. After this, depending on type (e.g., function, variable), they may have a source file and line location, a runtime value, and so on.

Author
Matt Bisson
Date
5 August, 2014
Since
PSystem 2.0
Version
PSystem 2.0
Todo:

There should be a function_symbol as well as a plain symbol.

Rename to symbol_info...

Constructor & Destructor Documentation

psystem::symbol::symbol ( address_t  address,
address_t  code_offset,
tstring const &  name 
)
noexcept

Construct an instance of the psystem::symbol.

Parameters
[in]addressThe memory location of the debugging symbol.
[in]code_offsetThe distance from the function entry point of the current PC (in the current frame context).
[in]nameThe (possibly mangled) symbol name.

Member Function Documentation

address_t psystem::symbol::get_address ( ) const
noexcept

Access the memory location of the symbol.

Returns
The address exists in the process space of the debuggee.
address_t psystem::symbol::get_code_offset ( ) const
noexcept

Access the code offset from the PC to the symbol start.

Returns
The distance from the function entry point of the PC (in the current frame context). nullptr is a valid value.
psystem::tstring psystem::symbol::get_name ( ) const
noexcept

The symbol name.

Returns
The symbol name may be empty, and it is likely (if it's a C++ symbol) to be mangled by the compiler.

Member Data Documentation

address_t psystem::symbol::m_code_offset
private

The distance from the function entry point of the PC (in the current frame context).

Todo:
Move this to a function-specific class.

The documentation for this class was generated from the following files: