Debian Codegraph @

src/lib/libdwarf/dwarf_loclists.h

raw
1 /*
2 Copyright (C) 2000, 2004 Silicon Graphics, Inc. All Rights Rese rved.
3 Portions Copyright (C) 2015-2023 David Anderson. All Rights Rese rved.
4
5 This program is free software; you can redistribute it
6 and/or modify it under the terms of version 2.1 of the
7 GNU Lesser General Public License as published by the Free
8 Software Foundation.
9
10 This program is distributed in the hope that it would be
11 useful, but WITHOUT ANY WARRANTY; without even the implied
12 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE.
14
15 Further, this software is distributed without any warranty
16 that it is free of the rightful claim of any third person
17 regarding infringement or the like. Any license provided
18 herein, whether implied or otherwise, applies only to this
19 software file. Patent licenses, if any, provided herein
20 do not apply to combinations of this program with other
21 software, or any other product whatsoever.
22
23 You should have received a copy of the GNU Lesser General
24 Public License along with this program; if not, write the
25 Free Software Foundation, Inc., 51 Franklin Street - Fifth
26 Floor, Boston MA 02110-1301, USA.
27 */
28
29 /* Dwarf_Loclists_Context_s contains the data from
30 the .debug_loclists
31 section headers (if that section exists).
32 Dwarf 2,3,4 .debug_loc
33 has no such data. The array (one of these per header in
34 .debug_loclists) is recorded in Dwarf_Debug. These
35 are filled in at startup at the same time .debug_info
36 is opened. Nothing of this struct is exposed to
37 libdwarf callers */
38 struct Dwarf_Loclists_Context_s {
39 Dwarf_Debug lc_dbg;
40 Dwarf_Unsigned lc_index; /* An index assigned by
41 libdwarf to each loclists context. Starting
42 with zero at the zero offset in .debug_loclists. */
43
44 /* Offset of the .debug_loclists header involved. */
45 Dwarf_Unsigned lc_header_offset;
46 Dwarf_Unsigned lc_length;
47 unsigned long lc_magic;
48
49 /* Many places in in libdwarf this is called length_size. */
50 Dwarf_Small lc_offset_size;
51
52 /* rc_extension_size is zero unless this is standard
53 DWARF3 and later 64bit dwarf using the extension mechanism.
54 64bit DWARF3 and later: rc_extension_size is 4.
55 64bit DWARF2 MIPS/IRIX: rc_extension_size is zero.
56 32bit DWARF: rc_extension_size is zero. */
57 Dwarf_Small lc_extension_size;
58 Dwarf_Small lc_address_size;
59 Dwarf_Small lc_segment_selector_size;
60 Dwarf_Half lc_version; /* 5 */
61 Dwarf_Unsigned lc_offset_entry_count;
62 /* lc_offset_entry_count values. Each local offset to
63 a locdesc set. We need this as a way to know
64 which lle entry offsets are relevant from a loclistx.
65 as nothing else reveals these special LLE entries. */
66 Dwarf_Unsigned *lc_offset_value_array;
67
68 /* offset in the section of the offset entries */
69 Dwarf_Unsigned lc_offsets_off_in_sect;
70
71 /* Do not free. Points into section memory */
72 Dwarf_Small * lc_offsets_array;
73
74 /* Offset in the .debug_loclists section of the
75 first loclist in the set of loclists for the
76 CU. */
77 Dwarf_Unsigned lc_first_loclist_offset;
78 Dwarf_Unsigned lc_past_last_loclist_offset;
79
80 /* pointer to 1st byte of loclist header*/
81 Dwarf_Small * lc_loclists_header;
82 /* pointer to first byte of the loclist data
83 for loclist involved. Do not free. */
84 Dwarf_Small *lc_startaddr;
85 /* pointer one past end of the loclist data. */
86 Dwarf_Small *lc_endaddr;
87 };