1*5ac3bc71Schristos.\" $NetBSD: dwarf_attroffset.3,v 1.5 2024/03/03 17:37:30 christos Exp $ 239a6cffcSchristos.\" 339a6cffcSchristos.\" Copyright (c) 2014 Kai Wang 439a6cffcSchristos.\" All rights reserved. 539a6cffcSchristos.\" 639a6cffcSchristos.\" Redistribution and use in source and binary forms, with or without 739a6cffcSchristos.\" modification, are permitted provided that the following conditions 839a6cffcSchristos.\" are met: 939a6cffcSchristos.\" 1. Redistributions of source code must retain the above copyright 1039a6cffcSchristos.\" notice, this list of conditions and the following disclaimer. 1139a6cffcSchristos.\" 2. Redistributions in binary form must reproduce the above copyright 1239a6cffcSchristos.\" notice, this list of conditions and the following disclaimer in the 1339a6cffcSchristos.\" documentation and/or other materials provided with the distribution. 1439a6cffcSchristos.\" 1539a6cffcSchristos.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1639a6cffcSchristos.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1739a6cffcSchristos.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1839a6cffcSchristos.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1939a6cffcSchristos.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2039a6cffcSchristos.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2139a6cffcSchristos.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2239a6cffcSchristos.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2339a6cffcSchristos.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2439a6cffcSchristos.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2539a6cffcSchristos.\" SUCH DAMAGE. 2639a6cffcSchristos.\" 27cdbf1fe1Sjkoshy.\" Id: dwarf_attroffset.3 3961 2022-03-12 15:13:22Z jkoshy 2839a6cffcSchristos.\" 2939a6cffcSchristos.Dd December 20, 2014 3039a6cffcSchristos.Dt DWARF_ATTROFFSET 3 31604b0842Sjkoshy.Os 3239a6cffcSchristos.Sh NAME 3339a6cffcSchristos.Nm dwarf_attroffset 3439a6cffcSchristos.Nd retrieve the section-relative offset of an attribute descriptor 3539a6cffcSchristos.Sh LIBRARY 3639a6cffcSchristos.Lb libdwarf 3739a6cffcSchristos.Sh SYNOPSIS 3839a6cffcSchristos.In libdwarf.h 3939a6cffcSchristos.Ft int 4039a6cffcSchristos.Fo dwarf_attroffset 4139a6cffcSchristos.Fa "Dwarf_Attribute at" 4239a6cffcSchristos.Fa "Dwarf_Off *ret_off" 4339a6cffcSchristos.Fa "Dwarf_Error *err" 4439a6cffcSchristos.Fc 4539a6cffcSchristos.Sh DESCRIPTION 4639a6cffcSchristosFunction 4739a6cffcSchristos.Fn dwarf_attroffset 4839a6cffcSchristosretrieves the section-relative offset of the attribute descriptor 4939a6cffcSchristosreferenced by argument 50cdbf1fe1Sjkoshy.Fa at . 5139a6cffcSchristos.Pp 5239a6cffcSchristosArgument 53cdbf1fe1Sjkoshy.Fa ret_off 5439a6cffcSchristosshould point to a location that is to hold the returned 5539a6cffcSchristossection-relative offset. 5639a6cffcSchristosIf argument 57cdbf1fe1Sjkoshy.Fa err 58cdbf1fe1Sjkoshyis 59cdbf1fe1Sjkoshy.No non- Ns Dv NULL , 60cdbf1fe1Sjkoshyit is used to return an error descriptor in case of an error. 6139a6cffcSchristos.Sh RETURN VALUES 6239a6cffcSchristosOn success, function 6339a6cffcSchristos.Fn dwarf_attroffset 6439a6cffcSchristosreturns 6539a6cffcSchristos.Dv DW_DLV_OK . 6639a6cffcSchristos.Pp 6739a6cffcSchristosIn case of an error, it returns 6839a6cffcSchristos.Dv DW_DLV_ERROR 6939a6cffcSchristosand sets argument 70cdbf1fe1Sjkoshy.Fa err . 7139a6cffcSchristos.Sh COMPATIBILITY 7239a6cffcSchristosThis function is an extension to the 7339a6cffcSchristos.Xr DWARF 3 7439a6cffcSchristosAPI. 7539a6cffcSchristos.Sh ERRORS 7639a6cffcSchristosThe 7739a6cffcSchristos.Fn dwarf_attroffset 7839a6cffcSchristosfunction may fail with the following errors: 7939a6cffcSchristos.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" 8039a6cffcSchristos.It Bq Er DW_DLE_ARGUMENT 8139a6cffcSchristosEither of the arguments 82cdbf1fe1Sjkoshy.Fa at 8339a6cffcSchristosor 84cdbf1fe1Sjkoshy.Fa ret_off 85cdbf1fe1Sjkoshywas 86cdbf1fe1Sjkoshy.Dv NULL . 8739a6cffcSchristos.El 8839a6cffcSchristos.Sh SEE ALSO 8939a6cffcSchristos.Xr dwarf 3 , 9039a6cffcSchristos.Xr dwarf_attr 3 91