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