[#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&lcub;Frames,Trace&rcub;&lcub;,WithContext&rcub;() functions above&period;

== Synopsis

Declared in `&lt;absl&sol;debugging&sol;stacktrace&period;h&gt;`

[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&colon;&colon;GetStackFramesWithContext()` except that sizes will be non&hyphen;null iff the caller is interested in frame sizes&period;

If unwinder is set to null, we revert to the default stack&hyphen;tracing behavior&period;

&ast; WARNING &ast;

absl&colon;&colon;SetStackUnwinder is not suitable for general purpose use&period; It is provided for custom runtimes&period; Some things to watch out for when calling `absl&colon;&colon;SetStackUnwinder()`&colon;

(a) The unwinder may be called from within signal handlers and therefore must be async&hyphen;signal&hyphen;safe&period;

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *unwinder*
| Custom stack&hyphen;unwinding function to install, or null to revert to the default&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
