xref: /freebsd/contrib/elftoolchain/libdwarf/dwarf_highpc.3 (revision ae500c1ff8974130f7f2692772cf288b90349e0d)
1cf781b2eSEd Maste.\" Copyright (c) 2010,2014 Kai Wang
22de3b87aSKai Wang.\" All rights reserved.
32de3b87aSKai Wang.\"
42de3b87aSKai Wang.\" Redistribution and use in source and binary forms, with or without
52de3b87aSKai Wang.\" modification, are permitted provided that the following conditions
62de3b87aSKai Wang.\" are met:
72de3b87aSKai Wang.\" 1. Redistributions of source code must retain the above copyright
82de3b87aSKai Wang.\"    notice, this list of conditions and the following disclaimer.
92de3b87aSKai Wang.\" 2. Redistributions in binary form must reproduce the above copyright
102de3b87aSKai Wang.\"    notice, this list of conditions and the following disclaimer in the
112de3b87aSKai Wang.\"    documentation and/or other materials provided with the distribution.
122de3b87aSKai Wang.\"
132de3b87aSKai Wang.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
142de3b87aSKai Wang.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
152de3b87aSKai Wang.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
162de3b87aSKai Wang.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
172de3b87aSKai Wang.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
182de3b87aSKai Wang.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
192de3b87aSKai Wang.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
202de3b87aSKai Wang.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
212de3b87aSKai Wang.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
222de3b87aSKai Wang.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
232de3b87aSKai Wang.\" SUCH DAMAGE.
242de3b87aSKai Wang.\"
25*ae500c1fSEd Maste.\" $Id: dwarf_highpc.3 3644 2018-10-15 19:55:01Z jkoshy $
262de3b87aSKai Wang.\"
27cf781b2eSEd Maste.Dd July 22, 2014
282de3b87aSKai Wang.Dt DWARF_HIGHPC 3
29*ae500c1fSEd Maste.Os
302de3b87aSKai Wang.Sh NAME
312de3b87aSKai Wang.Nm dwarf_arrayorder ,
322de3b87aSKai Wang.Nm dwarf_bitoffset ,
332de3b87aSKai Wang.Nm dwarf_bitsize ,
342de3b87aSKai Wang.Nm dwarf_bytesize ,
352de3b87aSKai Wang.Nm dwarf_highpc ,
36cf781b2eSEd Maste.Nm dwarf_highpc_b ,
372de3b87aSKai Wang.Nm dwarf_lowpc ,
382de3b87aSKai Wang.Nm dwarf_srclang
392de3b87aSKai Wang.Nd retrieve the value of a DWARF attribute
402de3b87aSKai Wang.Sh LIBRARY
412de3b87aSKai Wang.Lb libdwarf
422de3b87aSKai Wang.Sh SYNOPSIS
432de3b87aSKai Wang.In libdwarf.h
442de3b87aSKai Wang.Ft int
452de3b87aSKai Wang.Fo dwarf_arrayorder
462de3b87aSKai Wang.Fa "Dwarf_Die die"
472de3b87aSKai Wang.Fa "Dwarf_Unsigned *ret_order"
482de3b87aSKai Wang.Fa "Dwarf_Error *err"
492de3b87aSKai Wang.Fc
502de3b87aSKai Wang.Ft int
512de3b87aSKai Wang.Fo dwarf_bitoffset
522de3b87aSKai Wang.Fa "Dwarf_Die die"
532de3b87aSKai Wang.Fa "Dwarf_Unsigned *ret_size"
542de3b87aSKai Wang.Fa "Dwarf_Error *err"
552de3b87aSKai Wang.Fc
562de3b87aSKai Wang.Ft int
572de3b87aSKai Wang.Fo dwarf_bitsize
582de3b87aSKai Wang.Fa "Dwarf_Die die"
592de3b87aSKai Wang.Fa "Dwarf_Unsigned *ret_size"
602de3b87aSKai Wang.Fa "Dwarf_Error *err"
612de3b87aSKai Wang.Fc
622de3b87aSKai Wang.Ft int
632de3b87aSKai Wang.Fo dwarf_bytesize
642de3b87aSKai Wang.Fa "Dwarf_Die die"
652de3b87aSKai Wang.Fa "Dwarf_Unsigned *ret_size"
662de3b87aSKai Wang.Fa "Dwarf_Error *err"
672de3b87aSKai Wang.Fc
682de3b87aSKai Wang.Ft int
692de3b87aSKai Wang.Fo dwarf_highpc
702de3b87aSKai Wang.Fa "Dwarf_Die die"
712de3b87aSKai Wang.Fa "Dwarf_Addr *ret_highpc"
722de3b87aSKai Wang.Fa "Dwarf_Error *err"
732de3b87aSKai Wang.Fc
742de3b87aSKai Wang.Ft int
75cf781b2eSEd Maste.Fo dwarf_highpc_b
76cf781b2eSEd Maste.Fa "Dwarf_Die die"
77cf781b2eSEd Maste.Fa "Dwarf_Addr *ret_highpc"
78cf781b2eSEd Maste.Fa "Dwarf_Half *ret_form"
79cf781b2eSEd Maste.Fa "enum Dwarf_Form_Class *ret_class"
80cf781b2eSEd Maste.Fa "Dwarf_Error *err"
81cf781b2eSEd Maste.Fc
82cf781b2eSEd Maste.Ft int
832de3b87aSKai Wang.Fo dwarf_lowpc
842de3b87aSKai Wang.Fa "Dwarf_Die die"
852de3b87aSKai Wang.Fa "Dwarf_Addr *ret_lowpc"
862de3b87aSKai Wang.Fa "Dwarf_Error *err"
872de3b87aSKai Wang.Fc
882de3b87aSKai Wang.Ft int
892de3b87aSKai Wang.Fo dwarf_srclang
902de3b87aSKai Wang.Fa "Dwarf_Die die"
912de3b87aSKai Wang.Fa "Dwarf_Unsigned *ret_lang"
922de3b87aSKai Wang.Fa "Dwarf_Error *err"
932de3b87aSKai Wang.Fc
942de3b87aSKai Wang.Sh DESCRIPTION
952de3b87aSKai WangThese convenience functions are used to retrieve DWARF attribute
962de3b87aSKai Wangvalues associated with a Debugging Information Entry (DIE) descriptor
972de3b87aSKai Wangdenoted by argument
982de3b87aSKai Wang.Ar die .
992de3b87aSKai WangThese functions store the value of the requested attribute into the
1002de3b87aSKai Wanglocation pointed to by their second argument, provided that the requested
1012de3b87aSKai Wangattribute exists in the debugging information entry.
1022de3b87aSKai Wang.Pp
1032de3b87aSKai WangThe list of functions and the DWARF attribute that they retrieve are:
1042de3b87aSKai Wang.Pp
1052de3b87aSKai Wang.Bl -tag -width ".Fn dwarf_arrayorder" -compact
1062de3b87aSKai Wang.It Fn dwarf_arrayorder
1072de3b87aSKai WangRetrieve the
1082de3b87aSKai Wang.Dv DW_AT_ordering
1092de3b87aSKai Wangattribute value.
1102de3b87aSKai Wang.It Fn dwarf_bitoffset
1112de3b87aSKai WangRetrieve the
1122de3b87aSKai Wang.Dv DW_AT_bit_offset
1132de3b87aSKai Wangattribute value.
1142de3b87aSKai Wang.It Fn dwarf_bitsize
1152de3b87aSKai WangRetrieve the
1162de3b87aSKai Wang.Dv DW_AT_bit_size
1172de3b87aSKai Wangattribute value.
1182de3b87aSKai Wang.It Fn dwarf_bytesize
1192de3b87aSKai WangRetrieve the
1202de3b87aSKai Wang.Dv DW_AT_byte_size
1212de3b87aSKai Wangattribute value.
1222de3b87aSKai Wang.It Fn dwarf_highpc
1232de3b87aSKai WangRetrieve the
1242de3b87aSKai Wang.Dv DW_AT_high_pc
1252de3b87aSKai Wangattribute value.
126cf781b2eSEd Maste.It Fn dwarf_highpc_b
127cf781b2eSEd MasteRetrieve the
128cf781b2eSEd Maste.Dv DW_AT_high_pc
129cf781b2eSEd Masteattribute value.
1302de3b87aSKai Wang.It Fn dwarf_lowpc
1312de3b87aSKai WangRetrieve the
1322de3b87aSKai Wang.Dv DW_AT_low_pc
1332de3b87aSKai Wangattribute value.
1342de3b87aSKai Wang.It Fn dwarf_srclang
1352de3b87aSKai WangRetrieve the
1362de3b87aSKai Wang.Dv DW_AT_language
1372de3b87aSKai Wangattribute value.
1382de3b87aSKai Wang.El
139cf781b2eSEd Maste.Pp
140cf781b2eSEd MasteFunction
141cf781b2eSEd Maste.Fn dwarf_highpc_b
142cf781b2eSEd Masteis an enhanced version of function
143cf781b2eSEd Maste.Fn dwarf_highpc .
144cf781b2eSEd MasteIt sets the location specified by argument
145cf781b2eSEd Maste.Ar ret_form
146cf781b2eSEd Masteto the form code of the attribute
147cf781b2eSEd Maste.Dv DW_AT_high_pc ,
148cf781b2eSEd Masteand sets the location specified by argument
149cf781b2eSEd Maste.Ar ret_class
150cf781b2eSEd Masteto the class of that form.
151cf781b2eSEd MasteA value of NULL may be used for either of the arguments
152cf781b2eSEd Maste.Ar ret_form
153cf781b2eSEd Masteor
154cf781b2eSEd Maste.Ar ret_class
155cf781b2eSEd Masteif the caller is not interested in the respective value.
1562de3b87aSKai Wang.Sh RETURN VALUES
1572de3b87aSKai WangThese functions return
158*ae500c1fSEd Maste.Dv DW_DLV_OK
159*ae500c1fSEd Masteon success.
1602de3b87aSKai Wang.Pp
1612de3b87aSKai WangIf the debugging information entry descriptor denoted by argument
1622de3b87aSKai Wang.Ar die
1632de3b87aSKai Wangdoes not contain the requested attribute, these functions return
1642de3b87aSKai Wang.Dv DW_DLV_NO_ENTRY
1652de3b87aSKai Wangand set argument
1662de3b87aSKai Wang.Ar err .
1672de3b87aSKai WangFor other errors, they return
1682de3b87aSKai Wang.Dv DW_DLV_ERROR
1692de3b87aSKai Wangand set argument
1702de3b87aSKai Wang.Ar err .
1712de3b87aSKai Wang.Sh ERRORS
1722de3b87aSKai WangThese functions can fail with the following errors:
1732de3b87aSKai Wang.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT"
1742de3b87aSKai Wang.It Bq Er DW_DLE_ARGUMENT
1752de3b87aSKai WangArguments
1762de3b87aSKai Wang.Ar die ,
1772de3b87aSKai Wang.Ar ret_highpc ,
1782de3b87aSKai Wang.Ar ret_lowpc ,
1792de3b87aSKai Wang.Ar ret_size ,
1802de3b87aSKai Wang.Ar ret_lang
1812de3b87aSKai Wangor
1822de3b87aSKai Wang.Ar ret_order
1832de3b87aSKai Wangwere NULL.
1842de3b87aSKai Wang.It Bq Er DW_DLE_NO_ENTRY
1852de3b87aSKai WangArgument
1862de3b87aSKai Wang.Ar die
1872de3b87aSKai Wanghad no requested attribute.
1882de3b87aSKai Wang.El
1892de3b87aSKai Wang.Sh SEE ALSO
1902de3b87aSKai Wang.Xr dwarf 3 ,
1912de3b87aSKai Wang.Xr dwarf_attr 3 ,
1922de3b87aSKai Wang.Xr dwarf_attrlist 3 ,
193*ae500c1fSEd Maste.Xr dwarf_get_form_class 3 ,
194*ae500c1fSEd Maste.Xr dwarf_hasattr 3
195