StackFrame
Description
A single captured stack frame. Just the IP — symbol resolution happens later in FormatStackTrace.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Backtrace.c:10:
// Named helpers so we can verify a specific symbol shows up in the
// captured trace.
static __attribute__((noinline)) size bt_capture_with_helper(StackFrame *frames, size max) {
return CaptureStackTrace(frames, max, 0);
}- In
Backtrace.c:14:
}
static __attribute__((noinline)) size bt_capture_outer(StackFrame *frames, size max) {
return bt_capture_with_helper(frames, max);
}- In
Backtrace.c:19:
bool test_backtrace_capture_non_empty(void) {
StackFrame frames[32];
size n = bt_capture_outer(frames, 32);
return n >= 2 && n <= 32; // at least helper + outer
- In
Backtrace.c:28:
Allocator *alloc_base = ALLOCATOR_OF(&alloc);
StackFrame frames[32];
size n = bt_capture_outer(frames, 32);- In
Backtrace.c:56:
}
StackFrame frames[16];
size n = bt_capture_outer(frames, 16);- In
Backtrace.c:60:
}
size CaptureStackTrace(StackFrame *out, size max_frames, size skip_frames) {
if (!out || max_frames == 0)
return 0;- In
Backtrace.c:79:
}
void FormatStackTrace(Str *out, const StackFrame *frames, size count, Allocator *alloc) {
(void)alloc;
if (!out || !frames)- In
Backtrace.c:129:
};
size CaptureStackTrace(StackFrame *out, size max_frames, size skip_frames) {
if (!out || max_frames == 0) {
return 0;- In
Backtrace.c:196:
}
void FormatStackTraceWith(Str *out, const StackFrame *frames, size count, SymbolResolver *resolver) {
if (!out || !frames || !resolver)
return;- In
Backtrace.c:209:
}
void FormatStackTrace(Str *out, const StackFrame *frames, size count, Allocator *alloc) {
if (!out || !frames || !alloc)
return;- In
Debug.c:31:
u32 free_trace_n;
bool freed;
StackFrame alloc_trace[DEBUG_ALLOCATOR_MAX_TRACE];
StackFrame free_trace[DEBUG_ALLOCATOR_MAX_TRACE];
} DebugRecord;- In
Debug.c:32:
bool freed;
StackFrame alloc_trace[DEBUG_ALLOCATOR_MAX_TRACE];
StackFrame free_trace[DEBUG_ALLOCATOR_MAX_TRACE];
} DebugRecord;- In
Debug.c:154:
}
static void debug_emit_trace(const StackFrame *frames, size count, const char *label, Allocator *meta) {
if (!count) {
LOG_ERROR(" {} trace: (none captured)", label);- In
Backtrace.h:43:
typedef struct StackFrame {
void *ip;
} StackFrame;
///
- In
Backtrace.h:61:
/// TAGS: Sys, Backtrace, Unwind
///
size CaptureStackTrace(StackFrame *out, size max_frames, size skip_frames);
///
- In
Backtrace.h:80:
/// TAGS: Sys, Backtrace, Format
///
void FormatStackTrace(Str *out, const StackFrame *frames, size count, Allocator *alloc);
#if MISRA_HAVE_SYS_SYMRESOLVE- In
Backtrace.h:100:
/// TAGS: Sys, Backtrace, Format
///
void FormatStackTraceWith(Str *out, const StackFrame *frames, size count, SymbolResolver *resolver);
#endif
Last updated on