Skip to content

Commit

Permalink
docs: Try to better explain unwind API (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem authored Jun 30, 2021
1 parent 959b81e commit 05db566
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions include/sentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,18 +469,25 @@ typedef struct sentry_ucontext_s {
*
* If the address is given in `addr` the stack is unwound form there.
* Otherwise (NULL is passed) the current instruction pointer is used as
* start address. The stack trace is written to `stacktrace_out` with up to
* `max_len` frames being written. The actual number of unwound stackframes
* is returned.
* start address.
* Unwinding with a given `addr` is not supported on all platforms.
*
* The stack trace in the form of instruction-addresses, is written to the
* caller allocated `stacktrace_out`, with up to `max_len` frames being written.
* The actual number of unwound stackframes is returned.
*/
SENTRY_EXPERIMENTAL_API size_t sentry_unwind_stack(
void *addr, void **stacktrace_out, size_t max_len);

/**
* Unwinds the stack from the given context.
*
* The stack trace is written to `stacktrace_out` with up to `max_len` frames
* being written. The actual number of unwound stackframes is returned.
* The caller is responsible to construct an appropriate `sentry_ucontext_t`.
* Unwinding from a user context is not supported on all platforms.
*
* The stack trace in the form of instruction-addresses, is written to the
* caller allocated `stacktrace_out`, with up to `max_len` frames being written.
* The actual number of unwound stackframes is returned.
*/
SENTRY_EXPERIMENTAL_API size_t sentry_unwind_stack_from_ucontext(
const sentry_ucontext_t *uctx, void **stacktrace_out, size_t max_len);
Expand Down

0 comments on commit 05db566

Please sign in to comment.