xref: /minix3/external/bsd/elftoolchain/dist/libdwarf/dwarf_highpc.3 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1.\"	$NetBSD: dwarf_highpc.3,v 1.2 2014/03/09 16:58:04 christos Exp $
2.\"
3.\" Copyright (c) 2010 Kai Wang
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
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.
14.\"
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
25.\" SUCH DAMAGE.
26.\"
27.\" Id: dwarf_highpc.3 2073 2011-10-27 03:30:47Z jkoshy
28.\"
29.Dd April 7, 2010
30.Os
31.Dt DWARF_HIGHPC 3
32.Sh NAME
33.Nm dwarf_arrayorder ,
34.Nm dwarf_bitoffset ,
35.Nm dwarf_bitsize ,
36.Nm dwarf_bytesize ,
37.Nm dwarf_highpc ,
38.Nm dwarf_lowpc ,
39.Nm dwarf_srclang
40.Nd retrieve the value of a DWARF attribute
41.Sh LIBRARY
42.Lb libdwarf
43.Sh SYNOPSIS
44.In libdwarf.h
45.Ft int
46.Fo dwarf_arrayorder
47.Fa "Dwarf_Die die"
48.Fa "Dwarf_Unsigned *ret_order"
49.Fa "Dwarf_Error *err"
50.Fc
51.Ft int
52.Fo dwarf_bitoffset
53.Fa "Dwarf_Die die"
54.Fa "Dwarf_Unsigned *ret_size"
55.Fa "Dwarf_Error *err"
56.Fc
57.Ft int
58.Fo dwarf_bitsize
59.Fa "Dwarf_Die die"
60.Fa "Dwarf_Unsigned *ret_size"
61.Fa "Dwarf_Error *err"
62.Fc
63.Ft int
64.Fo dwarf_bytesize
65.Fa "Dwarf_Die die"
66.Fa "Dwarf_Unsigned *ret_size"
67.Fa "Dwarf_Error *err"
68.Fc
69.Ft int
70.Fo dwarf_highpc
71.Fa "Dwarf_Die die"
72.Fa "Dwarf_Addr *ret_highpc"
73.Fa "Dwarf_Error *err"
74.Fc
75.Ft int
76.Fo dwarf_lowpc
77.Fa "Dwarf_Die die"
78.Fa "Dwarf_Addr *ret_lowpc"
79.Fa "Dwarf_Error *err"
80.Fc
81.Ft int
82.Fo dwarf_srclang
83.Fa "Dwarf_Die die"
84.Fa "Dwarf_Unsigned *ret_lang"
85.Fa "Dwarf_Error *err"
86.Fc
87.Sh DESCRIPTION
88These convenience functions are used to retrieve DWARF attribute
89values associated with a Debugging Information Entry (DIE) descriptor
90denoted by argument
91.Ar die .
92These functions store the value of the requested attribute into the
93location pointed to by their second argument, provided that the requested
94attribute exists in the debugging information entry.
95.Pp
96The list of functions and the DWARF attribute that they retrieve are:
97.Pp
98.Bl -tag -width ".Fn dwarf_arrayorder" -compact
99.It Fn dwarf_arrayorder
100Retrieve the
101.Dv DW_AT_ordering
102attribute value.
103.It Fn dwarf_bitoffset
104Retrieve the
105.Dv DW_AT_bit_offset
106attribute value.
107.It Fn dwarf_bitsize
108Retrieve the
109.Dv DW_AT_bit_size
110attribute value.
111.It Fn dwarf_bytesize
112Retrieve the
113.Dv DW_AT_byte_size
114attribute value.
115.It Fn dwarf_highpc
116Retrieve the
117.Dv DW_AT_high_pc
118attribute value.
119.It Fn dwarf_lowpc
120Retrieve the
121.Dv DW_AT_low_pc
122attribute value.
123.It Fn dwarf_srclang
124Retrieve the
125.Dv DW_AT_language
126attribute value.
127.El
128.Sh RETURN VALUES
129These functions return
130.Dv DW_DLV_OK on success.
131.Pp
132If the debugging information entry descriptor denoted by argument
133.Ar die
134does not contain the requested attribute, these functions return
135.Dv DW_DLV_NO_ENTRY
136and set argument
137.Ar err .
138For other errors, they return
139.Dv DW_DLV_ERROR
140and set argument
141.Ar err .
142.Sh ERRORS
143These functions can fail with the following errors:
144.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT"
145.It Bq Er DW_DLE_ARGUMENT
146Arguments
147.Ar die ,
148.Ar ret_highpc ,
149.Ar ret_lowpc ,
150.Ar ret_size ,
151.Ar ret_lang
152or
153.Ar ret_order
154were NULL.
155.It Bq Er DW_DLE_NO_ENTRY
156Argument
157.Ar die
158had no requested attribute.
159.El
160.Sh SEE ALSO
161.Xr dwarf 3 ,
162.Xr dwarf_attr 3 ,
163.Xr dwarf_attrlist 3 ,
164.Xr dwarf_hasattr 3
165