[#absl-SetStackUnwinder] = xref:absl.adoc[absl]::SetStackUnwinder :relfileprefix: ../ :mrdocs: 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>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- 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 [cols="1,4"] |=== | Name| Description | *unwinder* | Custom stack‐unwinding function to install, or null to revert to the default. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#