1*2de3b87aSKai Wang.\" Copyright (c) 2010 Kai Wang 2*2de3b87aSKai Wang.\" All rights reserved. 3*2de3b87aSKai Wang.\" 4*2de3b87aSKai Wang.\" Redistribution and use in source and binary forms, with or without 5*2de3b87aSKai Wang.\" modification, are permitted provided that the following conditions 6*2de3b87aSKai Wang.\" are met: 7*2de3b87aSKai Wang.\" 1. Redistributions of source code must retain the above copyright 8*2de3b87aSKai Wang.\" notice, this list of conditions and the following disclaimer. 9*2de3b87aSKai Wang.\" 2. Redistributions in binary form must reproduce the above copyright 10*2de3b87aSKai Wang.\" notice, this list of conditions and the following disclaimer in the 11*2de3b87aSKai Wang.\" documentation and/or other materials provided with the distribution. 12*2de3b87aSKai Wang.\" 13*2de3b87aSKai Wang.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14*2de3b87aSKai Wang.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15*2de3b87aSKai Wang.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16*2de3b87aSKai Wang.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17*2de3b87aSKai Wang.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18*2de3b87aSKai Wang.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19*2de3b87aSKai Wang.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20*2de3b87aSKai Wang.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21*2de3b87aSKai Wang.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22*2de3b87aSKai Wang.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23*2de3b87aSKai Wang.\" SUCH DAMAGE. 24*2de3b87aSKai Wang.\" 25*2de3b87aSKai Wang.\" $Id: dwarf_attr.3 2072 2011-10-27 03:26:49Z jkoshy $ 26*2de3b87aSKai Wang.\" 27*2de3b87aSKai Wang.Dd April 8, 2010 28*2de3b87aSKai Wang.Os 29*2de3b87aSKai Wang.Dt DWARF_ATTR 3 30*2de3b87aSKai Wang.Sh NAME 31*2de3b87aSKai Wang.Nm dwarf_attr 32*2de3b87aSKai Wang.Nd retrieve an attribute descriptor associated with a DWARF debugging information entry 33*2de3b87aSKai Wang.Sh LIBRARY 34*2de3b87aSKai Wang.Lb libdwarf 35*2de3b87aSKai Wang.Sh SYNOPSIS 36*2de3b87aSKai Wang.In libdwarf.h 37*2de3b87aSKai Wang.Ft int 38*2de3b87aSKai Wang.Fo dwarf_attr 39*2de3b87aSKai Wang.Fa "Dwarf_Die die" 40*2de3b87aSKai Wang.Fa "Dwarf_Half attr" 41*2de3b87aSKai Wang.Fa "Dwarf_Attribute *atp" 42*2de3b87aSKai Wang.Fa "Dwarf_Error *err" 43*2de3b87aSKai Wang.Fc 44*2de3b87aSKai Wang.Sh DESCRIPTION 45*2de3b87aSKai WangFunction 46*2de3b87aSKai Wang.Fn dwarf_attr 47*2de3b87aSKai Wangretrieves the attribute descriptor for an attribute associated 48*2de3b87aSKai Wangwith the DWARF debugging information entry descriptor in 49*2de3b87aSKai Wangargument 50*2de3b87aSKai Wang.Ar die . 51*2de3b87aSKai Wang.Pp 52*2de3b87aSKai WangDWARF attribute descriptors are represented by value of the opaque 53*2de3b87aSKai Wangtype 54*2de3b87aSKai Wang.Vt Dwarf_Attribute , 55*2de3b87aSKai Wangsee 56*2de3b87aSKai Wang.Xr dwarf 3 . 57*2de3b87aSKai Wang.Pp 58*2de3b87aSKai WangArgument 59*2de3b87aSKai Wang.Ar attr 60*2de3b87aSKai Wangnames the desired DWARF attribute. 61*2de3b87aSKai WangLegal values for argument 62*2de3b87aSKai Wang.Ar attr 63*2de3b87aSKai Wangare those denoted by the 64*2de3b87aSKai Wang.Dv DW_AT_* 65*2de3b87aSKai Wangconstants in the DWARF specification. 66*2de3b87aSKai Wang.Pp 67*2de3b87aSKai WangArgument 68*2de3b87aSKai Wang.Ar atp 69*2de3b87aSKai Wangpoints to a location into which the returned attribute descriptor 70*2de3b87aSKai Wangwill be written. 71*2de3b87aSKai WangThe returned descriptor may then be passed to the form query functions in the 72*2de3b87aSKai Wang.Xr dwarf 3 73*2de3b87aSKai WangAPI set to access the data associated with the attribute. 74*2de3b87aSKai Wang.Pp 75*2de3b87aSKai WangIf argument 76*2de3b87aSKai Wang.Ar err 77*2de3b87aSKai Wangis non-NULL, it will be used to return an error descriptor in case 78*2de3b87aSKai Wangof an error. 79*2de3b87aSKai Wang.Sh RETURN VALUES 80*2de3b87aSKai WangFunction 81*2de3b87aSKai Wang.Fn dwarf_attr 82*2de3b87aSKai Wangreturns 83*2de3b87aSKai Wang.Dv DW_DLV_OK on success. 84*2de3b87aSKai Wang.Pp 85*2de3b87aSKai WangIf the debugging information entry descriptor denoted by argument 86*2de3b87aSKai Wang.Ar die 87*2de3b87aSKai Wangdoes not contain the named attribute, the function returns 88*2de3b87aSKai Wang.Dv DW_DLV_NO_ENTRY 89*2de3b87aSKai Wangand sets argument 90*2de3b87aSKai Wang.Ar err . 91*2de3b87aSKai WangFor other errors, it returns 92*2de3b87aSKai Wang.Dv DW_DLV_ERROR 93*2de3b87aSKai Wangand sets argument 94*2de3b87aSKai Wang.Ar err . 95*2de3b87aSKai Wang.Sh ERRORS 96*2de3b87aSKai WangFunction 97*2de3b87aSKai Wang.Fn dwarf_attr 98*2de3b87aSKai Wangcan fail with the following errors: 99*2de3b87aSKai Wang.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" 100*2de3b87aSKai Wang.It Bq Er DW_DLE_ARGUMENT 101*2de3b87aSKai WangEither of arguments 102*2de3b87aSKai Wang.Ar die 103*2de3b87aSKai Wangor 104*2de3b87aSKai Wang.Ar atp 105*2de3b87aSKai Wangwas NULL. 106*2de3b87aSKai Wang.It Bq Er DW_DLE_NO_ENTRY 107*2de3b87aSKai WangArgument 108*2de3b87aSKai Wang.Ar die 109*2de3b87aSKai Wanghad no attribute corresponding to the value 110*2de3b87aSKai Wangin argument 111*2de3b87aSKai Wang.Ar attr . 112*2de3b87aSKai Wang.El 113*2de3b87aSKai Wang.Sh SEE ALSO 114*2de3b87aSKai Wang.Xr dwarf 3 , 115*2de3b87aSKai Wang.Xr dwarf_attrlist 3 , 116*2de3b87aSKai Wang.Xr dwarf_hasattr 3 , 117*2de3b87aSKai Wang.Xr dwarf_hasform 3 , 118*2de3b87aSKai Wang.Xr dwarf_whatattr 3 , 119*2de3b87aSKai Wang.Xr dwarf_whatform 3 120