1.\"	$NetBSD: dwarf_set_frame_cfa_value.3,v 1.2 2014/03/09 16:58:04 christos Exp $
2.\"
3.\" Copyright (c) 2011 Kai Wang
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" Id: dwarf_set_frame_cfa_value.3 2075 2011-10-27 03:47:28Z jkoshy
28.\"
29.Dd June 18, 2011
30.Os
31.Dt DWARF_SET_FRAME_CFA_VALUE 3
32.Sh NAME
33.Nm dwarf_set_frame_cfa_value ,
34.Nm dwarf_set_frame_rule_initial_value ,
35.Nm dwarf_set_frame_rule_table_size ,
36.Nm dwarf_set_frame_same_value ,
37.Nm dwarf_set_frame_undefined_value
38.Nd set internal register rule table parameters
39.Sh LIBRARY
40.Lb libdwarf
41.Sh SYNOPSIS
42.In libdwarf.h
43.Ft Dwarf_Half
44.Fo dwarf_set_frame_cfa_value
45.Fa "Dwarf_Debug dbg"
46.Fa "Dwarf_Half value"
47.Fc
48.Ft Dwarf_Half
49.Fo dwarf_set_frame_rule_initial_value
50.Fa "Dwarf_Debug dbg"
51.Fa "Dwarf_Half value"
52.Fc
53.Ft Dwarf_Half
54.Fo dwarf_set_frame_rule_table_size
55.Fa "Dwarf_Debug dbg"
56.Fa "Dwarf_Half value"
57.Fc
58.Ft Dwarf_Half
59.Fo dwarf_set_frame_same_value
60.Fa "Dwarf_Debug dbg"
61.Fa "Dwarf_Half value"
62.Fc
63.Ft Dwarf_Half
64.Fo dwarf_set_frame_undefined_value
65.Fa "Dwarf_Debug dbg"
66.Fa "Dwarf_Half value"
67.Fc
68.Sh DESCRIPTION
69These functions set the parameters of the internal register
70rule table.
71.Pp
72Argument
73.Ar dbg
74should reference a DWARF debug context allocated using
75.Xr dwarf_init 3 .
76.Pp
77Argument
78.Ar value
79should hold the parameter value to set.
80.Pp
81Function
82.Fn dwarf_set_frame_cfa_value
83sets the column number for the CFA register rule in the internal
84register rule table.
85The constant
86.Dv DW_FRAME_CFA_COL
87is the default CFA register column number for DWARF2-only
88interfaces, and the constant
89.Dv DW_FRAME_CFA_COL3
90is the default CFA column number for DWARF3-compatible interfaces.
91.Pp
92Function
93.Fn dwarf_set_frame_rule_initial_value
94sets the initial value of the register rules in the internal register
95rule table.
96The default initial value is the constant
97.Dv DW_FRAME_REG_INITIAL_VALUE ,
98defined in the header file
99.In libdwarf.h .
100.Pp
101Function
102.Fn dwarf_set_frame_rule_table_size
103sets the maxmium number of columns of the internal register rule table.
104Argument
105.Ar value
106should be at least as large as the number of real registers in the ABI.
107.Pp
108Function
109.Fn dwarf_set_frame_same_value
110sets the register number representing the
111.Dq "same value"
112register rule.
113The default register number for the
114.Dq "same value"
115rule is the constant
116.Dv DW_FRAME_SAME_VAL ,
117defined in the header file
118.In libdwarf.h .
119.Pp
120Function
121.Fn dwarf_set_frame_undefined_value
122sets the register number representing the
123.Dq undefined
124register rule.
125The default register number for the
126.Dq undefined
127rule is the constant
128.Dv DW_FRAME_UNDEFINED_VAL ,
129defined in the header file
130.In libdwarf.h .
131.Sh RETURN VALUES
132These functions return the previous value of the parameter being
133set.
134.Sh SEE ALSO
135.Xr dwarf 3 ,
136.Xr dwarf_get_fde_at_pc 3 ,
137.Xr dwarf_get_fde_info_for_all_regs 3 ,
138.Xr dwarf_get_fde_info_for_all_regs3 3 ,
139.Xr dwarf_get_fde_info_for_cfa_reg3 3 ,
140.Xr dwarf_get_fde_info_for_reg 3 ,
141.Xr dwarf_get_fde_info_for_reg3 3 ,
142.Xr dwarf_get_fde_n 3
143