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

Records program counter values for up to `max&lowbar;depth` frames, skipping the most recent `skip&lowbar;count` stack frames, stores their corresponding values in `results`, and returns the number of frames stored&period; Note that this function is similar to `absl&colon;&colon;GetStackFrames()` except that it returns the stack trace only, and not stack frame sizes&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
extern
int
GetStackTrace(
    void** result,
    int max&lowbar;depth,
    int skip&lowbar;count);
----

== Description

Example&colon;

main() &lcub; foo()&semi; &rcub; foo() &lcub; bar()&semi; &rcub; bar() &lcub; void&ast; result&lsqb;10&rsqb;&semi; int depth &equals; absl&colon;&colon;GetStackTrace(result, 10, 1)&semi; &rcub;

This produces&colon;

result&lsqb;0&rsqb;foo result&lsqb;1&rsqb;main &period;&period;&period;&period; &period;&period;&period;

`result` must not be null&period;

== Return Value

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *result*
| Buffer to receive the recorded program counter values&period;
| *max&lowbar;depth*
| Maximum number of frames to record&period;
| *skip&lowbar;count*
| Number of most recent stack frames to skip&period;
|===


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