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

Records program counter values obtained from a signal handler&period; 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 the frame generated for the `absl&colon;&colon;GetStackFramesWithContext()` routine itself is also skipped&period;)

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
extern
int
GetStackTraceWithContext(
    void** result,
    int max&lowbar;depth,
    int skip&lowbar;count,
    void const* uc,
    int* min&lowbar;dropped&lowbar;frames);
----

== Description

The `uc` parameter, if non&hyphen;null, should be a pointer to a `ucontext&lowbar;t` value passed to a signal handler registered via the `sa&lowbar;sigaction` field of a `sigaction` struct&period; (See http&colon;&sol;&sol;man7&period;org&sol;linux&sol;man&hyphen;pages&sol;man2&sol;sigaction&period;2&period;html&period;) The `uc` value may help a stack unwinder to provide a better stack trace under certain conditions&period; `uc` may safely be null&period;

The `min&lowbar;dropped&lowbar;frames` output parameter, if non&hyphen;null, points to the location to note any dropped stack frames, if any, due to buffer limitations or other reasons&period; (This value will be set to `0` if no frames were dropped&period;) The number of total stack frames is guaranteed to be &gt;&equals; skip&lowbar;count &plus; max&lowbar;depth &plus; &ast;min&lowbar;dropped&lowbar;frames&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;
| *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]#
