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