* configure.ac (native_only): Remove.
[deliverable/binutils-gdb.git] / binutils / dwarf.h
CommitLineData
1b315056 1/* dwarf.h - DWARF support header file
b7807392 2 Copyright 2005, 2007, 2008, 2009, 2010
19e6b90e
L
3 Free Software Foundation, Inc.
4
32866df7 5 This file is part of GNU Binutils.
19e6b90e 6
32866df7
NC
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
19e6b90e 11
32866df7
NC
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
19e6b90e 16
32866df7
NC
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
19e6b90e 21
3284fe0c
L
22typedef unsigned HOST_WIDEST_INT dwarf_vma;
23typedef unsigned HOST_WIDEST_INT dwarf_size_type;
19e6b90e 24
47704ddf
KT
25/* Structure found in the .debug_line section. */
26typedef struct
27{
28 unsigned char li_length [4];
29 unsigned char li_version [2];
30 unsigned char li_prologue_length [4];
31 unsigned char li_min_insn_length [1];
32 unsigned char li_default_is_stmt [1];
33 unsigned char li_line_base [1];
34 unsigned char li_line_range [1];
35 unsigned char li_opcode_base [1];
36}
37DWARF2_External_LineInfo;
38
39typedef struct
40{
41 bfd_vma li_length;
42 unsigned short li_version;
43 unsigned int li_prologue_length;
44 unsigned char li_min_insn_length;
45 unsigned char li_max_ops_per_insn;
46 unsigned char li_default_is_stmt;
47 int li_line_base;
48 unsigned char li_line_range;
49 unsigned char li_opcode_base;
50}
51DWARF2_Internal_LineInfo;
52
53/* Structure found in .debug_pubnames section. */
54typedef struct
55{
56 unsigned char pn_length [4];
57 unsigned char pn_version [2];
58 unsigned char pn_offset [4];
59 unsigned char pn_size [4];
60}
61DWARF2_External_PubNames;
62
63typedef struct
64{
65 bfd_vma pn_length;
66 unsigned short pn_version;
67 bfd_vma pn_offset;
68 bfd_vma pn_size;
69}
70DWARF2_Internal_PubNames;
71
72/* Structure found in .debug_info section. */
73typedef struct
74{
75 unsigned char cu_length [4];
76 unsigned char cu_version [2];
77 unsigned char cu_abbrev_offset [4];
78 unsigned char cu_pointer_size [1];
79}
80DWARF2_External_CompUnit;
81
82typedef struct
83{
84 bfd_vma cu_length;
85 unsigned short cu_version;
86 bfd_vma cu_abbrev_offset;
87 unsigned char cu_pointer_size;
88}
89DWARF2_Internal_CompUnit;
90
91typedef struct
92{
93 unsigned char ar_length [4];
94 unsigned char ar_version [2];
95 unsigned char ar_info_offset [4];
96 unsigned char ar_pointer_size [1];
97 unsigned char ar_segment_size [1];
98}
99DWARF2_External_ARange;
100
101typedef struct
102{
103 bfd_vma ar_length;
104 unsigned short ar_version;
105 bfd_vma ar_info_offset;
106 unsigned char ar_pointer_size;
107 unsigned char ar_segment_size;
108}
109DWARF2_Internal_ARange;
110
19e6b90e
L
111struct dwarf_section
112{
1b315056 113 /* A debug section has a different name when it's stored compressed
c34f4fc6
NC
114 or not. COMPRESSED_NAME and UNCOMPRESSED_NAME are the two
115 possibilities. NAME is set to whichever one is used for this
116 input file, as determined by load_debug_section(). */
1b315056
CS
117 const char *uncompressed_name;
118 const char *compressed_name;
4cb93e3b 119 const char *name;
19e6b90e
L
120 unsigned char *start;
121 dwarf_vma address;
122 dwarf_size_type size;
123};
124
125/* A structure containing the name of a debug section
126 and a pointer to a function that can decode it. */
127struct dwarf_section_display
128{
129 struct dwarf_section section;
130 int (*display) (struct dwarf_section *, void *);
4cb93e3b 131 int *enabled;
19e6b90e 132 unsigned int relocate : 1;
19e6b90e
L
133};
134
c34f4fc6
NC
135enum dwarf_section_display_enum
136{
19e6b90e
L
137 abbrev = 0,
138 aranges,
139 frame,
140 info,
141 line,
142 pubnames,
143 eh_frame,
144 macinfo,
145 str,
146 loc,
147 pubtypes,
148 ranges,
149 static_func,
150 static_vars,
151 types,
152 weaknames,
6f875884
TG
153 trace_info,
154 trace_abbrev,
155 trace_aranges,
19e6b90e
L
156 max
157};
158
159extern struct dwarf_section_display debug_displays [];
160
161/* This structure records the information that
162 we extract from the.debug_info section. */
163typedef struct
164{
165 unsigned int pointer_size;
b7807392
JJ
166 unsigned int offset_size;
167 int dwarf_version;
47704ddf
KT
168 bfd_vma cu_offset;
169 bfd_vma base_address;
19e6b90e 170 /* This is an array of offsets to the location list table. */
47704ddf 171 bfd_vma *loc_offsets;
19e6b90e
L
172 int *have_frame_base;
173 unsigned int num_loc_offsets;
174 unsigned int max_loc_offsets;
01a8f077 175 /* List of .debug_ranges offsets seen in this .debug_info. */
47704ddf 176 bfd_vma *range_lists;
19e6b90e
L
177 unsigned int num_range_lists;
178 unsigned int max_range_lists;
179}
180debug_info;
181
2dc4cec1 182extern int eh_addr_size;
19e6b90e
L
183
184extern int do_debug_info;
185extern int do_debug_abbrevs;
186extern int do_debug_lines;
187extern int do_debug_pubnames;
f9f0e732 188extern int do_debug_pubtypes;
19e6b90e
L
189extern int do_debug_aranges;
190extern int do_debug_ranges;
191extern int do_debug_frames;
192extern int do_debug_frames_interp;
193extern int do_debug_macinfo;
194extern int do_debug_str;
195extern int do_debug_loc;
5bbdf3d5 196extern int do_gdb_index;
6f875884
TG
197extern int do_trace_info;
198extern int do_trace_abbrevs;
199extern int do_trace_aranges;
c34f4fc6 200extern int do_wide;
19e6b90e 201
2dc4cec1 202extern void init_dwarf_regnames (unsigned int);
b129eb0e
RH
203extern void init_dwarf_regnames_i386 (void);
204extern void init_dwarf_regnames_x86_64 (void);
2dc4cec1 205
19e6b90e
L
206extern int load_debug_section (enum dwarf_section_display_enum,
207 void *);
208extern void free_debug_section (enum dwarf_section_display_enum);
209
210extern void free_debug_memory (void);
211
c34f4fc6
NC
212extern void dwarf_select_sections_by_names (const char *);
213extern void dwarf_select_sections_by_letters (const char *);
4cb93e3b
TG
214extern void dwarf_select_sections_all (void);
215
19e6b90e
L
216void *cmalloc (size_t, size_t);
217void *xcmalloc (size_t, size_t);
218void *xcrealloc (void *, size_t, size_t);
219
47704ddf
KT
220bfd_vma read_leb128 (unsigned char *data,
221 unsigned int *length_return, int sign);
This page took 0.304083 seconds and 4 git commands to generate.