mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-30 02:27:38 +01:00
Describe behavior difference between local and remote unw_resume().
(Logical change 1.53)
This commit is contained in:
parent
5187d53d31
commit
a126d452e4
1 changed files with 24 additions and 12 deletions
|
@ -19,22 +19,34 @@
|
||||||
\section{Description}
|
\section{Description}
|
||||||
|
|
||||||
The \Func{unw\_resume}() routine resumes execution at the stack frame
|
The \Func{unw\_resume}() routine resumes execution at the stack frame
|
||||||
identified by \Var{cursor}. Normally, this is accomplished by
|
identified by \Var{cursor}. The behavior of this routine differs
|
||||||
restoring the ``preserved'' (callee-saved) machine state. However, if
|
slightly for local and remote unwinding.
|
||||||
execution in any of the stack frames younger (more deeply nested) than
|
|
||||||
the one identified by \Var{cursor} was interrupted by a signal, then
|
For local unwinding, \Func{unw\_resume}() restores the machine state
|
||||||
\Func{unw\_resume}() will restore the entire machine state, including
|
and then directly resumes execution in the target stack frame. Thus
|
||||||
the ``preserved'' and ``scratch'' (caller-saved) registers, as well as
|
\Func{unw\_resume}() does not return in this case. Restoring the
|
||||||
the signal mask.
|
machine state normally involves restoring the ``preserved''
|
||||||
|
(callee-saved) registers. However, if execution in any of the stack
|
||||||
|
frames younger (more deeply nested) than the one identified by
|
||||||
|
\Var{cursor} was interrupted by a signal, then \Func{unw\_resume}()
|
||||||
|
will restore all registers as well as the signal mask.
|
||||||
|
|
||||||
|
For remote unwinding, \Func{unw\_resume}() installs the machine state
|
||||||
|
identified by the cursor by calling the \Func{access\_reg} and
|
||||||
|
\Func{access\_fpreg} accessor callbacks as needed. Once that is
|
||||||
|
accomplished, the \Func{resume} accessor callback is invoked. The
|
||||||
|
\Func{unw\_resume} routine then returns normally (that is, unlikely
|
||||||
|
for local unwinding, \Func{unw\_resume} will always return for remote
|
||||||
|
unwinding).
|
||||||
|
|
||||||
Most platforms reserve some registers to pass arguments to exception
|
Most platforms reserve some registers to pass arguments to exception
|
||||||
handlers (e.g., IA-64 uses \texttt{r15}-\texttt{r18} for this
|
handlers (e.g., IA-64 uses \texttt{r15}-\texttt{r18} for this
|
||||||
purpose). These registers are normally treated like ``scratch''
|
purpose). These registers are normally treated like ``scratch''
|
||||||
registers. However, if \Prog{libunwind} is used to define an
|
registers. However, if \Prog{libunwind} is used to set an exception
|
||||||
exception argument register, e.g., by calling \Func{unw\_set\_reg}(),
|
argument register to a particular value (e.g., via
|
||||||
then \Func{unw\_resume}() will always install the new value as the
|
\Func{unw\_set\_reg}()), then \Func{unw\_resume}() will install this
|
||||||
contents of that register. In other words, the exception handling
|
value as the contents of the register. In other words, the exception
|
||||||
arguments are installed even in cases where normally only the
|
handling arguments are installed even in cases where normally only the
|
||||||
``preserved'' registers are restored.
|
``preserved'' registers are restored.
|
||||||
|
|
||||||
Note that \Func{unw\_resume}() does \emph{not} invoke any unwind
|
Note that \Func{unw\_resume}() does \emph{not} invoke any unwind
|
||||||
|
|
Loading…
Reference in a new issue