[#absl-GetStackTrace] = xref:absl.adoc[absl]::GetStackTrace :relfileprefix: ../ :mrdocs: Records program counter values for up to `max_depth` frames, skipping the most recent `skip_count` stack frames, stores their corresponding values in `results`, and returns the number of frames stored. Note that this function is similar to `absl::GetStackFrames()` except that it returns the stack trace only, and not stack frame sizes. == Synopsis Declared in `<absl/debugging/stacktrace.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- extern int GetStackTrace( void** result, int max_depth, int skip_count); ---- == Description Example: main() { foo(); } foo() { bar(); } bar() { void* result[10]; int depth = absl::GetStackTrace(result, 10, 1); } This produces: result[0]foo result[1]main .... ... `result` must not be null. == Return Value The number of frames stored in `result`. == Parameters [cols="1,4"] |=== | Name| Description | *result* | Buffer to receive the recorded program counter values. | *max_depth* | Maximum number of frames to record. | *skip_count* | Number of most recent stack frames to skip. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#