xref: /freebsd/contrib/elftoolchain/libdwarf/dwarf_highpc.3 (revision cf781b2e16c26535788abe648f5917f4db09c123)
1*cf781b2eSEd 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*cf781b2eSEd Maste.\" $Id: dwarf_highpc.3 3092 2014-09-02 22:09:30Z kaiwang27 $
262de3b87aSKai Wang.\"
27*cf781b2eSEd Maste.Dd July 22, 2014
282de3b87aSKai Wang.Os
292de3b87aSKai Wang.Dt DWARF_HIGHPC 3
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 ,
36*cf781b2eSEd 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
75*cf781b2eSEd Maste.Fo dwarf_highpc_b
76*cf781b2eSEd Maste.Fa "Dwarf_Die die"
77*cf781b2eSEd Maste.Fa "Dwarf_Addr *ret_highpc"
78*cf781b2eSEd Maste.Fa "Dwarf_Half *ret_form"
79*cf781b2eSEd Maste.Fa "enum Dwarf_Form_Class *ret_class"
80*cf781b2eSEd Maste.Fa "Dwarf_Error *err"
81*cf781b2eSEd Maste.Fc
82*cf781b2eSEd 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.
126*cf781b2eSEd Maste.It Fn dwarf_highpc_b
127*cf781b2eSEd MasteRetrieve the
128*cf781b2eSEd Maste.Dv DW_AT_high_pc
129*cf781b2eSEd 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
139*cf781b2eSEd Maste.Pp
140*cf781b2eSEd MasteFunction
141*cf781b2eSEd Maste.Fn dwarf_highpc_b
142*cf781b2eSEd Masteis an enhanced version of function
143*cf781b2eSEd Maste.Fn dwarf_highpc .
144*cf781b2eSEd MasteIt sets the location specified by argument
145*cf781b2eSEd Maste.Ar ret_form
146*cf781b2eSEd Masteto the form code of the attribute
147*cf781b2eSEd Maste.Dv DW_AT_high_pc ,
148*cf781b2eSEd Masteand sets the location specified by argument
149*cf781b2eSEd Maste.Ar ret_class
150*cf781b2eSEd Masteto the class of that form.
151*cf781b2eSEd MasteA value of NULL may be used for either of the arguments
152*cf781b2eSEd Maste.Ar ret_form
153*cf781b2eSEd Masteor
154*cf781b2eSEd Maste.Ar ret_class
155*cf781b2eSEd Masteif the caller is not interested in the respective value.
1562de3b87aSKai Wang.Sh RETURN VALUES
1572de3b87aSKai WangThese functions return
1582de3b87aSKai Wang.Dv DW_DLV_OK on success.
1592de3b87aSKai Wang.Pp
1602de3b87aSKai WangIf the debugging information entry descriptor denoted by argument
1612de3b87aSKai Wang.Ar die
1622de3b87aSKai Wangdoes not contain the requested attribute, these functions return
1632de3b87aSKai Wang.Dv DW_DLV_NO_ENTRY
1642de3b87aSKai Wangand set argument
1652de3b87aSKai Wang.Ar err .
1662de3b87aSKai WangFor other errors, they return
1672de3b87aSKai Wang.Dv DW_DLV_ERROR
1682de3b87aSKai Wangand set argument
1692de3b87aSKai Wang.Ar err .
1702de3b87aSKai Wang.Sh ERRORS
1712de3b87aSKai WangThese functions can fail with the following errors:
1722de3b87aSKai Wang.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT"
1732de3b87aSKai Wang.It Bq Er DW_DLE_ARGUMENT
1742de3b87aSKai WangArguments
1752de3b87aSKai Wang.Ar die ,
1762de3b87aSKai Wang.Ar ret_highpc ,
1772de3b87aSKai Wang.Ar ret_lowpc ,
1782de3b87aSKai Wang.Ar ret_size ,
1792de3b87aSKai Wang.Ar ret_lang
1802de3b87aSKai Wangor
1812de3b87aSKai Wang.Ar ret_order
1822de3b87aSKai Wangwere NULL.
1832de3b87aSKai Wang.It Bq Er DW_DLE_NO_ENTRY
1842de3b87aSKai WangArgument
1852de3b87aSKai Wang.Ar die
1862de3b87aSKai Wanghad no requested attribute.
1872de3b87aSKai Wang.El
1882de3b87aSKai Wang.Sh SEE ALSO
1892de3b87aSKai Wang.Xr dwarf 3 ,
1902de3b87aSKai Wang.Xr dwarf_attr 3 ,
1912de3b87aSKai Wang.Xr dwarf_attrlist 3 ,
192*cf781b2eSEd Maste.Xr dwarf_hasattr 3 ,
193*cf781b2eSEd Maste.Xr dwarf_get_form_class 3
194