diff options
author | Gregory LEOCADIE <gregory.leocadie@datadoghq.com> | 2022-12-08 12:02:43 +0100 |
---|---|---|
committer | Dave Watson <dade.watson@gmail.com> | 2023-01-11 08:56:12 -0800 |
commit | 3a79065d676b222338a4f679d51f9d8f991117d3 (patch) | |
tree | 10038fabfb69344b6fd62fa9df5f4ce141072fbb | |
parent | 8f54c55ea44f1906c23b5f01aea92b548b1e8839 (diff) | |
download | libunwind-3a79065d676b222338a4f679d51f9d8f991117d3.tar.gz |
Add documentation
-rw-r--r-- | doc/unw_backtrace.man | 17 | ||||
-rw-r--r-- | doc/unw_backtrace.tex | 5 |
2 files changed, 20 insertions, 2 deletions
diff --git a/doc/unw_backtrace.man b/doc/unw_backtrace.man index 4a441ffd..91a693ab 100644 --- a/doc/unw_backtrace.man +++ b/doc/unw_backtrace.man @@ -1,5 +1,7 @@ +.\" *********************************** start of \input{common.tex} +.\" *********************************** end of \input{common.tex} '\" t -.\" Manual page created with latex2man on Sun Aug 29 23:45:06 CEST 2021 +.\" Manual page created with latex2man on Thu Dec 8 12:01:30 2022 .\" NOTE: This file is generated, DO NOT EDIT. .de Vb .ft CW @@ -10,7 +12,7 @@ .fi .. -.TH "UNW\\_BACKTRACE" "3" "29 August 2021" "Programming Library " "Programming Library " +.TH "UNW\\_BACKTRACE" "3" "08 December 2022" "Programming Library " "Programming Library " .SH NAME unw_backtrace \-\- return backtrace for the calling program @@ -25,6 +27,11 @@ int unw_backtrace(void **buffer, int size); .br +int +unw_backtrace2(void **buffer, +int size, +unw_context_t *ctxt); +.br .PP #include <execinfo.h> .br @@ -61,6 +68,12 @@ is linked against libunwind, it may end up calling unw_backtrace(). .PP +If the unw_context_t +is known to be a signal frame (i.e., from the third argument +in a sigaction handler on linux), unw_backtrace2 +can be used to collect +only the frames before the signal frame. +.PP .SH RETURN VALUE .PP diff --git a/doc/unw_backtrace.tex b/doc/unw_backtrace.tex index 362a56f2..205aaea4 100644 --- a/doc/unw_backtrace.tex +++ b/doc/unw_backtrace.tex @@ -13,6 +13,7 @@ \File{\#include $<$libunwind.h$>$}\\ \Type{int} \Func{unw\_backtrace}(\Type{void~**}\Var{buffer}, \Type{int}~\Var{size});\\ +\Type{int} \Func{unw\_backtrace2}(\Type{void~**}\Var{buffer}, \Type{int}~\Var{size}, \Type{unw_context_t~*}\Var{ctxt});\\ \File{\#include $<$execinfo.h$>$}\\ @@ -32,6 +33,10 @@ aliases \Func{backtrace}() to \Func{unw\_backtrace}(), so when a program calling \Func{backtrace}() is linked against \Prog{libunwind}, it may end up calling \Func{unw\_backtrace}(). +If the \Type{unw\_context_t} is known to be a signal frame (i.e., from the third argument +in a sigaction handler on linux), \Func{unw\_backtrace2} can be used to collect +only the frames before the signal frame. + \section{Return Value} The routine returns the number of addresses stored in the array pointed by |