xref: /minix3/external/bsd/elftoolchain/dist/libdwarf/dwarf_highpc.3 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc.\"	$NetBSD: dwarf_highpc.3,v 1.2 2014/03/09 16:58:04 christos Exp $
2*0a6a1f1dSLionel Sambuc.\"
3*0a6a1f1dSLionel Sambuc.\" Copyright (c) 2010 Kai Wang
4*0a6a1f1dSLionel Sambuc.\" All rights reserved.
5*0a6a1f1dSLionel Sambuc.\"
6*0a6a1f1dSLionel Sambuc.\" Redistribution and use in source and binary forms, with or without
7*0a6a1f1dSLionel Sambuc.\" modification, are permitted provided that the following conditions
8*0a6a1f1dSLionel Sambuc.\" are met:
9*0a6a1f1dSLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright
10*0a6a1f1dSLionel Sambuc.\"    notice, this list of conditions and the following disclaimer.
11*0a6a1f1dSLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright
12*0a6a1f1dSLionel Sambuc.\"    notice, this list of conditions and the following disclaimer in the
13*0a6a1f1dSLionel Sambuc.\"    documentation and/or other materials provided with the distribution.
14*0a6a1f1dSLionel Sambuc.\"
15*0a6a1f1dSLionel Sambuc.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16*0a6a1f1dSLionel Sambuc.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17*0a6a1f1dSLionel Sambuc.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18*0a6a1f1dSLionel Sambuc.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19*0a6a1f1dSLionel Sambuc.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20*0a6a1f1dSLionel Sambuc.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21*0a6a1f1dSLionel Sambuc.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22*0a6a1f1dSLionel Sambuc.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23*0a6a1f1dSLionel Sambuc.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24*0a6a1f1dSLionel Sambuc.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25*0a6a1f1dSLionel Sambuc.\" SUCH DAMAGE.
26*0a6a1f1dSLionel Sambuc.\"
27*0a6a1f1dSLionel Sambuc.\" Id: dwarf_highpc.3 2073 2011-10-27 03:30:47Z jkoshy
28*0a6a1f1dSLionel Sambuc.\"
29*0a6a1f1dSLionel Sambuc.Dd April 7, 2010
30*0a6a1f1dSLionel Sambuc.Os
31*0a6a1f1dSLionel Sambuc.Dt DWARF_HIGHPC 3
32*0a6a1f1dSLionel Sambuc.Sh NAME
33*0a6a1f1dSLionel Sambuc.Nm dwarf_arrayorder ,
34*0a6a1f1dSLionel Sambuc.Nm dwarf_bitoffset ,
35*0a6a1f1dSLionel Sambuc.Nm dwarf_bitsize ,
36*0a6a1f1dSLionel Sambuc.Nm dwarf_bytesize ,
37*0a6a1f1dSLionel Sambuc.Nm dwarf_highpc ,
38*0a6a1f1dSLionel Sambuc.Nm dwarf_lowpc ,
39*0a6a1f1dSLionel Sambuc.Nm dwarf_srclang
40*0a6a1f1dSLionel Sambuc.Nd retrieve the value of a DWARF attribute
41*0a6a1f1dSLionel Sambuc.Sh LIBRARY
42*0a6a1f1dSLionel Sambuc.Lb libdwarf
43*0a6a1f1dSLionel Sambuc.Sh SYNOPSIS
44*0a6a1f1dSLionel Sambuc.In libdwarf.h
45*0a6a1f1dSLionel Sambuc.Ft int
46*0a6a1f1dSLionel Sambuc.Fo dwarf_arrayorder
47*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Die die"
48*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Unsigned *ret_order"
49*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err"
50*0a6a1f1dSLionel Sambuc.Fc
51*0a6a1f1dSLionel Sambuc.Ft int
52*0a6a1f1dSLionel Sambuc.Fo dwarf_bitoffset
53*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Die die"
54*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Unsigned *ret_size"
55*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err"
56*0a6a1f1dSLionel Sambuc.Fc
57*0a6a1f1dSLionel Sambuc.Ft int
58*0a6a1f1dSLionel Sambuc.Fo dwarf_bitsize
59*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Die die"
60*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Unsigned *ret_size"
61*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err"
62*0a6a1f1dSLionel Sambuc.Fc
63*0a6a1f1dSLionel Sambuc.Ft int
64*0a6a1f1dSLionel Sambuc.Fo dwarf_bytesize
65*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Die die"
66*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Unsigned *ret_size"
67*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err"
68*0a6a1f1dSLionel Sambuc.Fc
69*0a6a1f1dSLionel Sambuc.Ft int
70*0a6a1f1dSLionel Sambuc.Fo dwarf_highpc
71*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Die die"
72*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Addr *ret_highpc"
73*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err"
74*0a6a1f1dSLionel Sambuc.Fc
75*0a6a1f1dSLionel Sambuc.Ft int
76*0a6a1f1dSLionel Sambuc.Fo dwarf_lowpc
77*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Die die"
78*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Addr *ret_lowpc"
79*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err"
80*0a6a1f1dSLionel Sambuc.Fc
81*0a6a1f1dSLionel Sambuc.Ft int
82*0a6a1f1dSLionel Sambuc.Fo dwarf_srclang
83*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Die die"
84*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Unsigned *ret_lang"
85*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err"
86*0a6a1f1dSLionel Sambuc.Fc
87*0a6a1f1dSLionel Sambuc.Sh DESCRIPTION
88*0a6a1f1dSLionel SambucThese convenience functions are used to retrieve DWARF attribute
89*0a6a1f1dSLionel Sambucvalues associated with a Debugging Information Entry (DIE) descriptor
90*0a6a1f1dSLionel Sambucdenoted by argument
91*0a6a1f1dSLionel Sambuc.Ar die .
92*0a6a1f1dSLionel SambucThese functions store the value of the requested attribute into the
93*0a6a1f1dSLionel Sambuclocation pointed to by their second argument, provided that the requested
94*0a6a1f1dSLionel Sambucattribute exists in the debugging information entry.
95*0a6a1f1dSLionel Sambuc.Pp
96*0a6a1f1dSLionel SambucThe list of functions and the DWARF attribute that they retrieve are:
97*0a6a1f1dSLionel Sambuc.Pp
98*0a6a1f1dSLionel Sambuc.Bl -tag -width ".Fn dwarf_arrayorder" -compact
99*0a6a1f1dSLionel Sambuc.It Fn dwarf_arrayorder
100*0a6a1f1dSLionel SambucRetrieve the
101*0a6a1f1dSLionel Sambuc.Dv DW_AT_ordering
102*0a6a1f1dSLionel Sambucattribute value.
103*0a6a1f1dSLionel Sambuc.It Fn dwarf_bitoffset
104*0a6a1f1dSLionel SambucRetrieve the
105*0a6a1f1dSLionel Sambuc.Dv DW_AT_bit_offset
106*0a6a1f1dSLionel Sambucattribute value.
107*0a6a1f1dSLionel Sambuc.It Fn dwarf_bitsize
108*0a6a1f1dSLionel SambucRetrieve the
109*0a6a1f1dSLionel Sambuc.Dv DW_AT_bit_size
110*0a6a1f1dSLionel Sambucattribute value.
111*0a6a1f1dSLionel Sambuc.It Fn dwarf_bytesize
112*0a6a1f1dSLionel SambucRetrieve the
113*0a6a1f1dSLionel Sambuc.Dv DW_AT_byte_size
114*0a6a1f1dSLionel Sambucattribute value.
115*0a6a1f1dSLionel Sambuc.It Fn dwarf_highpc
116*0a6a1f1dSLionel SambucRetrieve the
117*0a6a1f1dSLionel Sambuc.Dv DW_AT_high_pc
118*0a6a1f1dSLionel Sambucattribute value.
119*0a6a1f1dSLionel Sambuc.It Fn dwarf_lowpc
120*0a6a1f1dSLionel SambucRetrieve the
121*0a6a1f1dSLionel Sambuc.Dv DW_AT_low_pc
122*0a6a1f1dSLionel Sambucattribute value.
123*0a6a1f1dSLionel Sambuc.It Fn dwarf_srclang
124*0a6a1f1dSLionel SambucRetrieve the
125*0a6a1f1dSLionel Sambuc.Dv DW_AT_language
126*0a6a1f1dSLionel Sambucattribute value.
127*0a6a1f1dSLionel Sambuc.El
128*0a6a1f1dSLionel Sambuc.Sh RETURN VALUES
129*0a6a1f1dSLionel SambucThese functions return
130*0a6a1f1dSLionel Sambuc.Dv DW_DLV_OK on success.
131*0a6a1f1dSLionel Sambuc.Pp
132*0a6a1f1dSLionel SambucIf the debugging information entry descriptor denoted by argument
133*0a6a1f1dSLionel Sambuc.Ar die
134*0a6a1f1dSLionel Sambucdoes not contain the requested attribute, these functions return
135*0a6a1f1dSLionel Sambuc.Dv DW_DLV_NO_ENTRY
136*0a6a1f1dSLionel Sambucand set argument
137*0a6a1f1dSLionel Sambuc.Ar err .
138*0a6a1f1dSLionel SambucFor other errors, they return
139*0a6a1f1dSLionel Sambuc.Dv DW_DLV_ERROR
140*0a6a1f1dSLionel Sambucand set argument
141*0a6a1f1dSLionel Sambuc.Ar err .
142*0a6a1f1dSLionel Sambuc.Sh ERRORS
143*0a6a1f1dSLionel SambucThese functions can fail with the following errors:
144*0a6a1f1dSLionel Sambuc.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT"
145*0a6a1f1dSLionel Sambuc.It Bq Er DW_DLE_ARGUMENT
146*0a6a1f1dSLionel SambucArguments
147*0a6a1f1dSLionel Sambuc.Ar die ,
148*0a6a1f1dSLionel Sambuc.Ar ret_highpc ,
149*0a6a1f1dSLionel Sambuc.Ar ret_lowpc ,
150*0a6a1f1dSLionel Sambuc.Ar ret_size ,
151*0a6a1f1dSLionel Sambuc.Ar ret_lang
152*0a6a1f1dSLionel Sambucor
153*0a6a1f1dSLionel Sambuc.Ar ret_order
154*0a6a1f1dSLionel Sambucwere NULL.
155*0a6a1f1dSLionel Sambuc.It Bq Er DW_DLE_NO_ENTRY
156*0a6a1f1dSLionel SambucArgument
157*0a6a1f1dSLionel Sambuc.Ar die
158*0a6a1f1dSLionel Sambuchad no requested attribute.
159*0a6a1f1dSLionel Sambuc.El
160*0a6a1f1dSLionel Sambuc.Sh SEE ALSO
161*0a6a1f1dSLionel Sambuc.Xr dwarf 3 ,
162*0a6a1f1dSLionel Sambuc.Xr dwarf_attr 3 ,
163*0a6a1f1dSLionel Sambuc.Xr dwarf_attrlist 3 ,
164*0a6a1f1dSLionel Sambuc.Xr dwarf_hasattr 3
165