1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22: #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
23:
24:
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: const char *name;
35: unsigned char *start;
36: dwarf_vma address;
37: dwarf_size_type size;
38: };
39:
40:
41:
42: struct dwarf_section_display
43: {
44: struct dwarf_section section;
45: int (*display) (struct dwarf_section *, void *);
46: unsigned int relocate : 1;
47: unsigned int eh_frame : 1;
48: };
49:
50: enum dwarf_section_display_enum {
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,
67: max
68: };
69:
70: extern struct dwarf_section_display debug_displays [];
71:
72:
73:
74: typedef struct
75: {
76: unsigned int pointer_size;
77: unsigned long cu_offset;
78: unsigned long base_address;
79:
80: unsigned long *loc_offsets;
81: int *have_frame_base;
82: unsigned int num_loc_offsets;
83: unsigned int max_loc_offsets;
84: unsigned long *range_lists;
85: unsigned int num_range_lists;
86: unsigned int max_range_lists;
87: }
88: debug_info;
89:
90: extern dwarf_vma (*byte_get) (unsigned char *, int);
91: extern dwarf_vma byte_get_little_endian (unsigned char *, int);
92: extern dwarf_vma byte_get_big_endian (unsigned char *, int);
93:
94: extern dwarf_vma eh_addr_size;
95: extern int is_relocatable;
96:
97: extern int do_debug_info;
98: extern int do_debug_abbrevs;
99: extern int do_debug_lines;
100: extern int do_debug_pubnames;
101: extern int do_debug_aranges;
102: extern int do_debug_ranges;
103: extern int do_debug_frames;
104: extern int do_debug_frames_interp;
105: extern int do_debug_macinfo;
106: extern int do_debug_str;
107: extern int do_debug_loc;
108:
109: extern int load_debug_section (enum dwarf_section_display_enum,
110: void *);
111: extern void free_debug_section (enum dwarf_section_display_enum);
112:
113: extern void free_debug_memory (void);
114:
115: void *cmalloc (size_t, size_t);
116: void *xcmalloc (size_t, size_t);
117: void *xcrealloc (void *, size_t, size_t);
118:
119: void error (const char *, ...) ATTRIBUTE_PRINTF_1;
120: void warn (const char *, ...) ATTRIBUTE_PRINTF_1;