xref: /netbsd-src/external/bsd/elftoolchain/dist/libdwarf/dwarf_dealloc.3 (revision 5ac3bc719ce6e70593039505b491894133237d12)
1*5ac3bc71Schristos.\"	$NetBSD: dwarf_dealloc.3,v 1.6 2024/03/03 17:37:30 christos Exp $
2e81373b4Schristos.\"
39dd9d0cfSchristos.\" Copyright (c) 2009-2011 Joseph Koshy.  All rights reserved.
49dd9d0cfSchristos.\"
59dd9d0cfSchristos.\" Redistribution and use in source and binary forms, with or without
69dd9d0cfSchristos.\" modification, are permitted provided that the following conditions
79dd9d0cfSchristos.\" are met:
89dd9d0cfSchristos.\" 1. Redistributions of source code must retain the above copyright
99dd9d0cfSchristos.\"    notice, this list of conditions and the following disclaimer.
109dd9d0cfSchristos.\" 2. Redistributions in binary form must reproduce the above copyright
119dd9d0cfSchristos.\"    notice, this list of conditions and the following disclaimer in the
129dd9d0cfSchristos.\"    documentation and/or other materials provided with the distribution.
139dd9d0cfSchristos.\"
149dd9d0cfSchristos.\" This software is provided by Joseph Koshy ``as is'' and
159dd9d0cfSchristos.\" any express or implied warranties, including, but not limited to, the
169dd9d0cfSchristos.\" implied warranties of merchantability and fitness for a particular purpose
179dd9d0cfSchristos.\" are disclaimed.  in no event shall Joseph Koshy be liable
189dd9d0cfSchristos.\" for any direct, indirect, incidental, special, exemplary, or consequential
199dd9d0cfSchristos.\" damages (including, but not limited to, procurement of substitute goods
209dd9d0cfSchristos.\" or services; loss of use, data, or profits; or business interruption)
219dd9d0cfSchristos.\" however caused and on any theory of liability, whether in contract, strict
229dd9d0cfSchristos.\" liability, or tort (including negligence or otherwise) arising in any way
239dd9d0cfSchristos.\" out of the use of this software, even if advised of the possibility of
249dd9d0cfSchristos.\" such damage.
259dd9d0cfSchristos.\"
26cdbf1fe1Sjkoshy.\" Id: dwarf_dealloc.3 3961 2022-03-12 15:13:22Z jkoshy
279dd9d0cfSchristos.\"
289dd9d0cfSchristos.Dd July 23, 2011
299dd9d0cfSchristos.Dt DWARF_DEALLOC 3
30604b0842Sjkoshy.Os
319dd9d0cfSchristos.Sh NAME
329dd9d0cfSchristos.Nm dwarf_dealloc ,
339dd9d0cfSchristos.Nm dwarf_fde_cie_list_dealloc ,
349dd9d0cfSchristos.Nm dwarf_funcs_dealloc ,
359dd9d0cfSchristos.Nm dwarf_globals_dealloc ,
369dd9d0cfSchristos.Nm dwarf_pubtypes_dealloc ,
379dd9d0cfSchristos.Nm dwarf_ranges_dealloc ,
389dd9d0cfSchristos.Nm dwarf_srclines_dealloc ,
399dd9d0cfSchristos.Nm dwarf_types_dealloc ,
409dd9d0cfSchristos.Nm dwarf_vars_dealloc ,
419dd9d0cfSchristos.Nm dwarf_weaks_dealloc
429dd9d0cfSchristos.Nd release resources
439dd9d0cfSchristos.Sh LIBRARY
449dd9d0cfSchristos.Lb libdwarf
459dd9d0cfSchristos.Sh SYNOPSIS
469dd9d0cfSchristos.In libdwarf.h
479dd9d0cfSchristos.Ft void
489dd9d0cfSchristos.Fo dwarf_dealloc
499dd9d0cfSchristos.Fa "Dwarf_Debug dbg"
509dd9d0cfSchristos.Fa "Dwarf_Ptr ptr"
519dd9d0cfSchristos.Fa "Dwarf_Unsigned type"
529dd9d0cfSchristos.Fc
539dd9d0cfSchristos.Fo dwarf_fde_cie_list_dealloc
549dd9d0cfSchristos.Fa "Dwarf_Debug dbg"
559dd9d0cfSchristos.Fa "Dwarf_Cie *cie_list"
569dd9d0cfSchristos.Fa "Dwarf_Signed cie_count"
579dd9d0cfSchristos.Fa "Dwarf_Fde *fde_list"
589dd9d0cfSchristos.Fa "Dwarf_Signed fde_count"
599dd9d0cfSchristos.Fc
609dd9d0cfSchristos.Ft void
619dd9d0cfSchristos.Fo dwarf_funcs_dealloc
629dd9d0cfSchristos.Fa "Dwarf_Debug dbg"
639dd9d0cfSchristos.Fa "Dwarf_Func *funcs"
649dd9d0cfSchristos.Fa "Dwarf_Signed funccount"
659dd9d0cfSchristos.Fc
669dd9d0cfSchristos.Ft void
679dd9d0cfSchristos.Fo dwarf_globals_dealloc
689dd9d0cfSchristos.Fa "Dwarf_Debug dbg"
699dd9d0cfSchristos.Fa "Dwarf_Global *globals"
709dd9d0cfSchristos.Fa "Dwarf_Signed globalcount"
719dd9d0cfSchristos.Fc
729dd9d0cfSchristos.Ft void
739dd9d0cfSchristos.Fo dwarf_pubtypes_dealloc
749dd9d0cfSchristos.Fa "Dwarf_Debug dbg"
759dd9d0cfSchristos.Fa "Dwarf_Type *pubtypes"
769dd9d0cfSchristos.Fa "Dwarf_Signed pubtypecount"
779dd9d0cfSchristos.Fc
789dd9d0cfSchristos.Ft void
799dd9d0cfSchristos.Fo dwarf_ranges_dealloc
809dd9d0cfSchristos.Fa "Dwarf_Debug dbg"
819dd9d0cfSchristos.Fa "Dwarf_Ranges *ranges"
829dd9d0cfSchristos.Fa "Dwarf_Signed rangecount"
839dd9d0cfSchristos.Fc
849dd9d0cfSchristos.Ft void
859dd9d0cfSchristos.Fo dwarf_srclines_dealloc
869dd9d0cfSchristos.Fa "Dwarf_Debug dbg"
879dd9d0cfSchristos.Fa "Dwarf_Line *lines"
889dd9d0cfSchristos.Fa "Dwarf_Signed linecount"
899dd9d0cfSchristos.Fc
909dd9d0cfSchristos.Ft void
919dd9d0cfSchristos.Fo dwarf_types_dealloc
929dd9d0cfSchristos.Fa "Dwarf_Debug dbg"
939dd9d0cfSchristos.Fa "Dwarf_Type *types"
949dd9d0cfSchristos.Fa "Dwarf_Signed typecount"
959dd9d0cfSchristos.Fc
969dd9d0cfSchristos.Ft void
979dd9d0cfSchristos.Fo dwarf_vars_dealloc
989dd9d0cfSchristos.Fa "Dwarf_Debug dbg"
999dd9d0cfSchristos.Fa "Dwarf_Var *vars"
1009dd9d0cfSchristos.Fa "Dwarf_Signed varcount"
1019dd9d0cfSchristos.Fc
1029dd9d0cfSchristos.Ft void
1039dd9d0cfSchristos.Fo dwarf_weaks_dealloc
1049dd9d0cfSchristos.Fa "Dwarf_Debug dbg"
1059dd9d0cfSchristos.Fa "Dwarf_Weak *weaks"
1069dd9d0cfSchristos.Fa "Dwarf_Signed weakcount"
1079dd9d0cfSchristos.Fc
1089dd9d0cfSchristos.Sh DESCRIPTION
1099dd9d0cfSchristosThe function
1109dd9d0cfSchristos.Fn dwarf_dealloc
1119dd9d0cfSchristosis used by applications to indicate that memory areas returned by
1129dd9d0cfSchristos.Lb libdwarf
1139dd9d0cfSchristosmay be safely disposed off.
1149dd9d0cfSchristosDue to the way memory is managed in the current implementation, the
1159dd9d0cfSchristosuse of
1169dd9d0cfSchristos.Fn dwarf_dealloc
1179dd9d0cfSchristosis only necessary for a small set of DWARF types.
1189dd9d0cfSchristos.Pp
1199dd9d0cfSchristosArgument
120cdbf1fe1Sjkoshy.Fa dbg
1219dd9d0cfSchristosshould reference a valid debugging context allocated using
1229dd9d0cfSchristos.Xr dwarf_init 3 .
1239dd9d0cfSchristos.Pp
1249dd9d0cfSchristosArgument
125cdbf1fe1Sjkoshy.Fa ptr
1269dd9d0cfSchristosshould point to an object or memory area obtained by a prior call
1279dd9d0cfSchristosto a DWARF(3) function.
1289dd9d0cfSchristos.Pp
1299dd9d0cfSchristosArgument
130cdbf1fe1Sjkoshy.Fa type
1319dd9d0cfSchristosindicates the type of object being deallocated.
1329dd9d0cfSchristosThe indicated type must match that of the object being passed in
1339dd9d0cfSchristosargument
134cdbf1fe1Sjkoshy.Fa ptr .
1359dd9d0cfSchristosValid values for the
136cdbf1fe1Sjkoshy.Fa type
1379dd9d0cfSchristosargument are:
1389dd9d0cfSchristos.Bl -tag -width ".Dv DW_DLA_FRAME_BLOCK"
1399dd9d0cfSchristos.It Dv DW_DLA_ABBREV
1409dd9d0cfSchristosAn object of type
1419dd9d0cfSchristos.Vt Dwarf_Abbrev ,
1429dd9d0cfSchristosas returned by a call to the function
1439dd9d0cfSchristos.Xr dwarf_get_abbrev 3 .
1449dd9d0cfSchristos.It Dv DW_DLA_DIE
1459dd9d0cfSchristosAn object of type
1469dd9d0cfSchristos.Vt Dwarf_Die ,
1479dd9d0cfSchristosas returned by calls to the functions
1489dd9d0cfSchristos.Xr dwarf_child 3 ,
1499dd9d0cfSchristos.Xr dwarf_offdie 3
1509dd9d0cfSchristosor
1519dd9d0cfSchristos.Xr dwarf_siblingof 3 .
1529dd9d0cfSchristos.It Dv DW_DLA_FRAME_BLOCK
1539dd9d0cfSchristosAn array of objects of type
1549dd9d0cfSchristos.Vt Dwarf_Frame_op ,
1559dd9d0cfSchristosas returned by a call to the function
1569dd9d0cfSchristos.Xr dwarf_expand_frame_instructions 3 .
1579dd9d0cfSchristos.El
1589dd9d0cfSchristos.Pp
1599dd9d0cfSchristosCalls to
1609dd9d0cfSchristos.Fn dwarf_dealloc
1619dd9d0cfSchristoswith other values for argument
162cdbf1fe1Sjkoshy.Fa type
1639dd9d0cfSchristosare no-ops in this implementation.
1649dd9d0cfSchristos.Pp
1659dd9d0cfSchristosThe functions
1669dd9d0cfSchristos.Fn dwarf_fde_cie_list_dealloc ,
1679dd9d0cfSchristos.Fn dwarf_funcs_dealloc ,
1689dd9d0cfSchristos.Fn dwarf_globals_dealloc ,
1699dd9d0cfSchristos.Fn dwarf_pubtypes_dealloc ,
1709dd9d0cfSchristos.Fn dwarf_ranges_dealloc ,
1719dd9d0cfSchristos.Fn dwarf_srclines_dealloc ,
1729dd9d0cfSchristos.Fn dwarf_types_dealloc ,
1739dd9d0cfSchristos.Fn dwarf_vars_dealloc
1749dd9d0cfSchristosand
1759dd9d0cfSchristos.Fn dwarf_weaks_dealloc
1769dd9d0cfSchristosare provided for compatibility with other implementations of the
1779dd9d0cfSchristosDWARF(3) API.
1789dd9d0cfSchristosDue to the way memory is managed in the current implementation, these
1799dd9d0cfSchristosfunctions are effectively no-ops.
1809dd9d0cfSchristos.Pp
1819dd9d0cfSchristosSee
1829dd9d0cfSchristos.Xr dwarf 3
1839dd9d0cfSchristosfor more information about the memory management scheme in this
1849dd9d0cfSchristosimplementation of the DWARF(3) API.
1859dd9d0cfSchristos.Sh RETURN VALUES
1869dd9d0cfSchristosFunctions
1879dd9d0cfSchristos.Fn dwarf_dealloc ,
1889dd9d0cfSchristos.Fn dwarf_fde_cie_list_dealloc ,
1899dd9d0cfSchristos.Fn dwarf_funcs_dealloc ,
1909dd9d0cfSchristos.Fn dwarf_globals_dealloc ,
1919dd9d0cfSchristos.Fn dwarf_pubtypes_dealloc ,
1929dd9d0cfSchristos.Fn dwarf_ranges_dealloc ,
1939dd9d0cfSchristos.Fn dwarf_srclines_dealloc ,
1949dd9d0cfSchristos.Fn dwarf_types_dealloc ,
1959dd9d0cfSchristos.Fn dwarf_vars_dealloc
1969dd9d0cfSchristosand
1979dd9d0cfSchristos.Fn dwarf_weaks_dealloc
1989dd9d0cfSchristoshave no return value.
1999dd9d0cfSchristos.Sh SEE ALSO
2009dd9d0cfSchristos.Xr dwarf 3 ,
2019dd9d0cfSchristos.Xr dwarf_child 3 ,
2029dd9d0cfSchristos.Xr dwarf_expand_frame_instructions 3 ,
2039dd9d0cfSchristos.Xr dwarf_get_abbrev 3 ,
2049dd9d0cfSchristos.Xr dwarf_offdie 3 ,
2059dd9d0cfSchristos.Xr dwarf_siblingof 3
206