28class API_AUI_CORE AStacktrace {
34 friend class AStacktrace;
42 explicit Entry(
void* ptr) : mPtr(ptr), mFunctionName(std::nullopt) {}
65 void* ptr() const noexcept {
70 using iterator = AVector<Entry>::iterator;
72 AStacktrace(aui::range<iterator> range): mEntries(range.begin(), range.end()) {}
86 aui::range<iterator> stripBeforeFunctionCall(
void* pFunction,
int maxAllowedOffsetInBytes = 50);
88 AStacktrace(
const AStacktrace&) =
default;
89 AStacktrace(AStacktrace&&) noexcept = default;
96 void resolveSymbolsIfNeeded() const noexcept;
99 const AVector<Entry>& entries() const noexcept {
104 auto begin() const noexcept {
105 return mEntries.begin();
109 auto end() const noexcept {
110 return mEntries.end();
114 auto rbegin() const noexcept {
115 return mEntries.rbegin();
119 auto rend() const noexcept {
120 return mEntries.rend();
130 static AStacktrace capture(
unsigned skipFrames = 0,
unsigned maxFrames = 128) noexcept;
133 mutable AVector<Entry> mEntries;
134 mutable
bool mSymbolNamesResolved = false;
136 explicit AStacktrace(AVector<Entry> entries) : mEntries(std::move(entries)) {}
const AOptional< AString > & fileName() const noexcept
Definition AStacktrace.h:54
const AOptional< AString > & functionName() const noexcept
Definition AStacktrace.h:47
AOptional< unsigned > lineNumber() const noexcept
Definition AStacktrace.h:61