Tommi Rantala | 24a0c1f | 2012-08-31 13:39:38 +0300 | [diff] [blame] | 1 | \documentclass{article} |
| 2 | \usepackage[fancyhdr,pdf]{latex2man} |
| 3 | |
| 4 | \input{common.tex} |
| 5 | |
| 6 | \begin{document} |
| 7 | |
| 8 | \begin{Name}{3}{unw\_backtrace}{David Mosberger-Tang}{Programming Library}{unw\_backtrace}unw\_backtrace -- return backtrace for the calling program |
| 9 | \end{Name} |
| 10 | |
| 11 | \section{Synopsis} |
| 12 | |
| 13 | \File{\#include $<$libunwind.h$>$}\\ |
| 14 | |
| 15 | \Type{int} \Func{unw\_backtrace}(\Type{void~**}\Var{buffer}, \Type{int}~\Var{size});\\ |
| 16 | |
| 17 | \File{\#include $<$execinfo.h$>$}\\ |
| 18 | |
| 19 | \Type{int} \Func{backtrace}(\Type{void~**}\Var{buffer}, \Type{int}~\Var{size});\\ |
| 20 | |
| 21 | \section{Description} |
| 22 | |
| 23 | \Func{unw\_backtrace}() is a convenient routine for obtaining the backtrace for |
| 24 | the calling program. The routine fills up to \Var{size} addresses in the array |
| 25 | pointed by \Var{buffer}. The routine is only available for local unwinding. |
| 26 | |
| 27 | Note that many (but not all) systems provide practically identical function |
| 28 | called \Func{backtrace}(). The prototype for this function is usually obtained |
| 29 | by including the \File{$<$execinfo.h$>$} header file -- a prototype for |
| 30 | \Func{backtrace}() is not provided by \Prog{libunwind}. \Prog{libunwind} weakly |
| 31 | aliases \Func{backtrace}() to \Func{unw\_backtrace}(), so when a program |
| 32 | calling \Func{backtrace}() is linked against \Prog{libunwind}, it may end up |
| 33 | calling \Func{unw\_backtrace}(). |
| 34 | |
| 35 | \section{Return Value} |
| 36 | |
| 37 | The routine returns the number of addresses stored in the array pointed by |
| 38 | \Var{buffer}. The return value may be zero to indicate that no addresses were |
| 39 | stored. |
| 40 | |
| 41 | \section{See Also} |
| 42 | |
| 43 | \SeeAlso{libunwind(3)}, |
| 44 | \SeeAlso{unw\_step(3)} |
| 45 | |
| 46 | \section{Author} |
| 47 | |
| 48 | \noindent |
| 49 | David Mosberger-Tang\\ |
| 50 | Email: \Email{dmosberger@gmail.com}\\ |
| 51 | WWW: \URL{http://www.nongnu.org/libunwind/}. |
| 52 | \LatexManEnd |
| 53 | |
| 54 | \end{document} |