AUI Framework
master
Cross-platform module-based framework for developing C++20 desktop applications
|
Stacktrace consisting of a collection of stack function frames. More...
Stacktrace consisting of a collection of stack function frames.
The first element of the collection represents the top of the stack, which is the last function invocation. Typically, this is the point at which this stacktrace was created (unless skipFrames is zero). The last element of the collection represents the bottom of the stack (typically entrypoint).
Classes | |
class | Entry |
Stacktrace entry. More... | |
Public Types | |
using | iterator = AVector< Entry >::iterator |
Public Member Functions | |
AStacktrace (aui::range< iterator > range) | |
aui::range< iterator > | stripBeforeFunctionCall (void *pFunction, int maxAllowedOffsetInBytes=50) |
Tries to find the function pointer in stacktrace and strips stacktrace until function frame. More... | |
AStacktrace (const AStacktrace &)=default | |
AStacktrace (AStacktrace &&) noexcept=default | |
void | resolveSymbolsIfNeeded () const noexcept |
Invokes function name resolution with function pointers. More... | |
const AVector< Entry > & | entries () const noexcept |
auto | begin () const noexcept |
auto | end () const noexcept |
auto | rbegin () const noexcept |
auto | rend () const noexcept |
Static Public Member Functions | |
static AStacktrace | capture (unsigned skipFrames=0, unsigned maxFrames=128) noexcept |
Creates stacktrace of the current thread. More... | |
|
staticnoexcept |
Creates stacktrace of the current thread.
skipFrames | number of frames to skip. |
maxFrames | max number of frames. |
AStacktrace::capture
is always skipped in the stacktrace.
|
noexcept |
Invokes function name resolution with function pointers.
Must be called before using AStacktrace::Entry::functionName() and similar functions.
aui::range< AStacktrace::iterator > AStacktrace::stripBeforeFunctionCall | ( | void * | pFunction, |
int | maxAllowedOffsetInBytes = 50 |
||
) |
Tries to find the function pointer in stacktrace and strips stacktrace until function frame.
pFunction | pointer to function. |
maxAllowedOffsetInBytes | max offset error in bytes. |
If stripBeforeFunctionCall fails to find pFunction, it leaves AStacktrace unmodified and returns itself.
stripBeforeFunctionCall strips the end of stacktrace, excluding the passed function.
maxAllowedOffsetInBytes is intended to find stack frame, which is not in exact location of function pointer.
#include <AUI/Platform/AStacktrace.h>