]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/elftoolchain/libdwarf/dwarf_get_fde_info_for_all_regs.3
bhnd(9): Fix a few mandoc related issues
[FreeBSD/FreeBSD.git] / contrib / elftoolchain / libdwarf / dwarf_get_fde_info_for_all_regs.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_regs.3 3644 2018-10-15 19:55:01Z jkoshy $
26 .\"
27 .Dd June 4, 2011
28 .Dt DWARF_GET_FDE_INFO_FOR_ALL_REGS 3
29 .Os
30 .Sh NAME
31 .Nm dwarf_get_fde_info_for_all_regs
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_regs
39 .Fa "Dwarf_Fde fde"
40 .Fa "Dwarf_Addr pc"
41 .Fa "Dwarf_Regtable *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_regs
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_Regtable
64 descriptor which will hold the returned table row of register rules.
65 .Pp
66 Argument
67 .Ar row_pc
68 should point to a location which will be set to the lowest program
69 counter address associated with the table row.
70 .Pp
71 If argument
72 .Ar err
73 is not NULL, it will be used to store error information in case of an
74 error.
75 .Pp
76 The
77 .Vt Dwarf_Regtable
78 descriptor is defined in the header file
79 .In libdwarf.h :
80 .Bd -literal -offset indent
81 typedef struct {
82         struct {
83                 Dwarf_Small     dw_offset_relevant;
84                 Dwarf_Half      dw_regnum;
85                 Dwarf_Addr      dw_offset;
86         } rules[DW_REG_TABLE_SIZE];
87 } Dwarf_Regtable;
88 .Ed
89 .Pp
90 For each of the register rules returned,
91 the
92 .Va dw_offset_relevant
93 field is set to 1 if the register rule has a offset value.
94 The
95 .Va dw_regnum
96 field is set to the register number associated with the regsiter rule.
97 The
98 .Va dw_offset
99 field is set to the offset value associated with the register rule.
100 .Pp
101 The number of register columns returned is either the constant
102 value
103 .Dv DW_REG_TABLE_SIZE as defined
104 in the header file
105 .In libdwarf.h ,
106 or the value set by function
107 .Xr dwarf_set_frame_rule_table_size 3 ,
108 whichever is smaller.
109 .Ss COMPATIBILITY
110 Function
111 .Fn dwarf_get_fde_info_for_all_regs
112 is deprecated since it only supports DWARF2 frame sections.
113 Applications should instead use function
114 .Xr dwarf_get_fde_info_for_all_regs3 3
115 which supports both DWARF2 and DWARF3 frame sections.
116 .Sh RETURN VALUES
117 Function
118 .Fn dwarf_get_fde_info_for_all_regs
119 returns
120 .Dv DW_DLV_OK
121 when it succeeds.
122 In case of an error, it returns
123 .Dv DW_DLV_ERROR
124 and sets the argument
125 .Ar err .
126 .Sh ERRORS
127 Function
128 .Fn dwarf_get_fde_info_for_all_regs
129 can fail with:
130 .Bl -tag -width ".Bq Er DW_DLE_PC_NOT_IN_FDE_RANGE"
131 .It Bq Er DW_DLE_ARGUMENT
132 One of the arguments
133 .Ar fde ,
134 .Ar reg_table
135 or
136 .Ar row_pc
137 was NULL.
138 .It Bq Er DW_DLE_PC_NOT_IN_FDE_RANGE
139 The program counter value provided in argument
140 .Ar pc
141 did not fall in the range covered by argument
142 .Ar fde .
143 .El
144 .Sh SEE ALSO
145 .Xr dwarf 3 ,
146 .Xr dwarf_get_fde_at_pc 3 ,
147 .Xr dwarf_get_fde_info_for_all_regs3 3 ,
148 .Xr dwarf_get_fde_info_for_cfa_reg3 3 ,
149 .Xr dwarf_get_fde_info_for_reg 3 ,
150 .Xr dwarf_get_fde_info_for_reg3 3 ,
151 .Xr dwarf_get_fde_n 3 ,
152 .Xr dwarf_set_frame_cfa_value 3 ,
153 .Xr dwarf_set_frame_rule_initial_value 3 ,
154 .Xr dwarf_set_frame_rule_table_size 3 ,
155 .Xr dwarf_set_frame_same_value 3 ,
156 .Xr dwarf_set_frame_undefined_value 3