1 \documentclass{article}
2 \usepackage[fancyhdr,pdf]{latex2man}
8 \begin{Name}{3}{unw\_reg\_states\_iterate}{David Mosberger-Tang}{Programming Library}{unw\_reg\_states\_iterate}unw\_reg\_states\_iterate -- get register state info on current procedure
13 \File{\#include $<$libunwind.h$>$}\\
15 \Type{int} \Func{unw\_reg\_states\_iterate}(\Type{unw\_cursor\_t~*}\Var{cp}, \Type{unw\_reg\_states\_callback}\Var{cb}, \Type{void~*}\Var{token});\\
19 The \Func{unw\_reg\_states\_iterate}() routine provides
20 information about the procedure that created the stack frame
21 identified by argument \Var{cp}. The \Var{cb} argument is a pointer
22 to a function of type \Type{unw\_reg\_states\_callback} which is used to
23 return the information. The function \Type{unw\_reg\_states\_callback} has the
26 \Type{int} (~*\Var{unw\_reg\_states\_callback})(\Type{void~*}\Var{token},
27 \Type{void~*}\Var{reg\_states\_data},
28 \Type{size\_t} \Var{reg\_states\_data\_size},
29 \Type{unw\_word\_t} \Var{start\_ip}, \Type{unw\_word\_t} \Var{end\_ip});
31 The callback function may be invoked several times for each call of \Func{unw\_reg\_states\_iterate}. Each call is associcated with a instruction address range and a set of instructions on how to update register values when returning from the procedure in that address range. For each invocation, the arguments to the callback function are:
33 \item[\Type{void~*} \Var{token}] The token value passed to \Var{unw\_reg\_states\_callback}. \\
34 \item[\Type{void~*} \Var{reg\_states\_data}] A pointer to data about
35 updating register values. This data, or a copy of it, can be passed
36 to \Var{unw\_apply\_reg\_state}.\\
37 \item[\Type{int} \Var{reg\_states\_data\_size}] The size of the register update data. \\
38 \item[\Type{unw\_word\_t} \Var{start\_ip}] The address of the first
39 instruction of the address range. \\
40 \item[\Type{unw\_word\_t} \Var{end\_ip}] The address of the first
41 instruction \emph{beyond} the end of the address range. \\
44 \section{Return Value}
46 On successful completion, \Func{unw\_reg\_states\_iterate}() returns
47 0. If the callback function returns a nonzero value, that indicates
48 failure and the function returns immediately. Otherwise the negative
49 value of one of the error-codes below is returned.
51 \section{Thread and Signal Safety}
53 \Func{unw\_reg\_states\_iterate}() is thread-safe. If cursor \Var{cp} is
54 in the local address-space, this routine is also safe to use from a
60 \item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
61 \item[\Const{UNW\_ENOINFO}] \Prog{Libunwind} was unable to locate
62 unwind-info for the procedure.
63 \item[\Const{UNW\_EBADVERSION}] The unwind-info for the procedure has
64 version or format that is not understood by \Prog{libunwind}.
66 In addition, \Func{unw\_reg\_states\_iterate}() may return any error
67 returned by the \Func{access\_mem}() call-back (see
68 \Func{unw\_create\_addr\_space}(3)).
72 \SeeAlso{libunwind(3)},
73 \SeeAlso{unw\_apply\_reg\_state(3)}
78 David Mosberger-Tang\\
79 Email: \Email{dmosberger@gmail.com}\\
80 WWW: \URL{http://www.nongnu.org/libunwind/}.