Initial import
[external/libunwind.git] / doc / unw_get_reg.man
1 '\" t
2 .\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
3 .\" NOTE: This file is generated, DO NOT EDIT.
4 .de Vb
5 .ft CW
6 .nf
7 ..
8 .de Ve
9 .ft R
10
11 .fi
12 ..
13 .TH "UNW\\_GET\\_REG" "3" "16 August 2007" "Programming Library " "Programming Library "
14 .SH NAME
15 unw_get_reg
16 \-\- get register contents 
17 .PP
18 .SH SYNOPSIS
19
20 .PP
21 #include <libunwind.h>
22 .br
23 .PP
24 int
25 unw_get_reg(unw_cursor_t *cp,
26 unw_regnum_t
27 reg,
28 unw_word_t *valp);
29 .br
30 .PP
31 .SH DESCRIPTION
32
33 .PP
34 The unw_get_reg()
35 routine reads the value of register 
36 reg
37 in the stack frame identified by cursor cp
38 and stores 
39 the value in the word pointed to by valp\&.
40 .PP
41 The register numbering is target\-dependent and described in separate 
42 manual pages (e.g., libunwind\-ia64(3) for the IA\-64 target). 
43 Furthermore, the exact set of accessible registers may depend on the 
44 type of frame that cp
45 is referring to. For ordinary stack 
46 frames, it is normally possible to access only the preserved 
47 (``callee\-saved\&'') registers and frame\-related registers (such as the 
48 stack\-pointer). However, for signal frames (see 
49 unw_is_signal_frame(3)),
50 it is usually possible to access 
51 all registers. 
52 .PP
53 Note that unw_get_reg()
54 can only read the contents of 
55 registers whose values fit in a single word. See 
56 unw_get_fpreg(3)
57 for a way to read registers which do not fit 
58 this constraint. 
59 .PP
60 .SH RETURN VALUE
61
62 .PP
63 On successful completion, unw_get_reg()
64 returns 0. 
65 Otherwise the negative value of one of the error\-codes below is 
66 returned. 
67 .PP
68 .SH THREAD AND SIGNAL SAFETY
69
70 .PP
71 unw_get_reg()
72 is thread\-safe as well as safe to use 
73 from a signal handler. 
74 .PP
75 .SH ERRORS
76
77 .PP
78 .TP
79 UNW_EUNSPEC
80  An unspecified error occurred. 
81 .TP
82 UNW_EBADREG
83  An attempt was made to read a register 
84 that is either invalid or not accessible in the current frame. 
85 .PP
86 In addition, unw_get_reg()
87 may return any error returned by 
88 the access_mem(),
89 access_reg(),
90 and 
91 access_fpreg()
92 call\-backs (see 
93 unw_create_addr_space(3)).
94 .PP
95 .SH SEE ALSO
96
97 .PP
98 libunwind(3),
99 libunwind\-ia64(3),
100 unw_get_fpreg(3),
101 unw_is_signal_frame(3),
102 unw_set_reg(3)
103 .PP
104 .SH AUTHOR
105
106 .PP
107 David Mosberger\-Tang
108 .br
109 Email: \fBdmosberger@gmail.com\fP
110 .br
111 WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
112 .\" NOTE: This file is generated, DO NOT EDIT.