]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs3.3
MFV r355071: libbsdxml (expat) 2.2.9.
[FreeBSD/FreeBSD.git] / contrib / elftoolchain / libdwarf / dwarf_get_fde_info_for_all_regs3.3
1 .\" Copyright (c) 2011 Kai Wang
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $Id: dwarf_get_fde_info_for_all_regs3.3 3644 2018-10-15 19:55:01Z jkoshy $
26 .\"
27 .Dd June 26, 2011
28 .Dt DWARF_GET_FDE_INFO_FOR_ALL_REGS3 3
29 .Os
30 .Sh NAME
31 .Nm dwarf_get_fde_info_for_all_regs3
32 .Nd retrieve register rule row
33 .Sh LIBRARY
34 .Lb libdwarf
35 .Sh SYNOPSIS
36 .In libdwarf.h
37 .Ft int
38 .Fo dwarf_get_fde_info_for_all_regs3
39 .Fa "Dwarf_Fde fde"
40 .Fa "Dwarf_Addr pc"
41 .Fa "Dwarf_Regtable3 *reg_table"
42 .Fa "Dwarf_Addr *row_pc"
43 .Fa "Dwarf_Error *err"
44 .Fc
45 .Sh DESCRIPTION
46 Function
47 .Fn dwarf_get_fde_info_for_all_regs3
48 retrieves a row from the register rule table associated with the given
49 FDE descriptor.
50 .Pp
51 Argument
52 .Ar fde
53 should reference a valid DWARF FDE descriptor.
54 .Pp
55 Argument
56 .Ar pc
57 should hold the program counter address to be used to locate the
58 desired table row.
59 .Pp
60 Argument
61 .Ar reg_table
62 should point to a
63 .Vt Dwarf_Regtable3
64 descriptor which will hold the returned table row of register rules.
65 The
66 .Vt Dwarf_Regtable3
67 descriptor is defined in the header file
68 .In libdwarf.h :
69 .Bd -literal -offset indent
70 typedef struct {
71         Dwarf_Small     dw_offset_relevant;
72         Dwarf_Small     dw_value_type;
73         Dwarf_Half      dw_regnum;
74         Dwarf_Unsigned  dw_offset_or_block_len;
75         Dwarf_Ptr       dw_block_ptr;
76 } Dwarf_Regtable_Entry3;
77
78 typedef struct {
79         Dwarf_Regtable_Entry3   rt3_cfa_rule;
80         Dwarf_Half              rt3_reg_table_size;
81         Dwarf_Regtable_Entry3   *rt3_rules;
82 } Dwarf_Regtable3;
83 .Ed
84 .Pp
85 The
86 .Va rt3_reg_table_size
87 field specifies the maximum number of register rule columns to be
88 returned, and should be set by the application before calling the
89 function.
90 The
91 .Va rt3_rules
92 field should point to a memory arena allocated by the application with
93 space for at least
94 .Vt rt3_reg_table_size
95 descriptors of type
96 .Vt Dwarf_Regtable_Entry3 .
97 .Pp
98 On a successful execution of this function, the
99 .Va rt3_cfa_rule
100 field will be set to the CFA register rule associated with the table
101 row, and the
102 .Va rt3_rules
103 array will hold the returned register rules contained in the table row.
104 .Pp
105 For each register rule descriptor returned,
106 the
107 .Va dw_offset_relevant
108 field will be set to 1 if the register rule has a offset value,
109 the
110 .Va dw_value_type
111 field will be set to the type code of the register rule and the
112 .Va dw_regnum
113 field will be set to the register number associated with the register rule.
114 If the register rule is of type
115 .Dv DW_EXPR_OFFSET
116 or
117 .Dv DW_EXPR_VAL_OFFSET ,
118 the
119 .Va dw_offset_or_block_len
120 field will be set to the offset value associated with the register rule.
121 If the type is
122 .Dv DW_EXPR_EXPRESSION
123 or
124 .Dv DW_EXPR_VAL_EXPRESSION ,
125 the
126 .Va dw_offset_or_block_len
127 field will be set to the length in bytes of the DWARF expression block
128 associated with the register rule.
129 The
130 .Va dw_block_ptr
131 field will be set to a pointer to the content of the DWARF expression block
132 associated with the register rule.
133 .Pp
134 Argument
135 .Ar row_pc
136 should point to a location which will be set to the lowest program
137 counter address associated with the table row.
138 .Pp
139 If argument
140 .Ar err
141 is not NULL, it will be used to store error information in case of an
142 error.
143 .Sh RETURN VALUES
144 Function
145 .Fn dwarf_get_fde_info_for_all_regs3
146 returns
147 .Dv DW_DLV_OK
148 when it succeeds.
149 In case of an error, it returns
150 .Dv DW_DLV_ERROR
151 and sets the argument
152 .Ar err .
153 .Sh ERRORS
154 Function
155 .Fn dwarf_get_fde_info_for_all_regs3
156 can fail with:
157 .Bl -tag -width ".Bq Er DW_DLE_PC_NOT_IN_FDE_RANGE"
158 .It Bq Er DW_DLE_ARGUMENT
159 One of the arguments
160 .Ar fde ,
161 .Ar reg_table
162 or
163 .Ar row_pc
164 was NULL.
165 .It Bq Er DW_DLE_PC_NOT_IN_FDE_RANGE
166 The program counter value provided in argument
167 .Ar pc
168 did not fall in the range covered by argument
169 .Ar fde .
170 .El
171 .Sh SEE ALSO
172 .Xr dwarf 3 ,
173 .Xr dwarf_get_fde_at_pc 3 ,
174 .Xr dwarf_get_fde_info_for_all_regs 3 ,
175 .Xr dwarf_get_fde_info_for_cfa_reg3 3 ,
176 .Xr dwarf_get_fde_info_for_reg 3 ,
177 .Xr dwarf_get_fde_info_for_reg3 3 ,
178 .Xr dwarf_get_fde_n 3 ,
179 .Xr dwarf_set_frame_cfa_value 3 ,
180 .Xr dwarf_set_frame_rule_initial_value 3 ,
181 .Xr dwarf_set_frame_rule_table_size 3 ,
182 .Xr dwarf_set_frame_same_value 3 ,
183 .Xr dwarf_set_frame_undefined_value 3