xref: /netbsd-src/external/bsd/elftoolchain/dist/libdwarf/dwarf_get_fde_range.3 (revision 5ac3bc719ce6e70593039505b491894133237d12)
1*5ac3bc71Schristos.\"	$NetBSD: dwarf_get_fde_range.3,v 1.6 2024/03/03 17:37:31 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_get_fde_range.3 3962 2022-03-12 15:56:10Z jkoshy
289dd9d0cfSchristos.\"
299dd9d0cfSchristos.Dd May 22, 2011
309dd9d0cfSchristos.Dt DWARF_GET_FDE_RANGE 3
31604b0842Sjkoshy.Os
329dd9d0cfSchristos.Sh NAME
339dd9d0cfSchristos.Nm dwarf_get_fde_range
349dd9d0cfSchristos.Nd retrieve range information from an FDE descriptor
359dd9d0cfSchristos.Sh LIBRARY
369dd9d0cfSchristos.Lb libdwarf
379dd9d0cfSchristos.Sh SYNOPSIS
389dd9d0cfSchristos.In libdwarf.h
399dd9d0cfSchristos.Ft int
409dd9d0cfSchristos.Fo dwarf_get_fde_range
419dd9d0cfSchristos.Fa "Dwarf_Fde fde"
429dd9d0cfSchristos.Fa "Dwarf_Addr *low_pc"
439dd9d0cfSchristos.Fa "Dwarf_Unsigned *func_len"
449dd9d0cfSchristos.Fa "Dwarf_Ptr *fde_bytes"
459dd9d0cfSchristos.Fa "Dwarf_Unsigned *fde_byte_len"
469dd9d0cfSchristos.Fa "Dwarf_Off *cie_offset"
479dd9d0cfSchristos.Fa "Dwarf_Signed *cie_index"
489dd9d0cfSchristos.Fa "Dwarf_Off *fde_offset"
499dd9d0cfSchristos.Fa "Dwarf_Error *err"
509dd9d0cfSchristos.Fc
519dd9d0cfSchristos.Sh DESCRIPTION
529dd9d0cfSchristosFunction
539dd9d0cfSchristos.Fn dwarf_get_fde_range
549dd9d0cfSchristosretrieves range and offset information from a given FDE descriptor.
559dd9d0cfSchristos.Pp
569dd9d0cfSchristosArgument
57cdbf1fe1Sjkoshy.Fa fde
589dd9d0cfSchristosshould reference a valid DWARF FDE descriptor.
599dd9d0cfSchristos.Pp
609dd9d0cfSchristosArgument
61cdbf1fe1Sjkoshy.Fa low_pc
629dd9d0cfSchristosshould point to a location that will be set to the lowest
639dd9d0cfSchristosprogram counter address covered by the FDE descriptor.
649dd9d0cfSchristos.Pp
659dd9d0cfSchristosArgument
66cdbf1fe1Sjkoshy.Fa func_len
679dd9d0cfSchristosshould point to a location that will hold the length in bytes of
689dd9d0cfSchristosthe address range covered by the FDE descriptor.
699dd9d0cfSchristos.Pp
709dd9d0cfSchristosArgument
71cdbf1fe1Sjkoshy.Fa fde_bytes
729dd9d0cfSchristosshould point to a location that will be set to a pointer to the
739dd9d0cfSchristoscontent of the FDE descriptor itself.
749dd9d0cfSchristos.Pp
759dd9d0cfSchristosArgument
76cdbf1fe1Sjkoshy.Fa fde_byte_len
779dd9d0cfSchristosshould point to a location that will hold the length in bytes of
789dd9d0cfSchristosthe FDE descriptor itself.
799dd9d0cfSchristos.Pp
809dd9d0cfSchristosArgument
81cdbf1fe1Sjkoshy.Fa cie_offset
829dd9d0cfSchristosshould point to a location that will be set to the offset, relative to
839dd9d0cfSchristosthe DWARF
849dd9d0cfSchristos.Dq ".debug_frame"
859dd9d0cfSchristossection, of the CIE descriptor associated with the given FDE
869dd9d0cfSchristosdescriptor.
879dd9d0cfSchristos.Pp
889dd9d0cfSchristosArgument
89cdbf1fe1Sjkoshy.Fa cie_index
909dd9d0cfSchristosshould point to a location that will hold the index of the CIE
919dd9d0cfSchristosdescriptor associated with the FDE descriptor.
929dd9d0cfSchristosThe returned value is a zero-based index into the array of CIE
939dd9d0cfSchristosdescriptors returned by a prior call to functions
949dd9d0cfSchristos.Xr dwarf_get_fde_list 3
959dd9d0cfSchristosor
969dd9d0cfSchristos.Xr dwarf_get_fde_list_eh 3 .
979dd9d0cfSchristos.Pp
989dd9d0cfSchristosArgument
99cdbf1fe1Sjkoshy.Fa fde_offset
1009dd9d0cfSchristosshould point to a location that will be set to the offset, relative to
1019dd9d0cfSchristosthe DWARF
1029dd9d0cfSchristos.Dq ".debug_frame"
1039dd9d0cfSchristossection, of the FDE descriptor.
1049dd9d0cfSchristos.Pp
1059dd9d0cfSchristosIf argument
106cdbf1fe1Sjkoshy.Fa err
107cdbf1fe1Sjkoshyis not
108cdbf1fe1Sjkoshy.Dv NULL ,
109cdbf1fe1Sjkoshyit will be used to store error information in case of an error.
1109dd9d0cfSchristos.Sh RETURN VALUES
1119dd9d0cfSchristosFunction
1129dd9d0cfSchristos.Fn dwarf_get_fde_range
1139dd9d0cfSchristosreturns
1149dd9d0cfSchristos.Dv DW_DLV_OK
1159dd9d0cfSchristoswhen it succeeds.
1169dd9d0cfSchristosIn case of an error, it returns
1179dd9d0cfSchristos.Dv DW_DLV_ERROR
1189dd9d0cfSchristosand sets the argument
119cdbf1fe1Sjkoshy.Fa err .
1209dd9d0cfSchristos.Sh ERRORS
1219dd9d0cfSchristosFunction
1229dd9d0cfSchristos.Fn dwarf_get_fde_range
1239dd9d0cfSchristoscan fail with:
1249dd9d0cfSchristos.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT"
1259dd9d0cfSchristos.It Bq Er DW_DLE_ARGUMENT
1269dd9d0cfSchristosOne of the arguments
127cdbf1fe1Sjkoshy.Fa fde ,
128cdbf1fe1Sjkoshy.Fa low_pc ,
129cdbf1fe1Sjkoshy.Fa func_len ,
130cdbf1fe1Sjkoshy.Fa fde_bytes ,
131cdbf1fe1Sjkoshy.Fa fde_byte_len ,
132cdbf1fe1Sjkoshy.Fa cie_offset ,
133cdbf1fe1Sjkoshy.Fa cie_index
1349dd9d0cfSchristosor
135cdbf1fe1Sjkoshy.Fa fde_offset
136cdbf1fe1Sjkoshywas
137cdbf1fe1Sjkoshy.Dv NULL .
1389dd9d0cfSchristos.El
1399dd9d0cfSchristos.Sh SEE ALSO
1409dd9d0cfSchristos.Xr dwarf 3 ,
1419dd9d0cfSchristos.Xr dwarf_get_cie_index 3 ,
142604b0842Sjkoshy.Xr dwarf_get_cie_info 3 ,
143604b0842Sjkoshy.Xr dwarf_get_cie_of_fde 3 ,
1449dd9d0cfSchristos.Xr dwarf_get_fde_at_pc 3 ,
1459dd9d0cfSchristos.Xr dwarf_get_fde_info_for_all_regs 3 ,
1469dd9d0cfSchristos.Xr dwarf_get_fde_info_for_all_regs3 3 ,
1479dd9d0cfSchristos.Xr dwarf_get_fde_info_for_cfa_reg3 3 ,
1489dd9d0cfSchristos.Xr dwarf_get_fde_info_for_reg 3 ,
1499dd9d0cfSchristos.Xr dwarf_get_fde_info_for_reg3 3 ,
1509dd9d0cfSchristos.Xr dwarf_get_fde_instr_bytes 3 ,
1519dd9d0cfSchristos.Xr dwarf_get_fde_list 3 ,
1529dd9d0cfSchristos.Xr dwarf_get_fde_list_eh 3 ,
1539dd9d0cfSchristos.Xr dwarf_get_fde_n 3
154