xref: /netbsd-src/external/bsd/elftoolchain/dist/libdwarf/dwarf_get_section_max_offsets.3 (revision 5ac3bc719ce6e70593039505b491894133237d12)
1.\"	$NetBSD: dwarf_get_section_max_offsets.3,v 1.5 2024/03/03 17:37:31 christos Exp $
2.\"
3.\" Copyright (c) 2014 Kai Wang
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" Id: dwarf_get_section_max_offsets.3 3963 2022-03-12 16:07:32Z jkoshy
28.\"
29.Dd December 21, 2014
30.Dt DWARF_GET_SECTION_MAX_OFFSETS 3
31.Os
32.Sh NAME
33.Nm dwarf_get_section_max_offsets ,
34.Nm dwarf_get_section_max_offsets_b
35.Nd return the size of DWARF sections
36.Sh LIBRARY
37.Lb libdwarf
38.Sh SYNOPSIS
39.In libdwarf.h
40.Ft int
41.Fo dwarf_get_section_max_offsets
42.Fa "Dwarf_Debug dbg"
43.Fa "Dwarf_Unsigned *debug_info"
44.Fa "Dwarf_Unsigned *debug_abbrev"
45.Fa "Dwarf_Unsigned *debug_line"
46.Fa "Dwarf_Unsigned *debug_loc"
47.Fa "Dwarf_Unsigned *debug_aranges"
48.Fa "Dwarf_Unsigned *debug_macinfo"
49.Fa "Dwarf_Unsigned *debug_pubnames"
50.Fa "Dwarf_Unsigned *debug_str"
51.Fa "Dwarf_Unsigned *debug_frame"
52.Fa "Dwarf_Unsigned *debug_ranges"
53.Fa "Dwarf_Unsigned *debug_pubtypes"
54.Fc
55.Ft int
56.Fo dwarf_get_section_max_offsets_b
57.Fa "Dwarf_Debug dbg"
58.Fa "Dwarf_Unsigned *debug_info"
59.Fa "Dwarf_Unsigned *debug_abbrev"
60.Fa "Dwarf_Unsigned *debug_line"
61.Fa "Dwarf_Unsigned *debug_loc"
62.Fa "Dwarf_Unsigned *debug_aranges"
63.Fa "Dwarf_Unsigned *debug_macinfo"
64.Fa "Dwarf_Unsigned *debug_pubnames"
65.Fa "Dwarf_Unsigned *debug_str"
66.Fa "Dwarf_Unsigned *debug_frame"
67.Fa "Dwarf_Unsigned *debug_ranges"
68.Fa "Dwarf_Unsigned *debug_pubtypes"
69.Fa "Dwarf_Unsigned *debug_types"
70.Fc
71.Sh DESCRIPTION
72Function
73.Fn dwarf_get_section_max_offsets_b
74retrieves the sizes of the DWARF sections in a DWARF debug context.
75Argument
76.Fa dbg
77should reference a DWARF debug context allocated using
78.Xr dwarf_init 3 .
79The function stores the size of each DWARF section to the location
80pointed to by the argument corresponding to the section name.
81If a DWARF section does not exist, the location pointed to by the
82argument corresponding to that section will be set to zero.
83.Pp
84A value of
85.Dv NULL
86may be used for any of the arguments
87.Fa debug_info ,
88.Fa debug_abbrev ,
89.Fa debug_line ,
90.Fa debug_loc ,
91.Fa debug_aranges ,
92.Fa debug_macinfo ,
93.Fa debug_pubnames ,
94.Fa debug_str ,
95.Fa debug_frame ,
96.Fa debug_ranges ,
97.Fa debug_pubtypes
98and
99.Fa debug_types
100if the caller is not interested in the respective section size.
101.Pp
102Function
103.Fn dwarf_get_section_max_offsets
104is identical to function
105.Fn dwarf_get_section_max_offsets_b
106except that it does not provide argument
107.Fa debug_types ,
108and thus cannot return the size of the
109.Dq \&.debug_types
110section.
111.Sh RETURN VALUES
112On success, these functions return
113.Dv DW_DLV_OK .
114If argument
115.Fa dbg
116is
117.Dv NULL ,
118they return
119.Dv DW_DLV_ERROR .
120.Sh SEE ALSO
121.Xr dwarf 3 ,
122.Xr dwarf_init 3
123