LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
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 60 of file DebugUtils.h.
|
private |
Definition at line 62 of file DebugUtils.h.
|
inline |
Definition at line 65 of file DebugUtils.h.
References ParseString().
|
inline |
Definition at line 66 of file DebugUtils.h.
References ParseString().
|
inlineprivate |
Runs the demangler and stores the result.
Definition at line 108 of file DebugUtils.h.
References setAll().
Referenced by ParseString(), and setAll().
|
inlinestaticprivate |
Returns whether the range is empty or invalid.
Definition at line 99 of file DebugUtils.h.
Referenced by extract(), and setAll().
|
inlinestaticprivate |
Translates a range into a string.
Definition at line 102 of file DebugUtils.h.
References emptyRange().
Referenced by setAll().
|
inline |
Returns the function name (mangled if nothing better).
Definition at line 77 of file DebugUtils.h.
References functionName, and mangledFunctionName.
Referenced by lar::debug::CallInfoPrinter::print().
|
inline |
Returns whether there is some information parsed.
Definition at line 69 of file DebugUtils.h.
References libraryName, and mangledFunctionName.
|
inline |
Returns whether no information was parsed out of the original.
Definition at line 71 of file DebugUtils.h.
References libraryName, mangledFunctionName, and ParseString().
bool lar::debug::CallInfo_t::ParseString | ( | std::string const & | s | ) |
Returns whether the translation was complete (offset is optional!).
Definition at line 10 of file DebugUtils.cxx.
References address, demangleFunction(), functionName, libraryName, mangledFunctionName, n, offset, original, and setAll().
Referenced by CallInfo_t(), and operator!().
|
private |
Fills the information from an original string and parsed ranges.
Definition at line 113 of file DebugUtils.cxx.
References address, demangleFunction(), emptyRange(), extract(), if(), libraryName, mangledFunctionName, offset, and original.
Referenced by demangleFunction(), and ParseString().
|
inline |
Returns only the library name (with suffix).
Definition at line 83 of file DebugUtils.h.
References libraryName.
Referenced by lar::debug::CallInfoPrinter::print().
void* lar::debug::CallInfo_t::address = nullptr |
Function address.
Definition at line 94 of file DebugUtils.h.
Referenced by ParseString(), lar::debug::CallInfoPrinter::print(), and setAll().
std::string lar::debug::CallInfo_t::functionName |
Parsed function name, demangled.
Definition at line 92 of file DebugUtils.h.
Referenced by function(), and ParseString().
std::string lar::debug::CallInfo_t::libraryName |
Parsed library name.
Definition at line 91 of file DebugUtils.h.
Referenced by operator bool(), operator!(), ParseString(), lar::debug::CallInfoPrinter::print(), setAll(), and shortLibrary().
std::string lar::debug::CallInfo_t::mangledFunctionName |
Parsed function name, unprocessed.
Definition at line 93 of file DebugUtils.h.
Referenced by function(), operator bool(), operator!(), ParseString(), lar::debug::CallInfoPrinter::print(), and setAll().
std::ptrdiff_t lar::debug::CallInfo_t::offset = 0 |
Instruction pointer offset.
Definition at line 95 of file DebugUtils.h.
Referenced by ParseString(), lar::debug::CallInfoPrinter::print(), and setAll().
std::string lar::debug::CallInfo_t::original |
String from the backtrace, unparsed.
Definition at line 90 of file DebugUtils.h.
Referenced by ParseString(), lar::debug::CallInfoPrinter::print(), and setAll().