Commit | Line | Data |
---|---|---|
1b315056 | 1 | /* dwarf.h - DWARF support header file |
a262ae96 | 2 | Copyright 2005, 2007, 2008 |
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 | |
19e6b90e L |
22 | #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) |
23 | /* We can't use any bfd types here since readelf may define BFD64 and | |
24 | objdump may not. */ | |
25 | typedef unsigned long long dwarf_vma; | |
26 | typedef unsigned long long dwarf_size_type; | |
27 | #else | |
28 | typedef unsigned long dwarf_vma; | |
29 | typedef unsigned long dwarf_size_type; | |
30 | #endif | |
31 | ||
32 | struct dwarf_section | |
33 | { | |
1b315056 CS |
34 | /* A debug section has a different name when it's stored compressed |
35 | * or not. COMPRESSED_NAME and UNCOMPRESSED_NAME are the two | |
36 | * possibilities. NAME is set to whichever one is used for this | |
37 | * input file, as determined by load_debug_section(). */ | |
38 | const char *uncompressed_name; | |
39 | const char *compressed_name; | |
4cb93e3b | 40 | const char *name; |
19e6b90e L |
41 | unsigned char *start; |
42 | dwarf_vma address; | |
43 | dwarf_size_type size; | |
44 | }; | |
45 | ||
46 | /* A structure containing the name of a debug section | |
47 | and a pointer to a function that can decode it. */ | |
48 | struct dwarf_section_display | |
49 | { | |
50 | struct dwarf_section section; | |
51 | int (*display) (struct dwarf_section *, void *); | |
4cb93e3b | 52 | int *enabled; |
19e6b90e | 53 | unsigned int relocate : 1; |
19e6b90e L |
54 | }; |
55 | ||
56 | enum dwarf_section_display_enum { | |
57 | abbrev = 0, | |
58 | aranges, | |
59 | frame, | |
60 | info, | |
61 | line, | |
62 | pubnames, | |
63 | eh_frame, | |
64 | macinfo, | |
65 | str, | |
66 | loc, | |
67 | pubtypes, | |
68 | ranges, | |
69 | static_func, | |
70 | static_vars, | |
71 | types, | |
72 | weaknames, | |
73 | max | |
74 | }; | |
75 | ||
76 | extern struct dwarf_section_display debug_displays []; | |
77 | ||
78 | /* This structure records the information that | |
79 | we extract from the.debug_info section. */ | |
80 | typedef struct | |
81 | { | |
82 | unsigned int pointer_size; | |
83 | unsigned long cu_offset; | |
84 | unsigned long base_address; | |
85 | /* This is an array of offsets to the location list table. */ | |
86 | unsigned long *loc_offsets; | |
87 | int *have_frame_base; | |
88 | unsigned int num_loc_offsets; | |
89 | unsigned int max_loc_offsets; | |
90 | unsigned long *range_lists; | |
91 | unsigned int num_range_lists; | |
92 | unsigned int max_range_lists; | |
93 | } | |
94 | debug_info; | |
95 | ||
96 | extern dwarf_vma (*byte_get) (unsigned char *, int); | |
97 | extern dwarf_vma byte_get_little_endian (unsigned char *, int); | |
98 | extern dwarf_vma byte_get_big_endian (unsigned char *, int); | |
99 | ||
2dc4cec1 | 100 | extern int eh_addr_size; |
19e6b90e L |
101 | |
102 | extern int do_debug_info; | |
103 | extern int do_debug_abbrevs; | |
104 | extern int do_debug_lines; | |
105 | extern int do_debug_pubnames; | |
106 | extern int do_debug_aranges; | |
107 | extern int do_debug_ranges; | |
108 | extern int do_debug_frames; | |
109 | extern int do_debug_frames_interp; | |
110 | extern int do_debug_macinfo; | |
111 | extern int do_debug_str; | |
112 | extern int do_debug_loc; | |
113 | ||
2dc4cec1 L |
114 | extern void init_dwarf_regnames (unsigned int); |
115 | ||
19e6b90e L |
116 | extern int load_debug_section (enum dwarf_section_display_enum, |
117 | void *); | |
118 | extern void free_debug_section (enum dwarf_section_display_enum); | |
119 | ||
120 | extern void free_debug_memory (void); | |
121 | ||
4cb93e3b TG |
122 | extern void dwarf_select_sections_by_names (const char *names); |
123 | extern void dwarf_select_sections_by_letters (const char *letters); | |
124 | extern void dwarf_select_sections_all (void); | |
125 | ||
19e6b90e L |
126 | void *cmalloc (size_t, size_t); |
127 | void *xcmalloc (size_t, size_t); | |
128 | void *xcrealloc (void *, size_t, size_t); | |
129 | ||
130 | void error (const char *, ...) ATTRIBUTE_PRINTF_1; | |
131 | void warn (const char *, ...) ATTRIBUTE_PRINTF_1; |