FormatStackTraceWith
Description
Same as FormatStackTrace but reuses a caller-owned resolver. Two shapes:
FormatStackTraceWith(out_str, frames, count, resolver) – raw FormatStackTraceWith(out_str, frames_vec, resolver) – vec
Success
Returns to the caller; *out_str has been appended with one line per frame using resolver for symbol lookup, falling back to #N 0x<ip> when the resolver cannot name the frame.
Failure
Function cannot fail. Allocator OOM while growing *out_str aborts via LOG_FATAL.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Backtrace.c:108:
Str out = StrInit(alloc_base);
FormatStackTraceWith(&out, frames, n, &res);
// Should also contain the helper name through the shared resolver.
- In
Backtrace.c:148:
Str rendered = StrInit(alloc_base);
FormatStackTraceWith(&rendered, frames, n, &res);
// The two named helpers must show up: the CFI walker successfully
Last updated on