Provides a custom function for unwinding stack frames that will be used in place of the default stack unwinder when invoking the static GetStack{Frames,Trace}{,WithContext}() functions above.

Synopsis

Declared in <absl/debugging/stacktrace.h>

extern
void
SetStackUnwinder(int(* unwinder)(void**, int*, int, int, void const*, int*));

Description

The arguments passed to the unwinder function will match the arguments passed to absl::GetStackFramesWithContext() except that sizes will be non‐null iff the caller is interested in frame sizes.

If unwinder is set to null, we revert to the default stack‐tracing behavior.

* WARNING *

absl::SetStackUnwinder is not suitable for general purpose use. It is provided for custom runtimes. Some things to watch out for when calling absl::SetStackUnwinder():

(a) The unwinder may be called from within signal handlers and therefore must be async‐signal‐safe.

(b) Even after a custom stack unwinder has been unregistered, other threads may still be in the process of using that unwinder. Therefore do not clean up any state that may be needed by an old unwinder. *

Parameters

Name

Description

unwinder

Custom stack‐unwinding function to install, or null to revert to the default.

Created with MrDocs