xref: /minix3/external/bsd/elftoolchain/dist/libdwarf/dwarf.3 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc.\"	$NetBSD: dwarf.3,v 1.2 2014/03/09 16:58:03 christos Exp $
2*0a6a1f1dSLionel Sambuc.\"
3*0a6a1f1dSLionel Sambuc.\" Copyright (c) 2011 Joseph Koshy.  All rights reserved.
4*0a6a1f1dSLionel Sambuc.\"
5*0a6a1f1dSLionel Sambuc.\" Redistribution and use in source and binary forms, with or without
6*0a6a1f1dSLionel Sambuc.\" modification, are permitted provided that the following conditions
7*0a6a1f1dSLionel Sambuc.\" are met:
8*0a6a1f1dSLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright
9*0a6a1f1dSLionel Sambuc.\"    notice, this list of conditions and the following disclaimer.
10*0a6a1f1dSLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright
11*0a6a1f1dSLionel Sambuc.\"    notice, this list of conditions and the following disclaimer in the
12*0a6a1f1dSLionel Sambuc.\"    documentation and/or other materials provided with the distribution.
13*0a6a1f1dSLionel Sambuc.\"
14*0a6a1f1dSLionel Sambuc.\" This software is provided by Joseph Koshy ``as is'' and
15*0a6a1f1dSLionel Sambuc.\" any express or implied warranties, including, but not limited to, the
16*0a6a1f1dSLionel Sambuc.\" implied warranties of merchantability and fitness for a particular purpose
17*0a6a1f1dSLionel Sambuc.\" are disclaimed.  in no event shall Joseph Koshy be liable
18*0a6a1f1dSLionel Sambuc.\" for any direct, indirect, incidental, special, exemplary, or consequential
19*0a6a1f1dSLionel Sambuc.\" damages (including, but not limited to, procurement of substitute goods
20*0a6a1f1dSLionel Sambuc.\" or services; loss of use, data, or profits; or business interruption)
21*0a6a1f1dSLionel Sambuc.\" however caused and on any theory of liability, whether in contract, strict
22*0a6a1f1dSLionel Sambuc.\" liability, or tort (including negligence or otherwise) arising in any way
23*0a6a1f1dSLionel Sambuc.\" out of the use of this software, even if advised of the possibility of
24*0a6a1f1dSLionel Sambuc.\" such damage.
25*0a6a1f1dSLionel Sambuc.\"
26*0a6a1f1dSLionel Sambuc.\" Id: dwarf.3 2075 2011-10-27 03:47:28Z jkoshy
27*0a6a1f1dSLionel Sambuc.\"
28*0a6a1f1dSLionel Sambuc.Dd September 17, 2011
29*0a6a1f1dSLionel Sambuc.Os
30*0a6a1f1dSLionel Sambuc.Dt DWARF 3
31*0a6a1f1dSLionel Sambuc.Sh NAME
32*0a6a1f1dSLionel Sambuc.Nm dwarf
33*0a6a1f1dSLionel Sambuc.Nd access debugging information in object files
34*0a6a1f1dSLionel Sambuc.Sh LIBRARY
35*0a6a1f1dSLionel Sambuc.Lb libdwarf
36*0a6a1f1dSLionel Sambuc.Sh SYNOPSIS
37*0a6a1f1dSLionel Sambuc.In libdwarf.h
38*0a6a1f1dSLionel Sambuc.Sh DESCRIPTION
39*0a6a1f1dSLionel Sambuc.Pp
40*0a6a1f1dSLionel SambucThe
41*0a6a1f1dSLionel Sambuc.Lb libdwarf
42*0a6a1f1dSLionel Sambucprovides functions that allow an application to read and write debugging
43*0a6a1f1dSLionel Sambucinformation in object files.
44*0a6a1f1dSLionel SambucThe format of debugging information accessible through this API
45*0a6a1f1dSLionel Sambucis defined by the DWARF standard, see
46*0a6a1f1dSLionel Sambuc.Xr dwarf 4 .
47*0a6a1f1dSLionel Sambuc.Pp
48*0a6a1f1dSLionel SambucThe
49*0a6a1f1dSLionel Sambuc.Xr DWARF 3
50*0a6a1f1dSLionel SambucAPI has two parts:
51*0a6a1f1dSLionel Sambuc.Bl -bullet
52*0a6a1f1dSLionel Sambuc.It
53*0a6a1f1dSLionel SambucA consumer API set allows applications to read existing debug information
54*0a6a1f1dSLionel Sambucin a program object.
55*0a6a1f1dSLionel SambucThe functions that comprise the DWARF consumer API are described in
56*0a6a1f1dSLionel Sambucthe section
57*0a6a1f1dSLionel Sambuc.Sx "DWARF Consumer API"
58*0a6a1f1dSLionel Sambucbelow.
59*0a6a1f1dSLionel Sambuc.It
60*0a6a1f1dSLionel SambucA producer API set that allows applications to add debug information
61*0a6a1f1dSLionel Sambucto a program object.
62*0a6a1f1dSLionel SambucThe functions that comprise the DWARF producer API are described in
63*0a6a1f1dSLionel Sambucthe section
64*0a6a1f1dSLionel Sambuc.Sx "DWARF Producer API"
65*0a6a1f1dSLionel Sambucbelow.
66*0a6a1f1dSLionel Sambuc.El
67*0a6a1f1dSLionel Sambuc.Pp
68*0a6a1f1dSLionel SambucEach function referenced below is further described in its own manual page.
69*0a6a1f1dSLionel Sambuc.Ss Namespace use
70*0a6a1f1dSLionel SambucThe DWARF library uses the following prefixes:
71*0a6a1f1dSLionel Sambuc.Pp
72*0a6a1f1dSLionel Sambuc.Bl -tag -width ".Li Dwarf_*" -compact
73*0a6a1f1dSLionel Sambuc.It Li DWARF_*
74*0a6a1f1dSLionel SambucUsed for error numbers and constants.
75*0a6a1f1dSLionel Sambuc.It Li DW_*
76*0a6a1f1dSLionel SambucUsed for constants.
77*0a6a1f1dSLionel Sambuc.It Li Dwarf_*
78*0a6a1f1dSLionel SambucUsed for types.
79*0a6a1f1dSLionel Sambuc.It Li dwarf_*
80*0a6a1f1dSLionel SambucUsed for functions and macros that make up the API.
81*0a6a1f1dSLionel Sambuc.El
82*0a6a1f1dSLionel Sambuc.Ss Data Types
83*0a6a1f1dSLionel SambucThe DWARF(3) API uses the following data types:
84*0a6a1f1dSLionel Sambuc.Pp
85*0a6a1f1dSLionel Sambuc.Bl -tag -width ".Vt Dwarf_Unsigned" -compact
86*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Abbrev
87*0a6a1f1dSLionel SambucDescribes DWARF abbreviations.
88*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Addr
89*0a6a1f1dSLionel SambucA program address in the target object.
90*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Arange
91*0a6a1f1dSLionel SambucDescribes address ranges.
92*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Attribute , Vt Dwarf_P_Attribute
93*0a6a1f1dSLionel SambucDescribes attributes of debugging information entries.
94*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Bool
95*0a6a1f1dSLionel SambucUsed for boolean states.
96*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Cie , Vt Dwarf_P_Cie
97*0a6a1f1dSLionel SambucDescribes call information that is common to several frames.
98*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Debug , Vt Dwarf_P_Debug
99*0a6a1f1dSLionel SambucAn opaque type describing a debug context.
100*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Die , Vt Dwarf_P_Die
101*0a6a1f1dSLionel SambucA debugging information entry.
102*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Fde , Vt Dwarf_P_Fde
103*0a6a1f1dSLionel SambucA frame descriptor.
104*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Func
105*0a6a1f1dSLionel SambucA descriptor representing a function.
106*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Global
107*0a6a1f1dSLionel SambucA descriptor representing a global name.
108*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Half
109*0a6a1f1dSLionel SambucA 16-bit wide unsigned numeric type.
110*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Handler
111*0a6a1f1dSLionel SambucA pointer to an error handling function.
112*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Line
113*0a6a1f1dSLionel SambucA descriptor for a source line.
114*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Off
115*0a6a1f1dSLionel SambucAn unsigned file offset, corresponding to an
116*0a6a1f1dSLionel Sambuc.Vt off_t
117*0a6a1f1dSLionel Sambuctype supported by the underlying operating system.
118*0a6a1f1dSLionel Sambuc.It Vt Dwarf_P_Expr
119*0a6a1f1dSLionel SambucA descriptor for a location expression.
120*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Ptr
121*0a6a1f1dSLionel SambucA virtual address used by an application.
122*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Signed
123*0a6a1f1dSLionel SambucA 64-bit wide signed numeric type.
124*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Small
125*0a6a1f1dSLionel SambucAn 8-bit wide unsigned numeric type.
126*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Type
127*0a6a1f1dSLionel SambucA descriptor representing a user-specified type.
128*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Unsigned
129*0a6a1f1dSLionel SambucA 64-bit wide unsigned numeric type.
130*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Var
131*0a6a1f1dSLionel SambucA descriptor representing a static variable.
132*0a6a1f1dSLionel Sambuc.It Vt Dwarf_Weak
133*0a6a1f1dSLionel SambucA descriptor representing a weak name.
134*0a6a1f1dSLionel Sambuc.El
135*0a6a1f1dSLionel Sambuc.Ss Error Handling
136*0a6a1f1dSLionel Sambuc.Pp
137*0a6a1f1dSLionel SambucLibrary functions that encounter an error will return with a value
138*0a6a1f1dSLionel Sambucother than
139*0a6a1f1dSLionel Sambuc.Dv DW_DLV_OK .
140*0a6a1f1dSLionel Sambuc.Pp
141*0a6a1f1dSLionel SambucThe
142*0a6a1f1dSLionel Sambuc.Lb libdwarf
143*0a6a1f1dSLionel Sambucallows applications to specify three levels of error handling:
144*0a6a1f1dSLionel Sambuc.Bl -enum -compact
145*0a6a1f1dSLionel Sambuc.It
146*0a6a1f1dSLionel SambucMost library functions take a parameter of type
147*0a6a1f1dSLionel Sambuc.Vt Dwarf_Error
148*0a6a1f1dSLionel Sambucthat specifies a location to store an error descriptor in
149*0a6a1f1dSLionel Sambuccase of an error.
150*0a6a1f1dSLionel SambucIf an error occurs during the execution on an API, and if this
151*0a6a1f1dSLionel Sambucparameter is non-NULL, then an error descriptor is written to the
152*0a6a1f1dSLionel Sambuclocation specified.
153*0a6a1f1dSLionel Sambuc.It
154*0a6a1f1dSLionel SambucOtherwise, if the error parameter was NULL, but if an error handler
155*0a6a1f1dSLionel Sambucwas defined for the debug context in use using
156*0a6a1f1dSLionel Sambuc.Xr dwarf_init 3
157*0a6a1f1dSLionel Sambucor
158*0a6a1f1dSLionel Sambuc.Xr dwarf_seterrhand 3 ,
159*0a6a1f1dSLionel Sambucthen the library will invoke the specified error handler with an error
160*0a6a1f1dSLionel Sambucdescriptor as argument.
161*0a6a1f1dSLionel Sambuc.It
162*0a6a1f1dSLionel SambucOtherwise, if a library wide error handler was specified using
163*0a6a1f1dSLionel Sambuc.Xr dwarf_seterrhand 3 ,
164*0a6a1f1dSLionel Sambucit is called.
165*0a6a1f1dSLionel Sambuc.El
166*0a6a1f1dSLionel Sambuc.Pp
167*0a6a1f1dSLionel SambucError descriptors may be used with
168*0a6a1f1dSLionel Sambuc.Xr dwarf_errmsg 3
169*0a6a1f1dSLionel Sambucor
170*0a6a1f1dSLionel Sambuc.Xr dwarf_errno 3 .
171*0a6a1f1dSLionel Sambuc.Sh The DWARF Consumer API
172*0a6a1f1dSLionel SambucThe DWARF consumer API permits applications to read DWARF information in
173*0a6a1f1dSLionel Sambucan object file.
174*0a6a1f1dSLionel Sambuc.Pp
175*0a6a1f1dSLionel SambucThe major functional groups of functions in the consumer API are listed
176*0a6a1f1dSLionel Sambucbelow.
177*0a6a1f1dSLionel Sambuc.Pp
178*0a6a1f1dSLionel Sambuc.Bl -tag -compact -width "CCCC"
179*0a6a1f1dSLionel Sambuc.It Abbreviations
180*0a6a1f1dSLionel Sambuc.Bl -tag -compact
181*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_abbrev
182*0a6a1f1dSLionel SambucRetrieve abbreviation information at a given offset.
183*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_abbrev_children_flag
184*0a6a1f1dSLionel SambucCheck if an abbreviation has child elements.
185*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_abbrev_code
186*0a6a1f1dSLionel SambucRetrieve the abbreviation code for an abbreviation entry descriptor.
187*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_abbrev_entry
188*0a6a1f1dSLionel SambucRetrieve abbreviation information for an abbreviation entry
189*0a6a1f1dSLionel Sambucdescriptor.
190*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_abbrev_tag
191*0a6a1f1dSLionel SambucRetrieve the tag for an abbreviation entry.
192*0a6a1f1dSLionel Sambuc.El
193*0a6a1f1dSLionel Sambuc.It Addresses
194*0a6a1f1dSLionel Sambuc.Bl -tag -compact
195*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_address_size
196*0a6a1f1dSLionel SambucReturn the number of bytes needed to represent an address.
197*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_arange
198*0a6a1f1dSLionel SambucSearch for an address range descriptor covering an address.
199*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_arange_cu_header_offset
200*0a6a1f1dSLionel SambucRetrieve the offsets associated with an address range descriptor.
201*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_arange_info
202*0a6a1f1dSLionel SambucExtract address range information from a descriptor.
203*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_aranges
204*0a6a1f1dSLionel SambucRetrieve program address space mappings.
205*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_cu_die_offset
206*0a6a1f1dSLionel SambucRetrieve the offset associated with a compilation unit for an address
207*0a6a1f1dSLionel Sambucrange descriptor.
208*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_ranges , Fn dwarf_get_ranges_a
209*0a6a1f1dSLionel SambucRetrieve information about non-contiguous address ranges for
210*0a6a1f1dSLionel Sambuca debugging information entry.
211*0a6a1f1dSLionel Sambuc.El
212*0a6a1f1dSLionel Sambuc.It Attributes
213*0a6a1f1dSLionel Sambuc.Bl -tag -compact
214*0a6a1f1dSLionel Sambuc.It Fn dwarf_arrayorder
215*0a6a1f1dSLionel SambucRetrieve the value of a
216*0a6a1f1dSLionel Sambuc.Dv DW_AT_ordering
217*0a6a1f1dSLionel Sambucattribute.
218*0a6a1f1dSLionel Sambuc.It Fn dwarf_attr
219*0a6a1f1dSLionel SambucRetrieve an attribute descriptor.
220*0a6a1f1dSLionel Sambuc.It Fn dwarf_attrlist
221*0a6a1f1dSLionel SambucRetrieve attribute descriptors for a debugging information entry.
222*0a6a1f1dSLionel Sambuc.It Fn dwarf_attrval_flag
223*0a6a1f1dSLionel SambucRetrieve a
224*0a6a1f1dSLionel Sambuc.Dv DW_AT_FORM_flag
225*0a6a1f1dSLionel Sambucvalue.
226*0a6a1f1dSLionel Sambuc.It Fn dwarf_attrval_signed
227*0a6a1f1dSLionel SambucRetrieve an attribute's value as a signed integral quantity.
228*0a6a1f1dSLionel Sambuc.It Fn dwarf_attrval_string
229*0a6a1f1dSLionel SambucRetrieve an attribute's value as a NUL-terminated string.
230*0a6a1f1dSLionel Sambuc.It Fn dwarf_attrval_unsigned
231*0a6a1f1dSLionel SambucRetrieve an attribute's value as an unsigned integral quantity.
232*0a6a1f1dSLionel Sambuc.It Fn dwarf_bitoffset ,
233*0a6a1f1dSLionel SambucRetrieve the value of a
234*0a6a1f1dSLionel Sambuc.Dv DW_AT_bit_offset
235*0a6a1f1dSLionel Sambucattribute.
236*0a6a1f1dSLionel Sambuc.It Fn dwarf_bitsize ,
237*0a6a1f1dSLionel SambucRetrieve the value of a
238*0a6a1f1dSLionel Sambuc.Dv DW_AT_bit_size
239*0a6a1f1dSLionel Sambucattribute.
240*0a6a1f1dSLionel Sambuc.It Fn dwarf_bytesize
241*0a6a1f1dSLionel SambucRetrieve the value of a
242*0a6a1f1dSLionel Sambuc.Dv DW_AT_byte_size
243*0a6a1f1dSLionel Sambucattribute.
244*0a6a1f1dSLionel Sambuc.It Fn dwarf_formaddr
245*0a6a1f1dSLionel SambucReturn the value of an
246*0a6a1f1dSLionel Sambuc.Dv ADDRESS Ns - Ns
247*0a6a1f1dSLionel Sambucclass attribute.
248*0a6a1f1dSLionel Sambuc.It Fn dwarf_formblock
249*0a6a1f1dSLionel SambucReturn the value of a
250*0a6a1f1dSLionel Sambuc.Dv BLOCK Ns - Ns
251*0a6a1f1dSLionel Sambucclass attribute
252*0a6a1f1dSLionel Sambuc.It Fn dwarf_formexprloc
253*0a6a1f1dSLionel SambucReturn information about a location expression.
254*0a6a1f1dSLionel Sambuc.It Fn dwarf_formflag
255*0a6a1f1dSLionel SambucRetrieve information about a
256*0a6a1f1dSLionel Sambuc.Dv BOOLEAN Ns - Ns
257*0a6a1f1dSLionel Sambucclass attribute.
258*0a6a1f1dSLionel Sambuc.It Fn dwarf_formref , Fn dwarf_global_formref
259*0a6a1f1dSLionel SambucRetrieve offsets for
260*0a6a1f1dSLionel Sambuc.Dv REFERENCE Ns - Ns
261*0a6a1f1dSLionel Sambucclass attributes.
262*0a6a1f1dSLionel Sambuc.It Fn dwarf_formsdata , Fn dwarf_formudata
263*0a6a1f1dSLionel SambucRetrieve the value of a
264*0a6a1f1dSLionel Sambuc.Dv CONSTANT Ns - Ns
265*0a6a1f1dSLionel Sambucclass attribute.
266*0a6a1f1dSLionel Sambuc.It Fn dwarf_formsig8
267*0a6a1f1dSLionel SambucReturn the type signature for a DWARF type.
268*0a6a1f1dSLionel Sambuc.It Fn dwarf_formstring
269*0a6a1f1dSLionel SambucRetrieve information about a
270*0a6a1f1dSLionel Sambuc.Dv STRING Ns - Ns
271*0a6a1f1dSLionel Sambucclass attribute.
272*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_form_class
273*0a6a1f1dSLionel SambucRetrieve the form class for an attribute.
274*0a6a1f1dSLionel Sambuc.It Fn dwarf_hasattr
275*0a6a1f1dSLionel SambucCheck for the presence of an attribute.
276*0a6a1f1dSLionel Sambuc.It Fn dwarf_hasform
277*0a6a1f1dSLionel SambucCheck if an attribute has the given form.
278*0a6a1f1dSLionel Sambuc.It Fn dwarf_whatattr
279*0a6a1f1dSLionel SambucRetrieve the attribute code for an attribute.
280*0a6a1f1dSLionel Sambuc.It Fn dwarf_whatform , Fn dwarf_whatform_direct
281*0a6a1f1dSLionel SambucRetrieve the form of an attribute.
282*0a6a1f1dSLionel Sambuc.El
283*0a6a1f1dSLionel Sambuc.It Call Information Entries and Frame Descriptor Entries
284*0a6a1f1dSLionel Sambuc.Bl -tag -compact
285*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_cie_index
286*0a6a1f1dSLionel SambucRetrieve the index for a CIE descriptor.
287*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_cie_info
288*0a6a1f1dSLionel SambucRetrieve information from a CIE descriptor.
289*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_cie_of_fde
290*0a6a1f1dSLionel SambucRetrieve a CIE descriptor.
291*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_fde_at_pc
292*0a6a1f1dSLionel SambucRetrieve an FDE descriptor for an address.
293*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_fde_info_for_all_regs
294*0a6a1f1dSLionel SambucRetrieve register rule row.
295*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_fde_info_for_all_regs3
296*0a6a1f1dSLionel SambucRetrieve register rule row (revised API).
297*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_fde_info_for_cfa_reg3
298*0a6a1f1dSLionel SambucRetrieve a CFA register rule.
299*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_fde_info_for_reg
300*0a6a1f1dSLionel SambucRetrieve a register rule.
301*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_fde_info_for_reg3
302*0a6a1f1dSLionel SambucRetrieve a register rule (revised API).
303*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_fde_instr_bytes
304*0a6a1f1dSLionel SambucRetrieve instructions from an FDE descriptor.
305*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_fde_list , Fn dwarf_get_fde_list_eh
306*0a6a1f1dSLionel SambucRetrieve frame information.
307*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_fde_n
308*0a6a1f1dSLionel SambucRetrieve an FDE descriptor.
309*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_fde_range
310*0a6a1f1dSLionel SambucRetrieve range information from an FDE descriptor.
311*0a6a1f1dSLionel Sambuc.El
312*0a6a1f1dSLionel Sambuc.It Compilation Units
313*0a6a1f1dSLionel Sambuc.Bl -tag -compact
314*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_cu_die_offset_given_cu_header_offset
315*0a6a1f1dSLionel SambucRetrieve the offset of the debugging information entry for a
316*0a6a1f1dSLionel Sambuccompilation unit.
317*0a6a1f1dSLionel Sambuc.It Fn dwarf_next_cu_header , Fn dwarf_next_cu_header_b
318*0a6a1f1dSLionel SambucStep through compilation units in a debug context.
319*0a6a1f1dSLionel Sambuc.El
320*0a6a1f1dSLionel Sambuc.It Debugging Information Entries
321*0a6a1f1dSLionel Sambuc.Bl -tag -compact
322*0a6a1f1dSLionel Sambuc.It Fn dwarf_child
323*0a6a1f1dSLionel SambucReturns the child of a debugging information entry.
324*0a6a1f1dSLionel Sambuc.It Fn dwarf_die_abbrev_code
325*0a6a1f1dSLionel SambucReturns the abbreviation code for a debugging information entry.
326*0a6a1f1dSLionel Sambuc.It Fn dwarf_die_CU_offset , Fn dwarf_die_CU_offset_range
327*0a6a1f1dSLionel SambucRetrieve offsets and lengths for a compilation unit.
328*0a6a1f1dSLionel Sambuc.It Fn dwarf_diename
329*0a6a1f1dSLionel SambucReturns the
330*0a6a1f1dSLionel Sambuc.Dv DW_AT_name
331*0a6a1f1dSLionel Sambucattribute for a debugging information entry.
332*0a6a1f1dSLionel Sambuc.It Fn dwarf_dieoffset
333*0a6a1f1dSLionel SambucRetrieves the offset for a debugging information entry.
334*0a6a1f1dSLionel Sambuc.It Fn dwarf_highpc
335*0a6a1f1dSLionel SambucReturn the highest PC value for a debugging information entry.
336*0a6a1f1dSLionel Sambuc.It Fn dwarf_lowpc
337*0a6a1f1dSLionel SambucReturn the lowest PC value for a debugging information entry.
338*0a6a1f1dSLionel Sambuc.It Fn dwarf_offdie
339*0a6a1f1dSLionel SambucRetrieve a debugging information entry given an offset.
340*0a6a1f1dSLionel Sambuc.It Fn dwarf_siblingof
341*0a6a1f1dSLionel SambucRetrieve the sibling descriptor for a debugging information entry.
342*0a6a1f1dSLionel Sambuc.It Fn dwarf_srclang
343*0a6a1f1dSLionel SambucRetrive the source language attribute for a debugging information
344*0a6a1f1dSLionel Sambucentry.
345*0a6a1f1dSLionel Sambuc.It Fn dwarf_tag
346*0a6a1f1dSLionel SambucRetrieve the tag for a debugging information entry.
347*0a6a1f1dSLionel Sambuc.El
348*0a6a1f1dSLionel Sambuc.It Functions
349*0a6a1f1dSLionel Sambuc.Bl -tag -compact
350*0a6a1f1dSLionel Sambuc.It Fn dwarf_func_cu_offset
351*0a6a1f1dSLionel SambucRetrieves the offset for the compilation unit for a function.
352*0a6a1f1dSLionel Sambuc.It Fn dwarf_func_die_offset
353*0a6a1f1dSLionel SambucRetrieves the offset for the debugging information entry for a
354*0a6a1f1dSLionel Sambucfunction.
355*0a6a1f1dSLionel Sambuc.It Fn dwarf_funcname
356*0a6a1f1dSLionel SambucRetrieves the name of a function.
357*0a6a1f1dSLionel Sambuc.It Fn dwarf_func_name_offsets
358*0a6a1f1dSLionel SambucRetrieve both the name and offsets for a function.
359*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_funcs
360*0a6a1f1dSLionel SambucRetrieve information about static functions.
361*0a6a1f1dSLionel Sambuc.El
362*0a6a1f1dSLionel Sambuc.It Globals
363*0a6a1f1dSLionel Sambuc.Bl -tag -compact
364*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_globals
365*0a6a1f1dSLionel SambucRetrieve a list of globals.
366*0a6a1f1dSLionel Sambuc.It Fn dwarf_global_cu_offset
367*0a6a1f1dSLionel SambucReturn the offset for compilation unit for a global.
368*0a6a1f1dSLionel Sambuc.It Fn dwarf_global_die_offset
369*0a6a1f1dSLionel SambucReturn the offset for the debugging information entry for a global.
370*0a6a1f1dSLionel Sambuc.It Fn dwarf_global_name_offsets
371*0a6a1f1dSLionel SambucReturn the name and offsets for a global.
372*0a6a1f1dSLionel Sambuc.It Fn dwarf_globname
373*0a6a1f1dSLionel SambucReturn the name for a global.
374*0a6a1f1dSLionel Sambuc.El
375*0a6a1f1dSLionel Sambuc.It Initialization and Finalization
376*0a6a1f1dSLionel SambucFunctions
377*0a6a1f1dSLionel Sambuc.Fn dwarf_elf_init
378*0a6a1f1dSLionel Sambucand
379*0a6a1f1dSLionel Sambuc.Fn dwarf_init
380*0a6a1f1dSLionel Sambucmay be used for initialization.
381*0a6a1f1dSLionel SambucThe function
382*0a6a1f1dSLionel Sambuc.Fn dwarf_finish
383*0a6a1f1dSLionel Sambucmay be used to release resources.
384*0a6a1f1dSLionel Sambuc.Pp
385*0a6a1f1dSLionel SambucThe functions
386*0a6a1f1dSLionel Sambuc.Fn dwarf_object_init
387*0a6a1f1dSLionel Sambucand
388*0a6a1f1dSLionel Sambuc.Fn dwarf_object_finish
389*0a6a1f1dSLionel Sambucallow an application to specify alternate low-level file access
390*0a6a1f1dSLionel Sambucroutines.
391*0a6a1f1dSLionel Sambuc.It Line Numbers
392*0a6a1f1dSLionel Sambuc.Bl -tag -compact
393*0a6a1f1dSLionel Sambuc.It Fn dwarf_lineaddr
394*0a6a1f1dSLionel SambucRetrieve the program address for a source line.
395*0a6a1f1dSLionel Sambuc.It Fn dwarf_linebeginstatement
396*0a6a1f1dSLionel SambucCheck if a source line corresponds to the beginning of a statement.
397*0a6a1f1dSLionel Sambuc.It Fn dwarf_lineblock
398*0a6a1f1dSLionel SambucCheck if a source line corresponds to the start of a basic block.
399*0a6a1f1dSLionel Sambuc.It Fn dwarf_lineendsequence
400*0a6a1f1dSLionel SambucCheck if the source line corresponds to the end of a sequence of
401*0a6a1f1dSLionel Sambucinstructions.
402*0a6a1f1dSLionel Sambuc.It Fn dwarf_lineno
403*0a6a1f1dSLionel SambucRetrieve the line number for a line descriptor.
404*0a6a1f1dSLionel Sambuc.It Fn dwarf_lineoff
405*0a6a1f1dSLionel SambucRetrieve the column number for a line descriptor.
406*0a6a1f1dSLionel Sambuc.It Fn dwarf_linesrc
407*0a6a1f1dSLionel SambucRetrieve the source file for a line descriptor.
408*0a6a1f1dSLionel Sambuc.It Fn dwarf_line_srcfileno
409*0a6a1f1dSLionel SambucRetrieve the index of the source file for a line descriptor.
410*0a6a1f1dSLionel Sambuc.It Fn dwarf_srcfiles
411*0a6a1f1dSLionel SambucRetrieve source files for a compilation unit.
412*0a6a1f1dSLionel Sambuc.It Fn dwarf_srclines
413*0a6a1f1dSLionel SambucReturn line number information for a compilation unit.
414*0a6a1f1dSLionel Sambuc.El
415*0a6a1f1dSLionel Sambuc.It Location Lists
416*0a6a1f1dSLionel Sambuc.Bl -tag -compact
417*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_loclist_entry
418*0a6a1f1dSLionel SambucRetrieve a location list entry.
419*0a6a1f1dSLionel Sambuc.It Fn dwarf_loclist , Fn dwarf_loclist_n
420*0a6a1f1dSLionel SambucRetrieve location expressions.
421*0a6a1f1dSLionel Sambuc.It Fn dwarf_loclist_from_expr , Fn dwarf_loclist_from_expr_a
422*0a6a1f1dSLionel SambucTranslate a location expression into a location descriptor.
423*0a6a1f1dSLionel Sambuc.El
424*0a6a1f1dSLionel Sambuc.It Error Handling
425*0a6a1f1dSLionel Sambuc.Bl -tag -compact
426*0a6a1f1dSLionel Sambuc.It Fn dwarf_errmsg
427*0a6a1f1dSLionel SambucRetrieve a human-readable error message.
428*0a6a1f1dSLionel Sambuc.It Fn dwarf_errno
429*0a6a1f1dSLionel SambucRetrieve an error number from an error descriptor.
430*0a6a1f1dSLionel Sambuc.It Fn dwarf_seterrarg
431*0a6a1f1dSLionel SambucSet the argument passed to a callback error handler.
432*0a6a1f1dSLionel Sambuc.It Fn dwarf_seterrhand
433*0a6a1f1dSLionel SambucSet the callback handler to be called in case of an error.
434*0a6a1f1dSLionel Sambuc.El
435*0a6a1f1dSLionel Sambuc.It Frame Handling
436*0a6a1f1dSLionel Sambuc.Bl -tag -compact
437*0a6a1f1dSLionel Sambuc.It Fn dwarf_expand_frame_instructions
438*0a6a1f1dSLionel SambucTranslate frame instruction bytes.
439*0a6a1f1dSLionel Sambuc.It Fn dwarf_set_frame_cfa_value
440*0a6a1f1dSLionel SambucSet the CFA parameter for the internal register rule table.
441*0a6a1f1dSLionel Sambuc.It Fn dwarf_set_frame_rule_initial_value
442*0a6a1f1dSLionel SambucSet the initial value of the register rules in the internal register
443*0a6a1f1dSLionel Sambucrule table.
444*0a6a1f1dSLionel Sambuc.It Fn dwarf_set_frame_rule_table_size
445*0a6a1f1dSLionel SambucSet the maximum number of columns in the register rule table.
446*0a6a1f1dSLionel Sambuc.It Fn dwarf_set_frame_same_value
447*0a6a1f1dSLionel SambucSet the register number representing the
448*0a6a1f1dSLionel Sambuc.Dq "same value"
449*0a6a1f1dSLionel Sambucrule.
450*0a6a1f1dSLionel Sambuc.It Fn dwarf_set_frame_undefined_value
451*0a6a1f1dSLionel SambucSet the register number representing the
452*0a6a1f1dSLionel Sambuc.Dq "undefined"
453*0a6a1f1dSLionel Sambucrule.
454*0a6a1f1dSLionel Sambuc.El
455*0a6a1f1dSLionel Sambuc.It Macros
456*0a6a1f1dSLionel Sambuc.Bl -tag -compact
457*0a6a1f1dSLionel Sambuc.It Fn dwarf_find_macro_value_start
458*0a6a1f1dSLionel SambucReturn the macro value part of a macro string.
459*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_macro_details
460*0a6a1f1dSLionel SambucRetrieve macro information.
461*0a6a1f1dSLionel Sambuc.El
462*0a6a1f1dSLionel Sambuc.It Memory Management
463*0a6a1f1dSLionel SambucIn the DWARF consumer API, the rules for memory management differ
464*0a6a1f1dSLionel Sambucbetween functions.
465*0a6a1f1dSLionel SambucIn some cases, the memory areas returned to the application by the
466*0a6a1f1dSLionel Sambuclibrary are freed by calling specific API functions.
467*0a6a1f1dSLionel SambucIn others, the deallocation function
468*0a6a1f1dSLionel Sambuc.Fn dwarf_dealloc
469*0a6a1f1dSLionel Sambucsuffices.
470*0a6a1f1dSLionel SambucThe individual manual pages for the API's functions document the
471*0a6a1f1dSLionel Sambucspecific memory management rules to be followed.
472*0a6a1f1dSLionel Sambuc.Pp
473*0a6a1f1dSLionel SambucThe function
474*0a6a1f1dSLionel Sambuc.Fn dwarf_dealloc
475*0a6a1f1dSLionel Sambucis used to mark memory arenas as unused.
476*0a6a1f1dSLionel SambucAdditionally, the following functions release specific types of
477*0a6a1f1dSLionel SambucDWARF resources:
478*0a6a1f1dSLionel Sambuc.Fn dwarf_fde_cie_list_dealloc ,
479*0a6a1f1dSLionel Sambuc.Fn dwarf_funcs_dealloc ,
480*0a6a1f1dSLionel Sambuc.Fn dwarf_globals_dealloc ,
481*0a6a1f1dSLionel Sambuc.Fn dwarf_pubtypes_dealloc ,
482*0a6a1f1dSLionel Sambuc.Fn dwarf_ranges_dealloc ,
483*0a6a1f1dSLionel Sambuc.Fn dwarf_srclines_dealloc ,
484*0a6a1f1dSLionel Sambuc.Fn dwarf_types_dealloc ,
485*0a6a1f1dSLionel Sambuc.Fn dwarf_vars_dealloc ,
486*0a6a1f1dSLionel Sambucand
487*0a6a1f1dSLionel Sambuc.Fn dwarf_weaks_dealloc .
488*0a6a1f1dSLionel Sambuc.It Symbol Constants
489*0a6a1f1dSLionel SambucThe following functions may be used to return symbolic names
490*0a6a1f1dSLionel Sambucfor DWARF constants:
491*0a6a1f1dSLionel Sambuc.Fn dwarf_get_ACCESS_name ,
492*0a6a1f1dSLionel Sambuc.Fn dwarf_get_AT_name ,
493*0a6a1f1dSLionel Sambuc.Fn dwarf_get_ATE_name ,
494*0a6a1f1dSLionel Sambuc.Fn dwarf_get_CC_name ,
495*0a6a1f1dSLionel Sambuc.Fn dwarf_get_CFA_name ,
496*0a6a1f1dSLionel Sambuc.Fn dwarf_get_CHILDREN_name ,
497*0a6a1f1dSLionel Sambuc.Fn dwarf_get_DS_name ,
498*0a6a1f1dSLionel Sambuc.Fn dwarf_get_DSC_name ,
499*0a6a1f1dSLionel Sambuc.Fn dwarf_get_EH_name ,
500*0a6a1f1dSLionel Sambuc.Fn dwarf_get_END_name ,
501*0a6a1f1dSLionel Sambuc.Fn dwarf_get_FORM_name ,
502*0a6a1f1dSLionel Sambuc.Fn dwarf_get_ID_name ,
503*0a6a1f1dSLionel Sambuc.Fn dwarf_get_INL_name ,
504*0a6a1f1dSLionel Sambuc.Fn dwarf_get_LANG_name ,
505*0a6a1f1dSLionel Sambuc.Fn dwarf_get_LNE_name ,
506*0a6a1f1dSLionel Sambuc.Fn dwarf_get_LNS_name ,
507*0a6a1f1dSLionel Sambuc.Fn dwarf_get_MACINFO_name ,
508*0a6a1f1dSLionel Sambuc.Fn dwarf_get_OP_name ,
509*0a6a1f1dSLionel Sambuc.Fn dwarf_get_ORD_name ,
510*0a6a1f1dSLionel Sambuc.Fn dwarf_get_TAG_name ,
511*0a6a1f1dSLionel Sambuc.Fn dwarf_get_VIRTUALITY_name ,
512*0a6a1f1dSLionel Sambucand
513*0a6a1f1dSLionel Sambuc.Fn dwarf_get_VIS_name .
514*0a6a1f1dSLionel Sambuc.It Types
515*0a6a1f1dSLionel Sambuc.Bl -tag -compact
516*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_pubtypes , Fn dwarf_get_types
517*0a6a1f1dSLionel SambucRetrieve descriptors for user-defined types.
518*0a6a1f1dSLionel Sambuc.It Fn dwarf_pubtype_cu_offset , Fn dwarf_type_cu_offset
519*0a6a1f1dSLionel SambucReturn the offset for the compilation unit for a type.
520*0a6a1f1dSLionel Sambuc.It Fn dwarf_pubtype_die_offset , Fn dwarf_type_die_offset
521*0a6a1f1dSLionel SambucReturn the offset for the debugging information entry for a type.
522*0a6a1f1dSLionel Sambuc.It Fn dwarf_pubtypename , Fn dwarf_typename
523*0a6a1f1dSLionel SambucRetrieve the name of a type.
524*0a6a1f1dSLionel Sambuc.It Fn dwarf_pubtype_name_offsets , Fn dwarf_type_name_offsets
525*0a6a1f1dSLionel SambucRetrieve the name and offsets for a type.
526*0a6a1f1dSLionel Sambuc.El
527*0a6a1f1dSLionel Sambuc.It Variables
528*0a6a1f1dSLionel Sambuc.Bl -tag -compact
529*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_vars
530*0a6a1f1dSLionel SambucRetrieve descriptors for static variables.
531*0a6a1f1dSLionel Sambuc.It Fn dwarf_var_cu_offset
532*0a6a1f1dSLionel SambucReturn the offset for the compilation unit for a variable.
533*0a6a1f1dSLionel Sambuc.It Fn dwarf_var_die_offset
534*0a6a1f1dSLionel SambucReturn the offset for the debugging information entry for a variable.
535*0a6a1f1dSLionel Sambuc.It Fn dwarf_varname
536*0a6a1f1dSLionel SambucRetrieve the name of a variable.
537*0a6a1f1dSLionel Sambuc.It Fn dwarf_var_name_offsets
538*0a6a1f1dSLionel SambucRetrieve the name and offsets for a variable.
539*0a6a1f1dSLionel Sambuc.El
540*0a6a1f1dSLionel Sambuc.It Weak Symbols
541*0a6a1f1dSLionel Sambuc.Bl -tag -compact
542*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_weaks
543*0a6a1f1dSLionel SambucRetrieve information about weak symbols.
544*0a6a1f1dSLionel Sambuc.It Fn dwarf_weak_cu_offset
545*0a6a1f1dSLionel SambucReturn the offset for the compilation unit for a weak symbol.
546*0a6a1f1dSLionel Sambuc.It Fn dwarf_weak_die_offset
547*0a6a1f1dSLionel SambucReturn the offset for the debugging information entry for a weak symbol.
548*0a6a1f1dSLionel Sambuc.It Fn dwarf_weakname
549*0a6a1f1dSLionel SambucRetrieve the name of a weak symbol.
550*0a6a1f1dSLionel Sambuc.It Fn dwarf_weak_name_offsets
551*0a6a1f1dSLionel SambucRetrieve the name and offsets for a weak symbol.
552*0a6a1f1dSLionel Sambuc.El
553*0a6a1f1dSLionel Sambuc.It Miscellaneous
554*0a6a1f1dSLionel Sambuc.Bl -tag -compact
555*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_elf
556*0a6a1f1dSLionel SambucRetrieve the ELF descriptor for a debug context, see
557*0a6a1f1dSLionel Sambuc.Xr elf 3 .
558*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_str
559*0a6a1f1dSLionel SambucRetrieve a NUL-terminated string from the DWARF string section.
560*0a6a1f1dSLionel Sambuc.It Fn dwarf_set_reloc_application
561*0a6a1f1dSLionel SambucControl whether relocations are to be handled by
562*0a6a1f1dSLionel Sambuc.Lb libdwarf .
563*0a6a1f1dSLionel Sambuc.El
564*0a6a1f1dSLionel Sambuc.El
565*0a6a1f1dSLionel Sambuc.Sh The DWARF Producer API
566*0a6a1f1dSLionel SambucThe DWARF producer API permits applications to add DWARF information to
567*0a6a1f1dSLionel Sambucan object file.
568*0a6a1f1dSLionel Sambuc.Pp
569*0a6a1f1dSLionel SambucThe major functional groups of functions in the producer API are listed
570*0a6a1f1dSLionel Sambucbelow.
571*0a6a1f1dSLionel Sambuc.Bl -tag -width "CCCC"
572*0a6a1f1dSLionel Sambuc.It Attribute Management
573*0a6a1f1dSLionel SambucThe following functions are used to attach attributes to a debugging
574*0a6a1f1dSLionel Sambucinformation entry:
575*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_comp_dir ,
576*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_const_value_signedint ,
577*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_const_value_string ,
578*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_const_value_unsignedint ,
579*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_dataref ,
580*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_flag ,
581*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_location_expr ,
582*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_name ,
583*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_producer ,
584*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_ref_address ,
585*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_reference ,
586*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_signed_const ,
587*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_string ,
588*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_targ_address ,
589*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_targ_address_b
590*0a6a1f1dSLionel Sambucand
591*0a6a1f1dSLionel Sambuc.Fn dwarf_add_AT_unsigned_const .
592*0a6a1f1dSLionel Sambuc.It Debugging Information Entry Management
593*0a6a1f1dSLionel Sambuc.Bl -tag -compact
594*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_die_to_debug
595*0a6a1f1dSLionel SambucSet the root debugging information entry for a DWARF producer instance.
596*0a6a1f1dSLionel Sambuc.It Fn dwarf_die_link
597*0a6a1f1dSLionel SambucLinks debugging information entries.
598*0a6a1f1dSLionel Sambuc.It Fn dwarf_new_die
599*0a6a1f1dSLionel SambucAllocate a new debugging information entry.
600*0a6a1f1dSLionel Sambuc.El
601*0a6a1f1dSLionel Sambuc.It Initialization and Finalization
602*0a6a1f1dSLionel SambucThe functions
603*0a6a1f1dSLionel Sambuc.Fn dwarf_producer_init
604*0a6a1f1dSLionel Sambucand
605*0a6a1f1dSLionel Sambuc.Fn dwarf_producer_init_b
606*0a6a1f1dSLionel Sambucare used to initialize a producer instance.
607*0a6a1f1dSLionel Sambuc.Pp
608*0a6a1f1dSLionel SambucWhen done, applications release resources using the function
609*0a6a1f1dSLionel Sambuc.Fn dwarf_producer_finish .
610*0a6a1f1dSLionel Sambuc.It Relocations and Sections
611*0a6a1f1dSLionel Sambuc.Bl -tag -compact
612*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_relocation_info
613*0a6a1f1dSLionel SambucRetrieve a relocation array from a producer instance.
614*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_relocation_info_count
615*0a6a1f1dSLionel SambucReturn the number of relocation arrays for a producer instance.
616*0a6a1f1dSLionel Sambuc.It Fn dwarf_get_section_bytes
617*0a6a1f1dSLionel SambucRetrieve the ELF byte stream for a section.
618*0a6a1f1dSLionel Sambuc.It Fn dwarf_reset_section_bytes
619*0a6a1f1dSLionel SambucReset internal state for a producer instance.
620*0a6a1f1dSLionel Sambuc.It Fn dwarf_transform_to_disk_form
621*0a6a1f1dSLionel SambucPrepare byte streams for writing out.
622*0a6a1f1dSLionel Sambuc.El
623*0a6a1f1dSLionel Sambuc.It Macros
624*0a6a1f1dSLionel Sambuc.Bl -tag -compact
625*0a6a1f1dSLionel Sambuc.It Fn dwarf_def_macro
626*0a6a1f1dSLionel SambucAdd a macro definition.
627*0a6a1f1dSLionel Sambuc.It Fn dwarf_end_macro_file , Fn dwarf_start_macro_file
628*0a6a1f1dSLionel SambucRecord macro file related information.
629*0a6a1f1dSLionel Sambuc.It Fn dwarf_undef_macro
630*0a6a1f1dSLionel SambucNote the removal of a macro definition.
631*0a6a1f1dSLionel Sambuc.It Fn dwarf_vendor_ext
632*0a6a1f1dSLionel SambucEnables storing macro information as specified in the DWARF standard.
633*0a6a1f1dSLionel Sambuc.El
634*0a6a1f1dSLionel Sambuc.It Symbols, Expressions, Addresses and Offsets
635*0a6a1f1dSLionel Sambuc.Bl -tag -compact
636*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_arange , Fn dwarf_add_arange_b
637*0a6a1f1dSLionel SambucAdd address range information.
638*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_directory_decl
639*0a6a1f1dSLionel SambucAdd information about an include directory to a producer instance.
640*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_fde_inst
641*0a6a1f1dSLionel SambucAdd an operation to a frame descriptor entry.
642*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_file_decl
643*0a6a1f1dSLionel SambucAdd information about a source file to a producer instance.
644*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_frame_cie
645*0a6a1f1dSLionel SambucAdd call information to a frame descriptor.
646*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_frame_fde , Fn dwarf_add_frame_fde_b
647*0a6a1f1dSLionel SambucLink a frame descriptor to a producer instance.
648*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_funcname
649*0a6a1f1dSLionel SambucAdd information about a function to a producer instance.
650*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_line_entry
651*0a6a1f1dSLionel SambucRecord mapping information between machine addresses and a source line.
652*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_expr_addr , Fn dwarf_add_expr_addr_b
653*0a6a1f1dSLionel SambucAdd a
654*0a6a1f1dSLionel Sambuc.Dv DW_OP_addr
655*0a6a1f1dSLionel Sambucopcode to a location expression.
656*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_expr_gen
657*0a6a1f1dSLionel SambucAdd an operator to a location expression.
658*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_pubname
659*0a6a1f1dSLionel SambucAdd information about a global name to a producer instance.
660*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_typename
661*0a6a1f1dSLionel SambucAdd information about a type to a producer instance.
662*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_varname
663*0a6a1f1dSLionel SambucAdd information about a static variable to a producer instance.
664*0a6a1f1dSLionel Sambuc.It Fn dwarf_add_weakname
665*0a6a1f1dSLionel SambucAdd information about a weak symbol to a producer instance.
666*0a6a1f1dSLionel Sambuc.It Fn dwarf_expr_current_offset
667*0a6a1f1dSLionel SambucRetrieve the current size of a location expression.
668*0a6a1f1dSLionel Sambuc.It Fn dwarf_expr_into_block
669*0a6a1f1dSLionel SambucConvert a location expression into a byte stream.
670*0a6a1f1dSLionel Sambuc.It Fn dwarf_fde_cfa_offset
671*0a6a1f1dSLionel SambucAppend a
672*0a6a1f1dSLionel Sambuc.Dv DW_CFA_offset
673*0a6a1f1dSLionel Sambucoperation to a frame descriptor.
674*0a6a1f1dSLionel Sambuc.It Fn dwarf_lne_end_sequence , Fn dwarf_lne_set_address
675*0a6a1f1dSLionel SambucNote address ranges for source lines.
676*0a6a1f1dSLionel Sambuc.It Fn dwarf_new_expr
677*0a6a1f1dSLionel SambucAllocate a location expression descriptor.
678*0a6a1f1dSLionel Sambuc.It Fn dwarf_new_fde
679*0a6a1f1dSLionel SambucAllocate a frame descriptor.
680*0a6a1f1dSLionel Sambuc.El
681*0a6a1f1dSLionel Sambuc.It Miscellaneous
682*0a6a1f1dSLionel SambucThe function
683*0a6a1f1dSLionel Sambuc.Fn dwarf_producer_set_isa
684*0a6a1f1dSLionel Sambucsets the instruction set architecture for the producer instance.
685*0a6a1f1dSLionel Sambuc.El
686*0a6a1f1dSLionel Sambuc.Sh COMPATIBILITY
687*0a6a1f1dSLionel SambucThis implementation is believed to be source compatible with the
688*0a6a1f1dSLionel SambucSGI/GNU DWARF(3) library, version 20110113.
689*0a6a1f1dSLionel Sambuc.Pp
690*0a6a1f1dSLionel SambucKnown differences with the SGI/GNU library include:
691*0a6a1f1dSLionel Sambuc.Bl -bullet -compact
692*0a6a1f1dSLionel Sambuc.It
693*0a6a1f1dSLionel SambucThe memory management scheme used differs, in a backward-compatible
694*0a6a1f1dSLionel Sambucway.
695*0a6a1f1dSLionel SambucSee
696*0a6a1f1dSLionel Sambuc.Sx Memory Management
697*0a6a1f1dSLionel Sambucabove, for coding guidelines for portable applications.
698*0a6a1f1dSLionel Sambuc.It
699*0a6a1f1dSLionel SambucThere is provision for setting a library-wide error handler in
700*0a6a1f1dSLionel Sambucaddition to the per-debug context handlers supported by the SGI/GNU
701*0a6a1f1dSLionel SambucAPI, see the subsection
702*0a6a1f1dSLionel Sambuc.Sx Error Handling
703*0a6a1f1dSLionel Sambucabove.
704*0a6a1f1dSLionel Sambuc.It
705*0a6a1f1dSLionel SambucThe following API is an extension:
706*0a6a1f1dSLionel Sambuc.Fn dwarf_producer_set_isa .
707*0a6a1f1dSLionel Sambuc.El
708*0a6a1f1dSLionel Sambuc.Sh SEE ALSO
709*0a6a1f1dSLionel Sambuc.Xr elf 3
710*0a6a1f1dSLionel Sambuc.Sh STANDARDS
711*0a6a1f1dSLionel SambucThe DWARF standard is defined by
712*0a6a1f1dSLionel Sambuc.Rs
713*0a6a1f1dSLionel Sambuc.%T "The DWARF Debugging Information Format"
714*0a6a1f1dSLionel Sambuc.%V "Version 4"
715*0a6a1f1dSLionel Sambuc.%O "http://www.dwarfstd.org/"
716*0a6a1f1dSLionel Sambuc.Re
717*0a6a1f1dSLionel Sambuc.Sh HISTORY
718*0a6a1f1dSLionel SambucThe DWARF(3) API originated at Silicon Graphics Inc.
719*0a6a1f1dSLionel Sambuc.Pp
720*0a6a1f1dSLionel SambucA BSD-licensed implementation of a subset of the API was written by
721*0a6a1f1dSLionel Sambuc.An "John Birrell" Aq jb@FreeBSD.org
722*0a6a1f1dSLionel Sambucfor the FreeBSD project.
723*0a6a1f1dSLionel SambucThe implementation was subsequently revised and completed by
724*0a6a1f1dSLionel Sambuc.An "Kai Wang" Aq kaiwang27@users.sourceforge.net .
725*0a6a1f1dSLionel Sambuc.Pp
726*0a6a1f1dSLionel SambucManual pages for this implementation were written by
727*0a6a1f1dSLionel Sambuc.An "Joseph Koshy" Aq jkoshy@users.sourceforge.net
728*0a6a1f1dSLionel Sambucand
729*0a6a1f1dSLionel Sambuc.An "Kai Wang" Aq kaiwang27@users.sourceforge.net .
730