1*5ac3bc71Schristos.\" $NetBSD: dwarf_add_expr_addr.3,v 1.6 2024/03/03 17:37:30 christos Exp $ 2e81373b4Schristos.\" 39dd9d0cfSchristos.\" Copyright (c) 2011 Kai Wang 49dd9d0cfSchristos.\" All rights reserved. 59dd9d0cfSchristos.\" 69dd9d0cfSchristos.\" Redistribution and use in source and binary forms, with or without 79dd9d0cfSchristos.\" modification, are permitted provided that the following conditions 89dd9d0cfSchristos.\" are met: 99dd9d0cfSchristos.\" 1. Redistributions of source code must retain the above copyright 109dd9d0cfSchristos.\" notice, this list of conditions and the following disclaimer. 119dd9d0cfSchristos.\" 2. Redistributions in binary form must reproduce the above copyright 129dd9d0cfSchristos.\" notice, this list of conditions and the following disclaimer in the 139dd9d0cfSchristos.\" documentation and/or other materials provided with the distribution. 149dd9d0cfSchristos.\" 159dd9d0cfSchristos.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 169dd9d0cfSchristos.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 179dd9d0cfSchristos.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 189dd9d0cfSchristos.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 199dd9d0cfSchristos.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 209dd9d0cfSchristos.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 219dd9d0cfSchristos.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 229dd9d0cfSchristos.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 239dd9d0cfSchristos.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 249dd9d0cfSchristos.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 259dd9d0cfSchristos.\" SUCH DAMAGE. 269dd9d0cfSchristos.\" 27cdbf1fe1Sjkoshy.\" Id: dwarf_add_expr_addr.3 3961 2022-03-12 15:13:22Z jkoshy 289dd9d0cfSchristos.\" 299dd9d0cfSchristos.Dd September 9, 2011 309dd9d0cfSchristos.Dt DWARF_ADD_EXPR_ADDR 3 31604b0842Sjkoshy.Os 329dd9d0cfSchristos.Sh NAME 339dd9d0cfSchristos.Nm dwarf_add_expr_addr , 349dd9d0cfSchristos.Nm dwarf_add_expr_addr_b 359dd9d0cfSchristos.Nd add a DW_OP_addr location expression 369dd9d0cfSchristos.Sh LIBRARY 379dd9d0cfSchristos.Lb libdwarf 389dd9d0cfSchristos.Sh SYNOPSIS 399dd9d0cfSchristos.In libdwarf.h 409dd9d0cfSchristos.Ft "Dwarf_Unsigned" 419dd9d0cfSchristos.Fo dwarf_add_expr_addr 429dd9d0cfSchristos.Fa "Dwarf_P_Expr expr" 439dd9d0cfSchristos.Fa "Dwarf_Unsigned address" 449dd9d0cfSchristos.Fa "Dwarf_Signed sym_index" 459dd9d0cfSchristos.Fa "Dwarf_Error *err" 469dd9d0cfSchristos.Fc 479dd9d0cfSchristos.Ft "Dwarf_Unsigned" 489dd9d0cfSchristos.Fo dwarf_add_expr_addr_b 499dd9d0cfSchristos.Fa "Dwarf_P_Expr expr" 509dd9d0cfSchristos.Fa "Dwarf_Unsigned address" 519dd9d0cfSchristos.Fa "Dwarf_Unsigned sym_index" 529dd9d0cfSchristos.Fa "Dwarf_Error *err" 539dd9d0cfSchristos.Fc 549dd9d0cfSchristos.Sh DESCRIPTION 559dd9d0cfSchristosFunction 569dd9d0cfSchristos.Fn dwarf_add_expr_addr_b 579dd9d0cfSchristosadds a 589dd9d0cfSchristos.Dv DW_OP_addr 599dd9d0cfSchristoslocation expression to the location expression descriptor referenced 609dd9d0cfSchristosby argument 61cdbf1fe1Sjkoshy.Fa expr . 629dd9d0cfSchristos.Pp 639dd9d0cfSchristosArgument 64cdbf1fe1Sjkoshy.Fa expr 659dd9d0cfSchristosshould reference a location expression descriptor allocated using 669dd9d0cfSchristosthe function 679dd9d0cfSchristos.Xr dwarf_new_expr 3 . 689dd9d0cfSchristos.Pp 699dd9d0cfSchristosArgument 70cdbf1fe1Sjkoshy.Fa address 719dd9d0cfSchristosspecifies the operand, a relocatable address value. 729dd9d0cfSchristos.Pp 739dd9d0cfSchristosArgument 74cdbf1fe1Sjkoshy.Fa sym_index 759dd9d0cfSchristosspecifies the ELF symbol index of the symbol to be used for 769dd9d0cfSchristosrelocation. 779dd9d0cfSchristos.Pp 789dd9d0cfSchristosIf argument 79cdbf1fe1Sjkoshy.Fa err 80cdbf1fe1Sjkoshyis not 81cdbf1fe1Sjkoshy.Dv NULL , 82cdbf1fe1Sjkoshyit will be used to store error information in case of an error. 839dd9d0cfSchristos.Pp 849dd9d0cfSchristosFunction 859dd9d0cfSchristos.Fn dwarf_add_expr_addr 869dd9d0cfSchristosis deprecated. 879dd9d0cfSchristosIt is similar to function 889dd9d0cfSchristos.Fn dwarf_add_expr_addr_b 899dd9d0cfSchristosexcept that it cannot handle all possible symbol index values. 909dd9d0cfSchristos.Sh RETURN VALUES 919dd9d0cfSchristosOn success, these functions return the size in bytes of the location 929dd9d0cfSchristosexpression byte stream generated. 939dd9d0cfSchristosIn case of an error, these functions return 949dd9d0cfSchristos.Dv DW_DLV_NOCOUNT 959dd9d0cfSchristosand set the argument 96cdbf1fe1Sjkoshy.Fa err . 979dd9d0cfSchristos.Sh ERRORS 989dd9d0cfSchristosThese functions can fail with: 999dd9d0cfSchristos.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" 1009dd9d0cfSchristos.It Bq Er DW_DLE_ARGUMENT 1019dd9d0cfSchristosArgument 102cdbf1fe1Sjkoshy.Fa expr 103cdbf1fe1Sjkoshywas 104cdbf1fe1Sjkoshy.Dv NULL . 1059dd9d0cfSchristos.It Bq Er DW_DLE_MEMORY 1069dd9d0cfSchristosAn out of memory condition was encountered during the execution of 1079dd9d0cfSchristosthe function. 1089dd9d0cfSchristos.El 1099dd9d0cfSchristos.Sh SEE ALSO 1109dd9d0cfSchristos.Xr dwarf 3 , 1119dd9d0cfSchristos.Xr dwarf_add_AT_location_expr 3 , 1129dd9d0cfSchristos.Xr dwarf_add_expr_gen 3 , 1139dd9d0cfSchristos.Xr dwarf_expr_current_offset 3 , 1149dd9d0cfSchristos.Xr dwarf_expr_into_block 3 , 1159dd9d0cfSchristos.Xr dwarf_new_expr 3 116