1 .\" $NetBSD: dwarf_attrval_signed.3,v 1.2 2014/03/09 16:58:03 christos Exp $
3 .\" Copyright (c) 2011 Kai Wang
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" Id: dwarf_attrval_signed.3 2072 2011-10-27 03:26:49Z jkoshy
31 .Dt DWARF_ATTRVAL_SIGNED 3
33 .Nm dwarf_attrval_flag ,
34 .Nm dwarf_attrval_signed ,
35 .Nm dwarf_attrval_string ,
36 .Nm dwarf_attrval_unsigned
37 .Nd retrieve the value of an attribute within a DWARF debugging information entry
43 .Fo dwarf_attrval_flag
47 .Fa "Dwarf_Error *err"
50 .Fo dwarf_attrval_signed
53 .Fa "Dwarf_Signed *ret"
54 .Fa "Dwarf_Error *err"
57 .Fo dwarf_attrval_string
60 .Fa "const char **ret"
61 .Fa "Dwarf_Error *err"
64 .Fo dwarf_attrval_unsigned
67 .Fa "Dwarf_Unsigned *ret"
68 .Fa "Dwarf_Error *err"
71 These functions search the debugging information entry referenced
74 for the attribute named by argument
76 If the named attribute is found, the functions set the location
77 pointed to by argument
79 to the value of the attribute.
83 will be used to return an error descriptor in case of an error.
86 .Fn dwarf_attrval_flag
87 sets the location pointed to by argument
89 to either 0 or 1. If the form of the attribute named by argument
94 .Fn dwarf_attrval_flag
95 sets the location pointed to by argument
97 to 1 if the attribute has a non-zero value, or to 0 otherwise.
98 If the form of the attribute named by argument
101 .Dv DW_FORM_flag_present ,
103 .Fn dwarf_attrval_flag
104 unconditionally sets the location pointed to by argument
107 The form of the attribute must be one of
110 .Dv DW_FORM_flag_present .
113 .Fn dwarf_attrval_signed
114 stores the value for the attribute named by argument
116 into the location pointed to by argument
118 The attribute's value is treated as a signed integral quantity and is
119 sign-extended as needed.
120 The attribute named by the argument
124 class and must have one of the following forms:
133 .Fn dwarf_attrval_string
134 sets the location pointed to by argument
136 to a pointer to a NUL-terminated string that is the value of the
137 attribute named by argument
139 The form of the attribute must be one of
145 .Fn dwarf_attrval_unsigned
146 stores the value for the attribute named by argument
148 into the location pointed to by argument
150 The attribute's value is treated as an unsigned integral quantity, and
151 is zero-extended as needed.
152 The named attribute must belong to one of the
157 classes and must have one of the following forms:
169 .Dv DW_FORM_ref_udata .
171 If the attribute named by argument
173 is not present in the debugging information entry referenced by
177 .Dv DW_AT_abstract_origin
178 attribute is present in the debugging information entry,
180 .Fn dwarf_attrval_unsigned
181 will search for the named attribute in the debugging information entry
183 .Dv DW_AT_abstract_origin
186 On success, these functions returns
188 If the named attribute was not found in the specified debugging
189 information entry descriptor these functions return
193 For other errors, these functions return
198 These functions are extensions added by this implementation of the
201 These functions may fail with the following errors:
202 .Bl -tag -width ".Bq Er DW_DLE_ATTR_FORM_BAD"
203 .It Bq Er DW_DLE_ARGUMENT
204 Either of the arguments
209 .It Bq Er DW_DLE_NO_ENTRY
212 did not contain an attribute corresponding to the value in argument
214 .It Bq Er DW_DLE_ATTR_FORM_BAD
215 The attribute named by argument
217 was not of a permitted form.