Structure with information about a single call, parsed. More...
#include <DebugUtils.h>
Public Member Functions | |
CallInfo_t (std::string const &s) | |
CallInfo_t (const char *s) | |
operator bool () const | |
Returns whether there is some information parsed. More... | |
bool | operator! () const |
Returns whether no information was parsed out of the original. More... | |
bool | ParseString (std::string const &s) |
Returns whether the translation was complete (offset is optional!) More... | |
std::string const & | function () const |
Returns the function name (mangled if nothing better) More... | |
std::string | shortLibrary () const |
Returns only the library name (with suffix) More... | |
Public Attributes | |
std::string | original |
string from the backtrace, unparsed More... | |
std::string | libraryName |
parsed library name More... | |
std::string | functionName |
parsed function name, demangled More... | |
std::string | mangledFunctionName |
parsed function name, unprocessed More... | |
void * | address = nullptr |
function address More... | |
std::ptrdiff_t | offset = 0 |
instruction pointer offset More... | |
Private Types | |
using | range_t = std::pair< size_t, size_t > |
Private Member Functions | |
void | demangleFunction () |
Runs the demangler and stores the result. More... | |
void | setAll (std::string const &s, range_t addressStr, range_t libraryStr, range_t functionStr, range_t offsetStr) |
Fills the information from an original string and parsed ranges. More... | |
Static Private Member Functions | |
static bool | emptyRange (range_t const &r) |
Returns whether the range is empty or invalid. More... | |
static std::string | extract (std::string const &s, range_t const &r) |
Translates a range into a string. More... | |
Structure with information about a single call, parsed.
Definition at line 61 of file DebugUtils.h.
|
private |
Definition at line 63 of file DebugUtils.h.
|
inline |
Definition at line 66 of file DebugUtils.h.
|
inline |
Definition at line 67 of file DebugUtils.h.
|
inlineprivate |
Runs the demangler and stores the result.
Definition at line 109 of file DebugUtils.h.
|
inlinestaticprivate |
Translates a range into a string.
Definition at line 105 of file DebugUtils.h.
|
inline |
Returns the function name (mangled if nothing better)
Definition at line 80 of file DebugUtils.h.
|
inline |
Returns whether there is some information parsed.
Definition at line 70 of file DebugUtils.h.
|
inline |
Returns whether no information was parsed out of the original.
Definition at line 73 of file DebugUtils.h.
bool gar::debug::CallInfo_t::ParseString | ( | std::string const & | s | ) |
Returns whether the translation was complete (offset is optional!)
Definition at line 11 of file DebugUtils.cxx.
|
private |
Fills the information from an original string and parsed ranges.
Definition at line 121 of file DebugUtils.cxx.
|
inline |
Returns only the library name (with suffix)
Definition at line 84 of file DebugUtils.h.
void* gar::debug::CallInfo_t::address = nullptr |
function address
Definition at line 96 of file DebugUtils.h.
std::string gar::debug::CallInfo_t::functionName |
parsed function name, demangled
Definition at line 94 of file DebugUtils.h.
std::string gar::debug::CallInfo_t::libraryName |
parsed library name
Definition at line 93 of file DebugUtils.h.
std::string gar::debug::CallInfo_t::mangledFunctionName |
parsed function name, unprocessed
Definition at line 95 of file DebugUtils.h.
std::ptrdiff_t gar::debug::CallInfo_t::offset = 0 |
instruction pointer offset
Definition at line 97 of file DebugUtils.h.
std::string gar::debug::CallInfo_t::original |
string from the backtrace, unparsed
Definition at line 92 of file DebugUtils.h.