1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-23 12:03:41 +01:00
libunwind-eh_elf/doc/unw_set_reg.tex
mostang.com!davidm d0028f3b30 Put {Name} section contents on a single line to work around a bug in
lexgrog.

(Logical change 1.74)
2003-04-01 07:19:34 +00:00

81 lines
2.5 KiB
TeX

\documentclass{article}
\usepackage[fancyhdr,pdf]{latex2man}
\input{common.tex}
\begin{document}
\begin{Name}{3}{unw\_set\_reg}{David Mosberger-Tang}{Programming Library}{unw\_set\_reg}unw\_set\_reg -- set register contents
\end{Name}
\section{Synopsis}
\File{\#include $<$libunwind.h$>$}\\
\Type{int} \Func{unw\_set\_reg}(\Type{unw\_cursor\_t~*}\Var{cp}, \Type{unw\_regnum\_t} \Var{reg}, \Type{unw\_word\_t} \Var{val});\\
\section{Description}
The \Func{unw\_set\_reg}() routine sets the value of register
\Var{reg} in the stack frame identified by cursor \Var{cp} to the
value passed in \Var{val}.
The register numbering is target-dependent and described in separate
manual pages (e.g., libunwind-ia64(3) for the IA-64 target).
Furthermore, the exact set of accessible registers may depend on the
type of frame that \Var{cp} is referring to. For ordinary stack
frames, it is normally possible to access only the preserved
(``callee-saved'') registers and frame-related registers (such as the
stack-pointer). However, for signal frames (see
\Func{unw\_is\_signal\_frame}(3)), it is usually possible to access
all registers.
Note that \Func{unw\_set\_reg}() can only write the contents of
registers whose values fit in a single word. See
\Func{unw\_set\_fpreg}(3) for a way to write registers which do not
fit this constraint.
\section{Return Value}
On successful completion, \Func{unw\_set\_reg}() returns 0.
Otherwise the negative value of one of the error-codes below is
returned.
\section{Thread and Signal Safety}
\Func{unw\_set\_reg}() is thread-safe as well as safe to use
from a signal handler.
\section{Errors}
\begin{Description}
\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
\item[\Const{UNW\_EBADREG}] An attempt was made to write a register
that is either invalid or not accessible in the current frame.
\item[\Const{UNW\_EREADONLY}] An attempt was made to write to a
read-only register.
\end{Description}
In addition, \Func{unw\_set\_reg}() may return any error returned by
the \Func{access\_mem}(), \Func{access\_reg}(), and
\Func{access\_fpreg}() call-backs (see
\Func{unw\_create\_addr\_space}(3)).
\section{See Also}
\SeeAlso{libunwind(3)},
\SeeAlso{libunwind-ia64(3)},
\SeeAlso{unw\_get\_reg(3)},
\SeeAlso{unw\_is\_signal\_frame(3)},
\SeeAlso{unw\_set\_fpreg(3)}
\section{Author}
\noindent
David Mosberger-Tang\\
Hewlett-Packard Labs\\
Palo-Alto, CA 94304\\
Email: \Email{davidm@hpl.hp.com}\\
WWW: \URL{http://www.hpl.hp.com/research/linux/libunwind/}.
\LatexManEnd
\end{document}