#include <base/StackFrame.h>
|
enum | {
FLAG_SHOW_ADDRESS = 1 << 0,
FLAG_SHOW_MODULE = 1 << 1,
FLAG_INDENT = 1 << 2,
FLAG_COMPACT = 1 << 3,
FLAG_FULL_PATH = 1 << 4,
FLAG_USE_COLORS = 1 << 5,
FLAG_USE_COLORS_IF_ANSI_TERMINAL = 1 << 6,
FLAG_STRIP_NAMESPACE = 1 << 7,
FLAG_TRIM_SYSTEM = 1 << 8,
FLAG_DEFAULT = FLAG_COMPACT | FLAG_SHOW_ADDRESS | FLAG_SHOW_MODULE | FLAG_INDENT | FLAG_TRIM_SYSTEM | FLAG_USE_COLORS_IF_ANSI_TERMINAL
} |
|
◆ doesSupportStackTrace()
static constexpr bool StackFrame::doesSupportStackTrace |
( |
| ) |
|
|
inlinestaticconstexprnoexcept |
Returns true if stack trace is supported.
◆ dump()
static void StackFrame::dump |
( |
unsigned int |
skip = 1 , |
|
|
unsigned int |
levels = 32 |
|
) |
| |
|
static |
Dump stack.
- Parameters
-
levels | The maximum number of levels to dump. |
◆ find()
MemoryDiff StackFrame::find |
( |
const void * |
address | ) |
const |
|
noexcept |
Returns the index of the symbol address if found.
- Returns
- Returns -1 if not found.
◆ findLast()
MemoryDiff StackFrame::findLast |
( |
const void * |
address | ) |
const |
|
noexcept |
Returns the index of the last occurrence symbol address if found.
- Returns
- Returns -1 if not found.
◆ getCaller()
static void* StackFrame::getCaller |
( |
| ) |
|
|
staticnoexcept |
Returns the caller. Not available for all platforms.
◆ getErrorStream()
Returns the preferred output stream.
◆ getFrame()
const void* StackFrame::getFrame |
( |
MemorySize |
index | ) |
const |
|
inlinenoexcept |
◆ getHash() [1/2]
unsigned long StackFrame::getHash |
( |
| ) |
const |
|
inlinenoexcept |
Returns hash for stack trace.
◆ getHash() [2/2]
static unsigned long StackFrame::getHash |
( |
const ConstSpan< const void * > & |
stackTrace | ) |
|
|
staticnoexcept |
Returns hash for stack trace.
◆ getSize()
MemorySize StackFrame::getSize |
( |
| ) |
const |
|
inlinenoexcept |
Returns the number of stack frames.
◆ getStack() [1/2]
static unsigned int StackFrame::getStack |
( |
const void ** |
dest, |
|
|
unsigned int |
size, |
|
|
unsigned int |
skip = 1 , |
|
|
bool |
trim = true |
|
) |
| |
|
static |
◆ getStack() [2/2]
static StackFrame StackFrame::getStack |
( |
unsigned int |
skip = 1 , |
|
|
unsigned int |
levels = 32 , |
|
|
bool |
trim = true |
|
) |
| |
|
static |
Returns the stack.
- Parameters
-
skip | Skip the first frames. |
levels | The maximum number of levels to dump. |
trim | Trim to base address. |
◆ getStackFrame()
static void* StackFrame::getStackFrame |
( |
| ) |
|
|
staticnoexcept |
Returns the stack frame. Not available for all platforms.
◆ getTrace()
ConstSpan<const void*> StackFrame::getTrace |
( |
| ) |
const |
|
inlinenoexcept |
Returns the stack frames.
◆ getUseStandardOut()
static bool StackFrame::getUseStandardOut |
( |
| ) |
|
|
staticnoexcept |
Print stack trace to standard out instead of standard error.
◆ isEmpty()
bool StackFrame::isEmpty |
( |
| ) |
const |
|
inlinenoexcept |
Returns the number of stack frames.
◆ operator bool()
StackFrame::operator bool |
( |
| ) |
const |
|
inlinenoexcept |
Returns true if stack trace is empty.
◆ operator!=() [1/2]
bool StackFrame::operator!= |
( |
const ConstSpan< const void * > & |
compare | ) |
const |
|
inlinenoexcept |
Returns true if stack traces are non-equal.
◆ operator!=() [2/2]
bool StackFrame::operator!= |
( |
const StackFrame & |
compare | ) |
const |
|
inlinenoexcept |
Returns true if stack traces are non-equal.
◆ operator==() [1/2]
bool StackFrame::operator== |
( |
const ConstSpan< const void * > & |
compare | ) |
const |
|
inlinenoexcept |
Returns true if stack traces are equal.
◆ operator==() [2/2]
bool StackFrame::operator== |
( |
const StackFrame & |
compare | ) |
const |
|
inlinenoexcept |
Returns true if stack traces are equal.
◆ setUseStandardOut()
static void StackFrame::setUseStandardOut |
( |
bool |
useStandardOut | ) |
|
|
staticnoexcept |
Print stack trace to standard out instead of standard error.
◆ stripUntil() [1/2]
MemorySize StackFrame::stripUntil |
( |
const void * |
ip | ) |
|
|
noexcept |
Strips any frames before the first occurrence of the given address if present on the stack.
- Returns
- The number of frames skipped.
◆ stripUntil() [2/2]
void StackFrame::stripUntil |
( |
MemorySize |
index | ) |
|
|
noexcept |
Strips any frames before the given index.
◆ toStream()