PStack  2.0
Stack trace printer for MSVC and GCC binaries
anonymous_namespace{addr2ln_options.cpp} Namespace Reference

Data local to this compilation unit. More...

Functions

static psystem::address_t fetch_address (char const *text)
 Translate a string into an address. More...
 

Variables

addr2ln::addr2ln_optionsg_options = nullptr
 The options block is supposed to be a singleton. More...
 

Detailed Description

Data local to this compilation unit.

Function Documentation

static psystem::address_t anonymous_namespace{addr2ln_options.cpp}::fetch_address ( char const *  text)
static

Translate a string into an address.

This method assumes that the string is a hexadecimal number.

Parameters
[in]textThe string of text to translate.
Returns
The numerical address specified by text.
Exceptions
psystem::exception::ui_exceptionIf text input does not consist entirely of text that can be converted to a psystem::address_t data type. The resulting value must also be a positive integer that is less than ULONG_MAX.
Todo:
The conversion routine does not necessarily map to a full-width pointer, but whatever size integer strtoul returns.

Variable Documentation

addr2ln::addr2ln_options* anonymous_namespace{addr2ln_options.cpp}::g_options = nullptr

The options block is supposed to be a singleton.

As much as I hate singletons, I don't really want to be passing options all over the system just to occasionally get a parameter. Also, this is a C pointer instead of a shared_ptr for two reasons: first, the instance should be created by main, so we have no access to the container for that instance, and secondly because I want this static data to be trivially constructed in the compilation unit.