xref: /minix3/external/bsd/elftoolchain/dist/libdwarf/dwarf_attrval_signed.3 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc.\"	$NetBSD: dwarf_attrval_signed.3,v 1.2 2014/03/09 16:58:03 christos Exp $
2*0a6a1f1dSLionel Sambuc.\"
3*0a6a1f1dSLionel Sambuc.\" Copyright (c) 2011 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_attrval_signed.3 2072 2011-10-27 03:26:49Z jkoshy
28*0a6a1f1dSLionel Sambuc.\"
29*0a6a1f1dSLionel Sambuc.Dd January 18, 2014
30*0a6a1f1dSLionel Sambuc.Os
31*0a6a1f1dSLionel Sambuc.Dt DWARF_ATTRVAL_SIGNED 3
32*0a6a1f1dSLionel Sambuc.Sh NAME
33*0a6a1f1dSLionel Sambuc.Nm dwarf_attrval_flag ,
34*0a6a1f1dSLionel Sambuc.Nm dwarf_attrval_signed ,
35*0a6a1f1dSLionel Sambuc.Nm dwarf_attrval_string ,
36*0a6a1f1dSLionel Sambuc.Nm dwarf_attrval_unsigned
37*0a6a1f1dSLionel Sambuc.Nd retrieve the value of an attribute within a DWARF debugging information entry
38*0a6a1f1dSLionel Sambuc.Sh LIBRARY
39*0a6a1f1dSLionel Sambuc.Lb libdwarf
40*0a6a1f1dSLionel Sambuc.Sh SYNOPSIS
41*0a6a1f1dSLionel Sambuc.In libdwarf.h
42*0a6a1f1dSLionel Sambuc.Ft int
43*0a6a1f1dSLionel Sambuc.Fo dwarf_attrval_flag
44*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Die die"
45*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Half attr"
46*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Bool *ret"
47*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err"
48*0a6a1f1dSLionel Sambuc.Fc
49*0a6a1f1dSLionel Sambuc.Ft int
50*0a6a1f1dSLionel Sambuc.Fo dwarf_attrval_signed
51*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Die die"
52*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Half attr"
53*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Signed *ret"
54*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err"
55*0a6a1f1dSLionel Sambuc.Fc
56*0a6a1f1dSLionel Sambuc.Ft int
57*0a6a1f1dSLionel Sambuc.Fo dwarf_attrval_string
58*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Die die"
59*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Half attr"
60*0a6a1f1dSLionel Sambuc.Fa "const char **ret"
61*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err"
62*0a6a1f1dSLionel Sambuc.Fc
63*0a6a1f1dSLionel Sambuc.Ft int
64*0a6a1f1dSLionel Sambuc.Fo dwarf_attrval_unsigned
65*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Die die"
66*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Half attr"
67*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Unsigned *ret"
68*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err"
69*0a6a1f1dSLionel Sambuc.Fc
70*0a6a1f1dSLionel Sambuc.Sh DESCRIPTION
71*0a6a1f1dSLionel SambucThese functions search the debugging information entry referenced
72*0a6a1f1dSLionel Sambucby argument
73*0a6a1f1dSLionel Sambuc.Ar die
74*0a6a1f1dSLionel Sambucfor the attribute named by argument
75*0a6a1f1dSLionel Sambuc.Ar attr .
76*0a6a1f1dSLionel SambucIf the named attribute is found, the functions set the location
77*0a6a1f1dSLionel Sambucpointed to by argument
78*0a6a1f1dSLionel Sambuc.Ar ret
79*0a6a1f1dSLionel Sambucto the value of the attribute.
80*0a6a1f1dSLionel SambucThe argument
81*0a6a1f1dSLionel Sambuc.Ar err ,
82*0a6a1f1dSLionel Sambucif non NULL,
83*0a6a1f1dSLionel Sambucwill be used to return an error descriptor in case of an error.
84*0a6a1f1dSLionel Sambuc.Pp
85*0a6a1f1dSLionel SambucFunction
86*0a6a1f1dSLionel Sambuc.Fn dwarf_attrval_flag
87*0a6a1f1dSLionel Sambucsets the location pointed to by argument
88*0a6a1f1dSLionel Sambuc.Ar ret
89*0a6a1f1dSLionel Sambucto either 0 or 1. If the form of the attribute named by argument
90*0a6a1f1dSLionel Sambuc.Ar attr
91*0a6a1f1dSLionel Sambucis
92*0a6a1f1dSLionel Sambuc.Dv DW_FORM_flag ,
93*0a6a1f1dSLionel Sambucfunction
94*0a6a1f1dSLionel Sambuc.Fn dwarf_attrval_flag
95*0a6a1f1dSLionel Sambucsets the location pointed to by argument
96*0a6a1f1dSLionel Sambuc.Ar ret
97*0a6a1f1dSLionel Sambucto 1 if the attribute has a non-zero value, or to 0 otherwise.
98*0a6a1f1dSLionel SambucIf the form of the attribute named by argument
99*0a6a1f1dSLionel Sambuc.Ar attr
100*0a6a1f1dSLionel Sambucis
101*0a6a1f1dSLionel Sambuc.Dv DW_FORM_flag_present ,
102*0a6a1f1dSLionel Sambucfunction
103*0a6a1f1dSLionel Sambuc.Fn dwarf_attrval_flag
104*0a6a1f1dSLionel Sambucunconditionally sets the location pointed to by argument
105*0a6a1f1dSLionel Sambuc.Ar ret
106*0a6a1f1dSLionel Sambucto 1.
107*0a6a1f1dSLionel SambucThe form of the attribute must be one of
108*0a6a1f1dSLionel Sambuc.Dv DW_FORM_flag
109*0a6a1f1dSLionel Sambucor
110*0a6a1f1dSLionel Sambuc.Dv DW_FORM_flag_present .
111*0a6a1f1dSLionel Sambuc.Pp
112*0a6a1f1dSLionel SambucFunction
113*0a6a1f1dSLionel Sambuc.Fn dwarf_attrval_signed
114*0a6a1f1dSLionel Sambucstores the value for the attribute named by argument
115*0a6a1f1dSLionel Sambuc.Ar attr ,
116*0a6a1f1dSLionel Sambucinto the location pointed to by argument
117*0a6a1f1dSLionel Sambuc.Ar ret .
118*0a6a1f1dSLionel SambucThe attribute's value is treated as a signed integral quantity and is
119*0a6a1f1dSLionel Sambucsign-extended as needed.
120*0a6a1f1dSLionel SambucThe attribute named by the argument
121*0a6a1f1dSLionel Sambuc.Ar attr
122*0a6a1f1dSLionel Sambucmust belong to the
123*0a6a1f1dSLionel Sambuc.Dv CONSTANT
124*0a6a1f1dSLionel Sambucclass and must have one of the following forms:
125*0a6a1f1dSLionel Sambuc.Dv DW_FORM_data1 ,
126*0a6a1f1dSLionel Sambuc.Dv DW_FORM_data2 ,
127*0a6a1f1dSLionel Sambuc.Dv DW_FORM_data4 ,
128*0a6a1f1dSLionel Sambuc.Dv DW_FORM_data8
129*0a6a1f1dSLionel Sambucor
130*0a6a1f1dSLionel Sambuc.Dv DW_FORM_sdata .
131*0a6a1f1dSLionel Sambuc.Pp
132*0a6a1f1dSLionel SambucFunction
133*0a6a1f1dSLionel Sambuc.Fn dwarf_attrval_string
134*0a6a1f1dSLionel Sambucsets the location pointed to by argument
135*0a6a1f1dSLionel Sambuc.Ar ret
136*0a6a1f1dSLionel Sambucto a pointer to a NUL-terminated string that is the value of the
137*0a6a1f1dSLionel Sambucattribute named by argument
138*0a6a1f1dSLionel Sambuc.Ar attr .
139*0a6a1f1dSLionel SambucThe form of the attribute must be one of
140*0a6a1f1dSLionel Sambuc.Dv DW_FORM_string
141*0a6a1f1dSLionel Sambucor
142*0a6a1f1dSLionel Sambuc.Dv DW_FORM_strp .
143*0a6a1f1dSLionel Sambuc.Pp
144*0a6a1f1dSLionel SambucFunction
145*0a6a1f1dSLionel Sambuc.Fn dwarf_attrval_unsigned
146*0a6a1f1dSLionel Sambucstores the value for the attribute named by argument
147*0a6a1f1dSLionel Sambuc.Ar attr
148*0a6a1f1dSLionel Sambucinto the location pointed to by argument
149*0a6a1f1dSLionel Sambuc.Ar ret .
150*0a6a1f1dSLionel SambucThe attribute's value is treated as an unsigned integral quantity, and
151*0a6a1f1dSLionel Sambucis zero-extended as needed.
152*0a6a1f1dSLionel SambucThe named attribute must belong to one of the
153*0a6a1f1dSLionel Sambuc.Dv CONSTANT ,
154*0a6a1f1dSLionel Sambuc.Dv ADDRESS
155*0a6a1f1dSLionel Sambucor
156*0a6a1f1dSLionel Sambuc.Dv REFERENCE
157*0a6a1f1dSLionel Sambucclasses and must have one of the following forms:
158*0a6a1f1dSLionel Sambuc.Dv DW_FORM_addr ,
159*0a6a1f1dSLionel Sambuc.Dv DW_FORM_data1 ,
160*0a6a1f1dSLionel Sambuc.Dv DW_FORM_data2 ,
161*0a6a1f1dSLionel Sambuc.Dv DW_FORM_data4 ,
162*0a6a1f1dSLionel Sambuc.Dv DW_FORM_data8 ,
163*0a6a1f1dSLionel Sambuc.Dv DW_FORM_udata ,
164*0a6a1f1dSLionel Sambuc.Dv DW_FORM_ref1 ,
165*0a6a1f1dSLionel Sambuc.Dv DW_FORM_ref2 ,
166*0a6a1f1dSLionel Sambuc.Dv DW_FORM_ref4 ,
167*0a6a1f1dSLionel Sambuc.Dv DW_FORM_ref8 ,
168*0a6a1f1dSLionel Sambucor
169*0a6a1f1dSLionel Sambuc.Dv DW_FORM_ref_udata .
170*0a6a1f1dSLionel Sambuc.Pp
171*0a6a1f1dSLionel SambucIf the attribute named by argument
172*0a6a1f1dSLionel Sambuc.Ar attr
173*0a6a1f1dSLionel Sambucis not present in the debugging information entry referenced by
174*0a6a1f1dSLionel Sambucargument
175*0a6a1f1dSLionel Sambuc.Ar die ,
176*0a6a1f1dSLionel Sambucand if a
177*0a6a1f1dSLionel Sambuc.Dv DW_AT_abstract_origin
178*0a6a1f1dSLionel Sambucattribute is present in the debugging information entry,
179*0a6a1f1dSLionel Sambucfunction
180*0a6a1f1dSLionel Sambuc.Fn dwarf_attrval_unsigned
181*0a6a1f1dSLionel Sambucwill search for the named attribute in the debugging information entry
182*0a6a1f1dSLionel Sambucreferenced by the
183*0a6a1f1dSLionel Sambuc.Dv DW_AT_abstract_origin
184*0a6a1f1dSLionel Sambucattribute.
185*0a6a1f1dSLionel Sambuc.Sh RETURN VALUES
186*0a6a1f1dSLionel SambucOn success, these functions returns
187*0a6a1f1dSLionel Sambuc.Dv DW_DLV_OK .
188*0a6a1f1dSLionel SambucIf the named attribute was not found in the specified debugging
189*0a6a1f1dSLionel Sambucinformation entry descriptor these functions return
190*0a6a1f1dSLionel Sambuc.Dv DW_DLV_NO_ENTRY
191*0a6a1f1dSLionel Sambucand set argument
192*0a6a1f1dSLionel Sambuc.Ar err .
193*0a6a1f1dSLionel SambucFor other errors, these functions return
194*0a6a1f1dSLionel Sambuc.Dv DW_DLV_ERROR
195*0a6a1f1dSLionel Sambucand set argument
196*0a6a1f1dSLionel Sambuc.Ar err .
197*0a6a1f1dSLionel Sambuc.Sh COMPATIBILITY
198*0a6a1f1dSLionel SambucThese functions are extensions added by this implementation of the
199*0a6a1f1dSLionel SambucDWARF(3) API.
200*0a6a1f1dSLionel Sambuc.Sh ERRORS
201*0a6a1f1dSLionel SambucThese functions may fail with the following errors:
202*0a6a1f1dSLionel Sambuc.Bl -tag -width ".Bq Er DW_DLE_ATTR_FORM_BAD"
203*0a6a1f1dSLionel Sambuc.It Bq Er DW_DLE_ARGUMENT
204*0a6a1f1dSLionel SambucEither of the arguments
205*0a6a1f1dSLionel Sambuc.Va die
206*0a6a1f1dSLionel Sambucor
207*0a6a1f1dSLionel Sambuc.Va ret
208*0a6a1f1dSLionel Sambucwas NULL.
209*0a6a1f1dSLionel Sambuc.It Bq Er DW_DLE_NO_ENTRY
210*0a6a1f1dSLionel SambucArgument
211*0a6a1f1dSLionel Sambuc.Ar die
212*0a6a1f1dSLionel Sambucdid not contain an attribute corresponding to the value in argument
213*0a6a1f1dSLionel Sambuc.Ar attr .
214*0a6a1f1dSLionel Sambuc.It Bq Er DW_DLE_ATTR_FORM_BAD
215*0a6a1f1dSLionel SambucThe attribute named by argument
216*0a6a1f1dSLionel Sambuc.Ar attr
217*0a6a1f1dSLionel Sambucwas not of a permitted form.
218*0a6a1f1dSLionel Sambuc.El
219*0a6a1f1dSLionel Sambuc.Sh SEE ALSO
220*0a6a1f1dSLionel Sambuc.Xr dwarf 3 ,
221*0a6a1f1dSLionel Sambuc.Xr dwarf_attr 3 ,
222*0a6a1f1dSLionel Sambuc.Xr dwarf_hasattr 3
223