-
Notifications
You must be signed in to change notification settings - Fork 9
/
dwarf_dealloc.3
203 lines (203 loc) · 5.19 KB
/
dwarf_dealloc.3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
.\" Copyright (c) 2009-2011 Joseph Koshy. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" This software is provided by Joseph Koshy ``as is'' and
.\" any express or implied warranties, including, but not limited to, the
.\" implied warranties of merchantability and fitness for a particular purpose
.\" are disclaimed. in no event shall Joseph Koshy be liable
.\" for any direct, indirect, incidental, special, exemplary, or consequential
.\" damages (including, but not limited to, procurement of substitute goods
.\" or services; loss of use, data, or profits; or business interruption)
.\" however caused and on any theory of liability, whether in contract, strict
.\" liability, or tort (including negligence or otherwise) arising in any way
.\" out of the use of this software, even if advised of the possibility of
.\" such damage.
.\"
.\" $Id: dwarf_dealloc.3 2073 2011-10-27 03:30:47Z jkoshy $
.\"
.Dd July 23, 2011
.Os
.Dt DWARF_DEALLOC 3
.Sh NAME
.Nm dwarf_dealloc ,
.Nm dwarf_fde_cie_list_dealloc ,
.Nm dwarf_funcs_dealloc ,
.Nm dwarf_globals_dealloc ,
.Nm dwarf_pubtypes_dealloc ,
.Nm dwarf_ranges_dealloc ,
.Nm dwarf_srclines_dealloc ,
.Nm dwarf_types_dealloc ,
.Nm dwarf_vars_dealloc ,
.Nm dwarf_weaks_dealloc
.Nd release resources
.Sh LIBRARY
.Lb libdwarf
.Sh SYNOPSIS
.In libdwarf.h
.Ft void
.Fo dwarf_dealloc
.Fa "Dwarf_Debug dbg"
.Fa "Dwarf_Ptr ptr"
.Fa "Dwarf_Unsigned type"
.Fc
.Fo dwarf_fde_cie_list_dealloc
.Fa "Dwarf_Debug dbg"
.Fa "Dwarf_Cie *cie_list"
.Fa "Dwarf_Signed cie_count"
.Fa "Dwarf_Fde *fde_list"
.Fa "Dwarf_Signed fde_count"
.Fc
.Ft void
.Fo dwarf_funcs_dealloc
.Fa "Dwarf_Debug dbg"
.Fa "Dwarf_Func *funcs"
.Fa "Dwarf_Signed funccount"
.Fc
.Ft void
.Fo dwarf_globals_dealloc
.Fa "Dwarf_Debug dbg"
.Fa "Dwarf_Global *globals"
.Fa "Dwarf_Signed globalcount"
.Fc
.Ft void
.Fo dwarf_pubtypes_dealloc
.Fa "Dwarf_Debug dbg"
.Fa "Dwarf_Type *pubtypes"
.Fa "Dwarf_Signed pubtypecount"
.Fc
.Ft void
.Fo dwarf_ranges_dealloc
.Fa "Dwarf_Debug dbg"
.Fa "Dwarf_Ranges *ranges"
.Fa "Dwarf_Signed rangecount"
.Fc
.Ft void
.Fo dwarf_srclines_dealloc
.Fa "Dwarf_Debug dbg"
.Fa "Dwarf_Line *lines"
.Fa "Dwarf_Signed linecount"
.Fc
.Ft void
.Fo dwarf_types_dealloc
.Fa "Dwarf_Debug dbg"
.Fa "Dwarf_Type *types"
.Fa "Dwarf_Signed typecount"
.Fc
.Ft void
.Fo dwarf_vars_dealloc
.Fa "Dwarf_Debug dbg"
.Fa "Dwarf_Var *vars"
.Fa "Dwarf_Signed varcount"
.Fc
.Ft void
.Fo dwarf_weaks_dealloc
.Fa "Dwarf_Debug dbg"
.Fa "Dwarf_Weak *weaks"
.Fa "Dwarf_Signed weakcount"
.Fc
.Sh DESCRIPTION
The function
.Fn dwarf_dealloc
is used by applications to indicate that memory areas returned by
.Lb libdwarf
may be safely disposed off.
Due to the way memory is managed in the current implementation, the
use of
.Fn dwarf_dealloc
is only necessary for a small set of DWARF types.
.Pp
Argument
.Ar dbg
should reference a valid debugging context allocated using
.Xr dwarf_init 3 .
.Pp
Argument
.Ar ptr
should point to an object or memory area obtained by a prior call
to a DWARF(3) function.
.Pp
Argument
.Ar type
indicates the type of object being deallocated.
The indicated type must match that of the object being passed in
argument
.Ar ptr .
Valid values for the
.Ar type
argument are:
.Bl -tag -width ".Dv DW_DLA_FRAME_BLOCK"
.It Dv DW_DLA_ABBREV
An object of type
.Vt Dwarf_Abbrev ,
as returned by a call to the function
.Xr dwarf_get_abbrev 3 .
.It Dv DW_DLA_DIE
An object of type
.Vt Dwarf_Die ,
as returned by calls to the functions
.Xr dwarf_child 3 ,
.Xr dwarf_offdie 3
or
.Xr dwarf_siblingof 3 .
.It Dv DW_DLA_FRAME_BLOCK
An array of objects of type
.Vt Dwarf_Frame_op ,
as returned by a call to the function
.Xr dwarf_expand_frame_instructions 3 .
.El
.Pp
Calls to
.Fn dwarf_dealloc
with other values for argument
.Ar type
are no-ops in this implementation.
.Pp
The functions
.Fn dwarf_fde_cie_list_dealloc ,
.Fn dwarf_funcs_dealloc ,
.Fn dwarf_globals_dealloc ,
.Fn dwarf_pubtypes_dealloc ,
.Fn dwarf_ranges_dealloc ,
.Fn dwarf_srclines_dealloc ,
.Fn dwarf_types_dealloc ,
.Fn dwarf_vars_dealloc
and
.Fn dwarf_weaks_dealloc
are provided for compatibility with other implementations of the
DWARF(3) API.
Due to the way memory is managed in the current implementation, these
functions are effectively no-ops.
.Pp
See
.Xr dwarf 3
for more information about the memory management scheme in this
implementation of the DWARF(3) API.
.Sh RETURN VALUES
Functions
.Fn dwarf_dealloc ,
.Fn dwarf_fde_cie_list_dealloc ,
.Fn dwarf_funcs_dealloc ,
.Fn dwarf_globals_dealloc ,
.Fn dwarf_pubtypes_dealloc ,
.Fn dwarf_ranges_dealloc ,
.Fn dwarf_srclines_dealloc ,
.Fn dwarf_types_dealloc ,
.Fn dwarf_vars_dealloc
and
.Fn dwarf_weaks_dealloc
have no return value.
.Sh SEE ALSO
.Xr dwarf 3 ,
.Xr dwarf_child 3 ,
.Xr dwarf_expand_frame_instructions 3 ,
.Xr dwarf_get_abbrev 3 ,
.Xr dwarf_offdie 3 ,
.Xr dwarf_siblingof 3