xref: /netbsd-src/external/bsd/elftoolchain/dist/libdwarf/dwarf_get_section_max_offsets.3 (revision 82d56013d7b633d116a93943de88e08335357a7c)
1.\"	$NetBSD: dwarf_get_section_max_offsets.3,v 1.3 2020/11/26 22:51:35 jkoshy 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 3644 2018-10-15 19:55:01Z 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.Ar 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 NULL may be used for any of the arguments
85.Ar debug_info ,
86.Ar debug_abbrev ,
87.Ar debug_line ,
88.Ar debug_loc ,
89.Ar debug_aranges ,
90.Ar debug_macinfo ,
91.Ar debug_pubnames ,
92.Ar debug_str ,
93.Ar debug_frame ,
94.Ar debug_ranges ,
95.Ar debug_pubtypes
96and
97.Ar debug_types
98if the caller is not interested in the respective section size.
99.Pp
100Function
101.Fn dwarf_get_section_max_offsets
102is identical to function
103.Fn dwarf_get_section_max_offsets_b
104except that it does not provide argument
105.Ar debug_types ,
106and thus cannot return the size of the
107.Dq \&.debug_types
108section.
109.Sh RETURN VALUES
110On success, these functions return
111.Dv DW_DLV_OK .
112If argument
113.Ar dbg
114is NULL, they return
115.Dv DW_DLV_ERROR .
116.Sh SEE ALSO
117.Xr dwarf 3 ,
118.Xr dwarf_init 3
119