daily update
[deliverable/binutils-gdb.git] / binutils / dwarf.h
CommitLineData
1b315056 1/* dwarf.h - DWARF support header file
aa820537 2 Copyright 2005, 2007, 2008, 2009
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. */
25typedef unsigned long long dwarf_vma;
26typedef unsigned long long dwarf_size_type;
27#else
28typedef unsigned long dwarf_vma;
29typedef unsigned long dwarf_size_type;
30#endif
31
32struct dwarf_section
33{
1b315056 34 /* A debug section has a different name when it's stored compressed
c34f4fc6
NC
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(). */
1b315056
CS
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. */
48struct 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
c34f4fc6
NC
56enum dwarf_section_display_enum
57{
19e6b90e
L
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,
6f875884
TG
74 trace_info,
75 trace_abbrev,
76 trace_aranges,
19e6b90e
L
77 max
78};
79
80extern struct dwarf_section_display debug_displays [];
81
82/* This structure records the information that
83 we extract from the.debug_info section. */
84typedef struct
85{
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;
91 int *have_frame_base;
92 unsigned int num_loc_offsets;
93 unsigned int max_loc_offsets;
01a8f077 94 /* List of .debug_ranges offsets seen in this .debug_info. */
19e6b90e
L
95 unsigned long *range_lists;
96 unsigned int num_range_lists;
97 unsigned int max_range_lists;
98}
99debug_info;
100
101extern dwarf_vma (*byte_get) (unsigned char *, int);
102extern dwarf_vma byte_get_little_endian (unsigned char *, int);
103extern dwarf_vma byte_get_big_endian (unsigned char *, int);
104
2dc4cec1 105extern int eh_addr_size;
19e6b90e
L
106
107extern int do_debug_info;
108extern int do_debug_abbrevs;
109extern int do_debug_lines;
110extern int do_debug_pubnames;
f9f0e732 111extern int do_debug_pubtypes;
19e6b90e
L
112extern int do_debug_aranges;
113extern int do_debug_ranges;
114extern int do_debug_frames;
115extern int do_debug_frames_interp;
116extern int do_debug_macinfo;
117extern int do_debug_str;
118extern int do_debug_loc;
6f875884
TG
119extern int do_trace_info;
120extern int do_trace_abbrevs;
121extern int do_trace_aranges;
c34f4fc6 122extern int do_wide;
19e6b90e 123
2dc4cec1
L
124extern void init_dwarf_regnames (unsigned int);
125
19e6b90e
L
126extern int load_debug_section (enum dwarf_section_display_enum,
127 void *);
128extern void free_debug_section (enum dwarf_section_display_enum);
129
130extern void free_debug_memory (void);
131
c34f4fc6
NC
132extern void dwarf_select_sections_by_names (const char *);
133extern void dwarf_select_sections_by_letters (const char *);
4cb93e3b
TG
134extern void dwarf_select_sections_all (void);
135
19e6b90e
L
136void *cmalloc (size_t, size_t);
137void *xcmalloc (size_t, size_t);
138void *xcrealloc (void *, size_t, size_t);
139
140void error (const char *, ...) ATTRIBUTE_PRINTF_1;
141void warn (const char *, ...) ATTRIBUTE_PRINTF_1;
0b6ae522
DJ
142
143unsigned long int read_leb128 (unsigned char *data,
144 unsigned int *length_return, int sign);
This page took 0.258841 seconds and 4 git commands to generate.