2009-02-09 Tristan Gingold <gingold@adacore.com>
[deliverable/binutils-gdb.git] / binutils / dwarf.h
1 /* dwarf.h - DWARF support header file
2 Copyright 2005, 2007, 2008
3 Free Software Foundation, Inc.
4
5 This file is part of GNU Binutils.
6
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.
11
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.
16
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. */
21
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 {
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;
40 const char *name;
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 *);
52 int *enabled;
53 unsigned int relocate : 1;
54 unsigned int eh_frame : 1;
55 };
56
57 enum dwarf_section_display_enum {
58 abbrev = 0,
59 aranges,
60 frame,
61 info,
62 line,
63 pubnames,
64 eh_frame,
65 macinfo,
66 str,
67 loc,
68 pubtypes,
69 ranges,
70 static_func,
71 static_vars,
72 types,
73 weaknames,
74 max
75 };
76
77 extern struct dwarf_section_display debug_displays [];
78
79 /* This structure records the information that
80 we extract from the.debug_info section. */
81 typedef struct
82 {
83 unsigned int pointer_size;
84 unsigned long cu_offset;
85 unsigned long base_address;
86 /* This is an array of offsets to the location list table. */
87 unsigned long *loc_offsets;
88 int *have_frame_base;
89 unsigned int num_loc_offsets;
90 unsigned int max_loc_offsets;
91 unsigned long *range_lists;
92 unsigned int num_range_lists;
93 unsigned int max_range_lists;
94 }
95 debug_info;
96
97 extern dwarf_vma (*byte_get) (unsigned char *, int);
98 extern dwarf_vma byte_get_little_endian (unsigned char *, int);
99 extern dwarf_vma byte_get_big_endian (unsigned char *, int);
100
101 extern int eh_addr_size;
102
103 extern int do_debug_info;
104 extern int do_debug_abbrevs;
105 extern int do_debug_lines;
106 extern int do_debug_pubnames;
107 extern int do_debug_aranges;
108 extern int do_debug_ranges;
109 extern int do_debug_frames;
110 extern int do_debug_frames_interp;
111 extern int do_debug_macinfo;
112 extern int do_debug_str;
113 extern int do_debug_loc;
114
115 extern void init_dwarf_regnames (unsigned int);
116
117 extern int load_debug_section (enum dwarf_section_display_enum,
118 void *);
119 extern void free_debug_section (enum dwarf_section_display_enum);
120
121 extern void free_debug_memory (void);
122
123 extern void dwarf_select_sections_by_names (const char *names);
124 extern void dwarf_select_sections_by_letters (const char *letters);
125 extern void dwarf_select_sections_all (void);
126
127 void *cmalloc (size_t, size_t);
128 void *xcmalloc (size_t, size_t);
129 void *xcrealloc (void *, size_t, size_t);
130
131 void error (const char *, ...) ATTRIBUTE_PRINTF_1;
132 void warn (const char *, ...) ATTRIBUTE_PRINTF_1;
This page took 0.064138 seconds and 5 git commands to generate.