1UNW_GET_PROC_INFO(3) Programming Library UNW_GET_PROC_INFO(3)
2
3
4
6 unw_get_proc_info -- get info on current procedure
7
9 #include <libunwind.h>
10
11 int unw_get_proc_info(unw_cursor_t *cp, unw_proc_info_t *pip);
12
14 The unw_get_proc_info() routine returns auxiliary information about the
15 procedure that created the stack frame identified by argument cp. The
16 pip argument is a pointer to a structure of type unw_proc_info_t which
17 is used to return the information. The unw_proc_info_t has the follow‐
18 ing members:
19
20 unw_word_t start_ip
21 The address of the first instruction of the procedure. If this
22 address cannot be determined (e.g., due to lack of unwind infor‐
23 mation), the start_ip member is cleared to 0.
24
25 unw_word_t end_ip
26 The address of the first instruction beyond the end of the pro‐
27 cedure. If this address cannot be determined (e.g., due to lack
28 of unwind information), the end_ip member is cleared to 0.
29
30 unw_word_t lsda
31 The address of the language-specific data-area (LSDA). This
32 area normally contains language-specific information needed dur‐
33 ing exception handling. If the procedure has no such area, this
34 member is cleared to 0.
35
36 unw_word_t handler
37 The address of the exception handler routine. This is sometimes
38 called the personality routine. If the procedure does not define
39 a personality routine, the handler member is cleared to 0.
40
41 unw_word_t gp
42 The global-pointer of the procedure. On platforms that do not
43 use a global pointer, this member may contain an undefined
44 value. On all other platforms, it must be set either to the cor‐
45 rect global-pointer value of the procedure or to 0 if the proper
46 global-pointer cannot be obtained for some reason.
47
48 unw_word_t flags
49 A set of flags. There are currently no target-independent
50 flags. For the IA-64 target, the flag
51 UNW_PI_FLAG_IA64_RBS_SWITCH is set if the procedure may switch
52 the register-backing store.
53
54 int format
55 The format of the unwind-info for this procedure. If the un‐
56 wind-info consists of dynamic procedure info, format is equal to
57 UNW_INFO_FORMAT_DYNAMIC. If the unwind-info consists of a (tar‐
58 get-specific) unwind table, it is equal to UNW_INFO_FORMAT_TA‐
59 BLE. All other values are reserved for future use by libunwind.
60 This member exists for use by the find_proc_info() call-back
61 (see unw_create_addr_space(3)). The unw_get_proc_info() routine
62 may return an undefined value in this member.
63
64 int unwind_info_size
65 The size of the unwind-info in bytes. This member exists for
66 use by the find_proc_info() call-back (see unw_cre‐
67 ate_addr_space(3)). The unw_get_proc_info() routine may return
68 an undefined value in this member.
69
70 void *unwind_info
71 The pointer to the unwind-info. If no unwind info is avail‐
72 able, this member must be set to NULL. This member exists for
73 use by the find_proc_info() call-back (see unw_cre‐
74 ate_addr_space(3)). The unw_get_proc_info() routine may return
75 an undefined value in this member.
76
77 Note that for the purposes of libunwind, the code of a procedure is as‐
78 sumed to occupy a single, contiguous range of addresses. For this rea‐
79 son, it is always possible to describe the extent of a procedure with
80 the start_ip and end_ip members. If a single function/routine is split
81 into multiple, discontiguous pieces, libunwind will treat each piece as
82 a separate procedure.
83
85 On successful completion, unw_get_proc_info() returns 0. Otherwise the
86 negative value of one of the error-codes below is returned.
87
89 unw_get_proc_info() is thread-safe. If cursor cp is in the local ad‐
90 dress-space, this routine is also safe to use from a signal handler.
91
93 UNW_EUNSPEC
94 An unspecified error occurred.
95
96 UNW_ENOINFO
97 Libunwind was unable to locate unwind-info for the procedure.
98
99 UNW_EBADVERSION
100 The unwind-info for the procedure has version or format that is
101 not understood by libunwind.
102
103 In addition, unw_get_proc_info() may return any error returned by the
104 access_mem() call-back (see unw_create_addr_space(3)).
105
107 libunwind(3), unw_create_addr_space(3), unw_get_proc_name(3)
108
110 David Mosberger-Tang
111 Email: dmosberger@gmail.com
112 WWW: http://www.nongnu.org/libunwind/.
113
114
115
116Programming Library 29 August 2021 UNW_GET_PROC_INFO(3)