blob: e111e33226dd5bb643919afc4321952f4086b7dd [file] [log] [blame]
mostang.com!davidm824d6612003-02-08 10:10:59 +00001\documentclass{article}
2\usepackage[fancyhdr,pdf]{latex2man}
3
4\input{common.tex}
5
6\begin{document}
7
8\begin{Name}{3}{unw\_resume}{David Mosberger-Tang}{Programming Library}{unw\_resume}
9
10 unw\_resume -- resume execution in a particular stack frame
11\end{Name}
12
13\section{Synopsis}
14
15\File{\#include $<$libunwind.h$>$}\\
16
17\Type{int} \Func{unw\_resume}(\Type{unw\_cursor\_t~*}\Var{cursor});\\
18
19\section{Description}
20
21The \Func{unw\_resume}() routine resumes execution at the stack frame
22identified by \Var{cursor}. Normally, this is accomplished by
23restoring the ``preserved'' (callee-saved) machine state. However, if
24execution in any of the stack frames younger (more deeply nested) than
25the one identified by \Var{cursor} was interrupted by a signal, then
26\Func{unw\_resume}() will restore the entire machine state, including
27the ``preserved'' and ``scratch'' (caller-saved) registers, as well as
28the signal mask.
29
30Most platforms reserve some registers to pass arguments to exception
31handlers (e.g., IA-64 uses \texttt{r15}-\texttt{r18} for this
32purpose). These registers are normally treated like ``scratch''
33registers. However, if \Prog{libunwind} is used to define an
34exception argument register, e.g., by calling \Func{unw\_set\_reg}(),
35then \Func{unw\_resume}() will always install the new value as the
36contents of that register. In other words, the exception handling
37arguments are installed even in cases where normally only the
38``preserved'' registers are restored.
39
mostang.com!davidm88c6bcd2003-02-21 07:36:26 +000040Note that \Func{unw\_resume}() does \emph{not} invoke any unwind
41handlers (aka, ``personality routines''). If a program needs this, it
42will have to do so on its own by obtaining the \Type{unw\_proc\_info\_t}
43of each unwound frame and appropriately processing its unwind handler
44and language-specific data area (lsda). These steps are generally
45dependent on the target-platform and are regulated by the
46processor-specific ABI (application-binary interface).
47
mostang.com!davidm824d6612003-02-08 10:10:59 +000048\section{Return Value}
49
50For local unwinding, \Func{unw\_resume}() does not return on success.
51For remote unwinding, it returns 0 on success. On failure, the
52negative value of one of the errors below is returned.
53
54\section{Errors}
55
56\begin{Description}
57\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
58\item[\Const{UNW\_EBADREG}] A register needed by \Func{unw\_resume}() wasn't
59 accessible.
60\item[\Const{UNW\_EINVALIDIP}] The instruction pointer identified by
61 \Var{cursor} is not valid.
62\item[\Const{UNW\_BADFRAME}] The stack frame identified by
63 \Var{cursor} is not valid.
64\end{Description}
65
66\section{See Also}
67
68\SeeAlso{libunwind(3)},
69\SeeAlso{unw\_set\_reg(3)},
70sigprocmask(2)
71
72\section{Author}
73
74\noindent
75David Mosberger-Tang\\
76Hewlett-Packard Labs\\
77Palo-Alto, CA 94304\\
78Email: \Email{davidm@hpl.hp.com}\\
79WWW: \URL{http://www.hpl.hp.com/research/linux/libunwind/}.
80\LatexManEnd
81
82\end{document}