Records program counter values of up to max_depth frames, skipping the most recent skip_count stack frames, and stores their corresponding values in pcs. (Note that the frame generated for this call itself is also skipped.) This function acts as a generic stack-unwinder; prefer usage of the more specific GetStack{Trace,Frames}{,WithContext}() functions above.
Declared in <absl/debugging/stacktrace.h>
extern
int
DefaultStackUnwinder(
void** pcs,
int* sizes,
int max_depth,
int skip_count,
void const* uc,
int* min_dropped_frames);
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.
Because this function is generic, only pcs is guaranteed to be non-null upon return. It is legal for sizes, uc, and min_dropped_frames to all be null when called.
The semantics are the same as the corresponding GetStack*() function in the case where absl::SetStackUnwinder() was never called. Equivalents are:
null sizes | non-nullptr sizes |==| null uc | GetStackTrace() | GetStackFrames() | non-null uc | GetStackTraceWithContext() | GetStackFramesWithContext() | |==|
The number of frames stored in pcs.
| Name | Description |
|---|---|
| pcs | Buffer to receive the recorded program counter values. |
| sizes | If non-null, receives the corresponding stack frame sizes. |
| max_depth | Maximum number of frames to record. |
| skip_count | Number of most recent stack frames to skip. |
| uc | Pointer to the signal handler's ucontext_t value, or null. |
| min_dropped_frames | If non-null, receives the number of stack frames dropped. |