[#absl-DefaultStackUnwinder]
= xref:absl.adoc[absl]::DefaultStackUnwinder
:relfileprefix: ../
:mrdocs:

Records program counter values of up to `max&lowbar;depth` frames, skipping the most recent `skip&lowbar;count` stack frames, and stores their corresponding values in `pcs`&period; (Note that the frame generated for this call itself is also skipped&period;) This function acts as a generic stack&hyphen;unwinder&semi; prefer usage of the more specific `GetStack&lcub;Trace,Frames&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
int
DefaultStackUnwinder(
    void** pcs,
    int* sizes,
    int max&lowbar;depth,
    int skip&lowbar;count,
    void const* uc,
    int* min&lowbar;dropped&lowbar;frames);
----

== Description

If you have set your own stack unwinder (with the `SetStackUnwinder()` function above, you can still get the default stack unwinder by calling `DefaultStackUnwinder()`, which will ignore any previously set stack unwinder and use the default one instead&period;

Because this function is generic, only `pcs` is guaranteed to be non&hyphen;null upon return&period; It is legal for `sizes`, `uc`, and `min&lowbar;dropped&lowbar;frames` to all be null when called&period;

The semantics are the same as the corresponding `GetStack&ast;()` function in the case where `absl&colon;&colon;SetStackUnwinder()` was never called&period; Equivalents are&colon;

null sizes &verbar; non&hyphen;nullptr sizes &verbar;&equals;&equals;&verbar; null uc &verbar; GetStackTrace() &verbar; GetStackFrames() &verbar; non&hyphen;null uc &verbar; GetStackTraceWithContext() &verbar; GetStackFramesWithContext() &verbar; &verbar;&equals;&equals;&verbar;

== Return Value

The number of frames stored in `pcs`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pcs*
| Buffer to receive the recorded program counter values&period;
| *sizes*
| If non&hyphen;null, receives the corresponding stack frame sizes&period;
| *max&lowbar;depth*
| Maximum number of frames to record&period;
| *skip&lowbar;count*
| Number of most recent stack frames to skip&period;
| *uc*
| Pointer to the signal handler&apos;s `ucontext&lowbar;t` value, or null&period;
| *min&lowbar;dropped&lowbar;frames*
| If non&hyphen;null, receives the number of stack frames dropped&period;
|===


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