*** empty log message ***
[deliverable/binutils-gdb.git] / binutils / dwarf.h
CommitLineData
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
22typedef unsigned HOST_WIDEST_INT dwarf_vma;
23typedef unsigned HOST_WIDEST_INT dwarf_size_type;
19e6b90e
L
24
25struct 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. */
41struct 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
49enum 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
73extern struct dwarf_section_display debug_displays [];
74
75/* This structure records the information that
76 we extract from the.debug_info section. */
77typedef 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}
94debug_info;
95
2dc4cec1 96extern int eh_addr_size;
19e6b90e
L
97
98extern int do_debug_info;
99extern int do_debug_abbrevs;
100extern int do_debug_lines;
101extern int do_debug_pubnames;
f9f0e732 102extern int do_debug_pubtypes;
19e6b90e
L
103extern int do_debug_aranges;
104extern int do_debug_ranges;
105extern int do_debug_frames;
106extern int do_debug_frames_interp;
107extern int do_debug_macinfo;
108extern int do_debug_str;
109extern int do_debug_loc;
6f875884
TG
110extern int do_trace_info;
111extern int do_trace_abbrevs;
112extern int do_trace_aranges;
c34f4fc6 113extern int do_wide;
19e6b90e 114
2dc4cec1 115extern void init_dwarf_regnames (unsigned int);
b129eb0e
RH
116extern void init_dwarf_regnames_i386 (void);
117extern void init_dwarf_regnames_x86_64 (void);
2dc4cec1 118
19e6b90e
L
119extern int load_debug_section (enum dwarf_section_display_enum,
120 void *);
121extern void free_debug_section (enum dwarf_section_display_enum);
122
123extern void free_debug_memory (void);
124
c34f4fc6
NC
125extern void dwarf_select_sections_by_names (const char *);
126extern void dwarf_select_sections_by_letters (const char *);
4cb93e3b
TG
127extern void dwarf_select_sections_all (void);
128
19e6b90e
L
129void *cmalloc (size_t, size_t);
130void *xcmalloc (size_t, size_t);
131void *xcrealloc (void *, size_t, size_t);
132
0b6ae522
DJ
133unsigned long int read_leb128 (unsigned char *data,
134 unsigned int *length_return, int sign);
This page took 0.237003 seconds and 4 git commands to generate.