Commit | Line | Data |
---|---|---|
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 |
22 | typedef unsigned HOST_WIDEST_INT dwarf_vma; |
23 | typedef unsigned HOST_WIDEST_INT dwarf_size_type; | |
19e6b90e L |
24 | |
25 | struct dwarf_section | |
26 | { | |
1b315056 | 27 | /* A debug section has a different name when it's stored compressed |
c34f4fc6 NC |
28 | or not. COMPRESSED_NAME and UNCOMPRESSED_NAME are the two |
29 | possibilities. NAME is set to whichever one is used for this | |
30 | input file, as determined by load_debug_section(). */ | |
1b315056 CS |
31 | const char *uncompressed_name; |
32 | const char *compressed_name; | |
4cb93e3b | 33 | const char *name; |
19e6b90e L |
34 | unsigned char *start; |
35 | dwarf_vma address; | |
36 | dwarf_size_type size; | |
37 | }; | |
38 | ||
39 | /* A structure containing the name of a debug section | |
40 | and a pointer to a function that can decode it. */ | |
41 | struct dwarf_section_display | |
42 | { | |
43 | struct dwarf_section section; | |
44 | int (*display) (struct dwarf_section *, void *); | |
4cb93e3b | 45 | int *enabled; |
19e6b90e | 46 | unsigned int relocate : 1; |
19e6b90e L |
47 | }; |
48 | ||
c34f4fc6 NC |
49 | enum dwarf_section_display_enum |
50 | { | |
19e6b90e L |
51 | abbrev = 0, |
52 | aranges, | |
53 | frame, | |
54 | info, | |
55 | line, | |
56 | pubnames, | |
57 | eh_frame, | |
58 | macinfo, | |
59 | str, | |
60 | loc, | |
61 | pubtypes, | |
62 | ranges, | |
63 | static_func, | |
64 | static_vars, | |
65 | types, | |
66 | weaknames, | |
6f875884 TG |
67 | trace_info, |
68 | trace_abbrev, | |
69 | trace_aranges, | |
19e6b90e L |
70 | max |
71 | }; | |
72 | ||
73 | extern struct dwarf_section_display debug_displays []; | |
74 | ||
75 | /* This structure records the information that | |
76 | we extract from the.debug_info section. */ | |
77 | typedef struct | |
78 | { | |
79 | unsigned int pointer_size; | |
b7807392 JJ |
80 | unsigned int offset_size; |
81 | int dwarf_version; | |
19e6b90e L |
82 | unsigned long cu_offset; |
83 | unsigned long base_address; | |
84 | /* This is an array of offsets to the location list table. */ | |
85 | unsigned long *loc_offsets; | |
86 | int *have_frame_base; | |
87 | unsigned int num_loc_offsets; | |
88 | unsigned int max_loc_offsets; | |
01a8f077 | 89 | /* List of .debug_ranges offsets seen in this .debug_info. */ |
19e6b90e L |
90 | unsigned long *range_lists; |
91 | unsigned int num_range_lists; | |
92 | unsigned int max_range_lists; | |
93 | } | |
94 | debug_info; | |
95 | ||
2dc4cec1 | 96 | extern int eh_addr_size; |
19e6b90e L |
97 | |
98 | extern int do_debug_info; | |
99 | extern int do_debug_abbrevs; | |
100 | extern int do_debug_lines; | |
101 | extern int do_debug_pubnames; | |
f9f0e732 | 102 | extern int do_debug_pubtypes; |
19e6b90e L |
103 | extern int do_debug_aranges; |
104 | extern int do_debug_ranges; | |
105 | extern int do_debug_frames; | |
106 | extern int do_debug_frames_interp; | |
107 | extern int do_debug_macinfo; | |
108 | extern int do_debug_str; | |
109 | extern int do_debug_loc; | |
5bbdf3d5 | 110 | extern int do_gdb_index; |
6f875884 TG |
111 | extern int do_trace_info; |
112 | extern int do_trace_abbrevs; | |
113 | extern int do_trace_aranges; | |
c34f4fc6 | 114 | extern int do_wide; |
19e6b90e | 115 | |
2dc4cec1 | 116 | extern void init_dwarf_regnames (unsigned int); |
b129eb0e RH |
117 | extern void init_dwarf_regnames_i386 (void); |
118 | extern void init_dwarf_regnames_x86_64 (void); | |
2dc4cec1 | 119 | |
19e6b90e L |
120 | extern int load_debug_section (enum dwarf_section_display_enum, |
121 | void *); | |
122 | extern void free_debug_section (enum dwarf_section_display_enum); | |
123 | ||
124 | extern void free_debug_memory (void); | |
125 | ||
c34f4fc6 NC |
126 | extern void dwarf_select_sections_by_names (const char *); |
127 | extern void dwarf_select_sections_by_letters (const char *); | |
4cb93e3b TG |
128 | extern void dwarf_select_sections_all (void); |
129 | ||
19e6b90e L |
130 | void *cmalloc (size_t, size_t); |
131 | void *xcmalloc (size_t, size_t); | |
132 | void *xcrealloc (void *, size_t, size_t); | |
133 | ||
0b6ae522 DJ |
134 | unsigned long int read_leb128 (unsigned char *data, |
135 | unsigned int *length_return, int sign); |