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