-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdwarf.h
194 lines (170 loc) · 4.06 KB
/
dwarf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#ifndef _DWARF_H_
#define _DWARF_H_
struct link {
struct link *prev;
union tag *tag;
int val;
union tag *member;
};
struct taglim {
union tag *base;
int nelem;
};
struct op {
void (*visit)(char *name, union tag *tag, struct link *link, unsigned char *p, int more);
char *name;
};
extern struct op end;
struct tag_base {
struct op *op;
char *name;
int byte_size;
};
extern struct op op_array_type;
struct tag_array_type {
struct tag_base tag_base;
unsigned int sibling;
unsigned int type;
};
extern struct op op_base_type;
struct tag_base_type {
struct tag_base tag_base;
int encoding;
};
extern struct op op_compile_unit;
struct tag_compile_unit {
struct tag_base tag_base;
char *comp_dir;
unsigned int high_pc;
int language;
unsigned int low_pc;
char *producer;
unsigned int stmt_list;
};
extern struct op op_const_type;
struct tag_const_type {
struct tag_base tag_base;
unsigned int type;
};
extern struct op op_enumeration_type;
struct tag_enumeration_type {
struct tag_base tag_base;
int decl_file;
int decl_line;
unsigned int sibling;
};
extern struct op op_enumerator;
struct tag_enumerator {
struct tag_base tag_base;
int const_value;
};
extern struct op op_formal_parameter;
struct tag_formal_parameter {
struct tag_base tag_base;
int decl_file;
int decl_line;
int location; /* leave */
unsigned int type;
};
extern struct op op_lexical_block;
struct tag_lexical_block {
struct tag_base tag_base;
unsigned int high_pc;
unsigned int low_pc;
unsigned int sibling;
};
extern struct op op_member;
struct tag_member {
struct tag_base tag_base;
int bit_offset;
int bit_size;
int data_member_location; /* leave */
int decl_file;
int decl_line;
unsigned int type;
};
extern struct op op_pointer_type;
struct tag_pointer_type {
struct tag_base tag_base;
unsigned int type;
};
extern struct op op_structure_type;
struct tag_structure_type {
struct tag_base tag_base;
int decl_file;
int decl_line;
unsigned int sibling;
};
extern struct op op_subprogram;
struct tag_subprogram {
struct tag_base tag_base;
int decl_file;
int decl_line;
int external;
unsigned int frame_base;
unsigned int high_pc;
unsigned int low_pc;
int prototyped;
unsigned int sibling;
unsigned int type;
};
extern struct op op_subrange_type;
struct tag_subrange_type {
struct tag_base tag_base;
unsigned int type;
int upper_bound;
};
extern struct op op_subroutine_type;
struct tag_subroutine_type {
struct tag_base tag_base;
int prototyped;
unsigned int sibling;
unsigned int type;
};
extern struct op op_typedef;
struct tag_typedef {
struct tag_base tag_base;
int decl_file;
int decl_line;
unsigned int type;
};
extern struct op op_union_type;
struct tag_union_type {
struct tag_base tag_base;
int decl_file;
int decl_line;
unsigned int sibling;
};
extern struct op op_variable;
struct tag_variable {
struct tag_base tag_base;
int decl_file;
int decl_line;
int external;
int location; /* leave */
unsigned int type;
int artificial;
};
union tag {
struct tag_base tag_base;
struct tag_array_type tag_array_type;
struct tag_base_type tag_base_type;
struct tag_compile_unit tag_compile_unit;
struct tag_const_type tag_const_type;
struct tag_enumeration_type tag_enumeration_type;
struct tag_enumerator tag_enumerator;
struct tag_formal_parameter tag_formal_parameter;
struct tag_lexical_block tag_lexical_block;
struct tag_member tag_member;
struct tag_pointer_type tag_pointer_type;
struct tag_structure_type tag_structure_type;
struct tag_subprogram tag_subprogram;
struct tag_subrange_type tag_subrange_type;
struct tag_subroutine_type tag_subroutine_type;
struct tag_typedef tag_typedef;
struct tag_union_type tag_union_type;
struct tag_variable tag_variable;
};
union tag *find(char *name);
void dump(union tag *tag, char *name, void *p);
#endif