1UNW_REG_STATES_ITERATE(3) Programming Library UNW_REG_STATES_ITERATE(3)
2
3
4
6 unw_reg_states_iterate -- get register state info on current procedure
7
9 #include <libunwind.h>
10
11 int unw_reg_states_iterate(unw_cursor_t *cp, unw_reg_states_callbackcb,
12 void *token);
13
15 The unw_reg_states_iterate() routine provides information about the
16 procedure that created the stack frame identified by argument cp. The
17 cb argument is a pointer to a function of type unw_reg_states_callback
18 which is used to return the information. The function
19 unw_reg_states_callback has the following definition:
20
21 int ( *unw_reg_states_callback)(void *token, void *reg_states_data,
22 size_t reg_states_data_size, unw_word_t start_ip, unw_word_t end_ip);
23
24 The callback function may be invoked several times for each call of
25 unw_reg_states_iterate. Each call is associcated with a instruction
26 address range and a set of instructions on how to update register val‐
27 ues when returning from the procedure in that address range. For each
28 invocation, the arguments to the callback function are:
29
30 void * token
31 The token value passed to unw_reg_states_callback.
32
33 void * reg_states_data
34 A pointer to data about updating register values. This data, or
35 a copy of it, can be passed to unw_apply_reg_state.
36
37 int reg_states_data_size
38 The size of the register update data.
39
40 unw_word_t start_ip
41 The address of the first instruction of the address range.
42
43 unw_word_t end_ip
44 The address of the first instruction beyond the end of the
45 address range.
46
48 On successful completion, unw_reg_states_iterate() returns 0. If the
49 callback function returns a nonzero value, that indicates failure and
50 the function returns immediately. Otherwise the negative value of one
51 of the error-codes below is returned.
52
54 unw_reg_states_iterate() is thread-safe. If cursor cp is in the local
55 address-space, this routine is also safe to use from a signal handler.
56
58 UNW_EUNSPEC
59 An unspecified error occurred.
60
61 UNW_ENOINFO
62 Libunwind was unable to locate unwind-info for the procedure.
63
64 UNW_EBADVERSION
65 The unwind-info for the procedure has version or format that is
66 not understood by libunwind.
67
68 In addition, unw_reg_states_iterate() may return any error returned by
69 the access_mem() call-back (see unw_create_addr_space(3)).
70
72 libunwind(3), unw_apply_reg_state(3)
73
75 David Mosberger-Tang
76 Email: dmosberger@gmail.com
77 WWW: http://www.nongnu.org/libunwind/.
78
79
80
81Programming Library 16 August 2017 UNW_REG_STATES_ITERATE(3)