1 /* dwarf.h - DWARF support header file
2 Copyright 2005, 2007, 2008, 2009
3 Free Software Foundation, Inc.
5 This file is part of GNU Binutils.
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.
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.
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. */
22 #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
23 /* We can't use any bfd types here since readelf may define BFD64 and
25 typedef unsigned long long dwarf_vma;
26 typedef unsigned long long dwarf_size_type;
28 typedef unsigned long dwarf_vma;
29 typedef unsigned long dwarf_size_type;
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;
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
50 struct dwarf_section section;
51 int (*display) (struct dwarf_section *, void *);
53 unsigned int relocate : 1;
56 enum dwarf_section_display_enum
80 extern struct dwarf_section_display debug_displays [];
82 /* This structure records the information that
83 we extract from the.debug_info section. */
86 unsigned int pointer_size;
87 unsigned long cu_offset;
88 unsigned long base_address;
89 /* This is an array of offsets to the location list table. */
90 unsigned long *loc_offsets;
92 unsigned int num_loc_offsets;
93 unsigned int max_loc_offsets;
94 /* List of .debug_ranges offsets seen in this .debug_info. */
95 unsigned long *range_lists;
96 unsigned int num_range_lists;
97 unsigned int max_range_lists;
101 extern dwarf_vma (*byte_get) (unsigned char *, int);
102 extern dwarf_vma byte_get_little_endian (unsigned char *, int);
103 extern dwarf_vma byte_get_big_endian (unsigned char *, int);
105 extern int eh_addr_size;
107 extern int do_debug_info;
108 extern int do_debug_abbrevs;
109 extern int do_debug_lines;
110 extern int do_debug_pubnames;
111 extern int do_debug_pubtypes;
112 extern int do_debug_aranges;
113 extern int do_debug_ranges;
114 extern int do_debug_frames;
115 extern int do_debug_frames_interp;
116 extern int do_debug_macinfo;
117 extern int do_debug_str;
118 extern int do_debug_loc;
119 extern int do_trace_info;
120 extern int do_trace_abbrevs;
121 extern int do_trace_aranges;
124 extern void init_dwarf_regnames (unsigned int);
126 extern int load_debug_section (enum dwarf_section_display_enum,
128 extern void free_debug_section (enum dwarf_section_display_enum);
130 extern void free_debug_memory (void);
132 extern void dwarf_select_sections_by_names (const char *);
133 extern void dwarf_select_sections_by_letters (const char *);
134 extern void dwarf_select_sections_all (void);
136 void *cmalloc (size_t, size_t);
137 void *xcmalloc (size_t, size_t);
138 void *xcrealloc (void *, size_t, size_t);
140 void error (const char *, ...) ATTRIBUTE_PRINTF_1;
141 void warn (const char *, ...) ATTRIBUTE_PRINTF_1;
143 unsigned long int read_leb128 (unsigned char *data,
144 unsigned int *length_return, int sign);