gdb/guile: Do not error when trying to create empty array.
[deliverable/binutils-gdb.git] / binutils / coffgrok.h
CommitLineData
f462a9ea 1/* coffgrok.h
b90efa5b 2 Copyright (C) 2001-2015 Free Software Foundation, Inc.
8c2bc687 3
32866df7 4 This file is part of GNU Binutils.
8c2bc687 5
32866df7
NC
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
8c2bc687 10
32866df7
NC
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
8c2bc687 15
32866df7
NC
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
8c2bc687 20
252b5132
RH
21#define T_NULL 0
22#define T_VOID 1 /* function argument (only used by compiler) */
23#define T_CHAR 2 /* character */
24#define T_SHORT 3 /* short integer */
25#define T_INT 4 /* integer */
26#define T_LONG 5 /* long integer */
27#define T_FLOAT 6 /* floating point */
28#define T_DOUBLE 7 /* double word */
29#define T_STRUCT 8 /* structure */
30#define T_UNION 9 /* union */
31#define T_ENUM 10 /* enumeration */
32#define T_MOE 11 /* member of enumeration*/
33#define T_UCHAR 12 /* unsigned character */
34#define T_USHORT 13 /* unsigned short */
35#define T_UINT 14 /* unsigned integer */
36#define T_ULONG 15 /* unsigned long */
37#define T_LNGDBL 16 /* long double */
38
39
32866df7
NC
40struct coff_reloc
41{
42 int offset;
43 struct coff_symbol *symbol;
44 int addend;
45};
46
47struct coff_section
48{
49 char *name;
50 int code;
51 int data;
52 int address;
53 int number; /* 0..n, .text = 0 */
54 int nrelocs;
55 int size;
56 struct coff_reloc *relocs;
57 struct bfd_section *bfd_section;
58};
252b5132
RH
59
60struct coff_ofile
61{
62 int nsources;
63 struct coff_sfile *source_head;
64 struct coff_sfile *source_tail;
65 int nsections;
66 struct coff_section *sections;
67 struct coff_symbol *symbol_list_head;
68 struct coff_symbol *symbol_list_tail;
69};
70
71struct coff_isection {
72 int low;
73 int high;
74 int init;
75 struct coff_section *parent;
76};
77
78struct coff_sfile
79{
80 char *name;
81 struct coff_scope *scope;
82 struct coff_sfile *next;
83
84 /* Vector which maps where in each output section
85 the input file has it's data */
f462a9ea 86 struct coff_isection *section;
252b5132
RH
87
88};
89
90
91 struct coff_type
92{
93 int size;
94 enum
95 {
96 coff_pointer_type, coff_function_type, coff_array_type, coff_structdef_type, coff_basic_type,
97 coff_structref_type, coff_enumref_type, coff_enumdef_type, coff_secdef_type
98 } type;
99 union
100 {
f462a9ea 101 struct
252b5132
RH
102 {
103 int address;
104 int size;
105 } asecdef;
106
107 struct
108 {
109 int isstruct;
110 struct coff_scope *elements;
111 int idx;
112 }
113 astructdef;
114 struct
115 {
116 struct coff_symbol *ref;
117 } astructref;
118
119 struct
120 {
121 struct coff_scope *elements;
122 int idx;
123 } aenumdef;
124 struct
125 {
126 struct coff_symbol *ref;
127 } aenumref;
128
129 struct
130 {
131 struct coff_type *points_to;
132 } pointer;
133 struct
134 {
135 int dim;
136 struct coff_type *array_of;
137 } array;
138
139 struct
140 {
141 struct coff_type *function_returns;
142 struct coff_scope *parameters;
143 struct coff_scope *code;
144 struct coff_line *lines;
145 } function;
146 int basic; /* One of T_VOID.. T_UINT */
147 } u;
148};
149
150
f462a9ea 151 struct coff_line
252b5132
RH
152 {
153 int nlines;
154 int *lines;
155 int *addresses;
156 };
157
158
159 struct coff_scope
160 {
161 struct coff_section *sec; /* What section */
162 int offset; /* where */
163 int size; /* How big */
164 struct coff_scope *parent; /* one up */
165
166 struct coff_scope *next; /*next along */
167
168 int nvars;
169
170 struct coff_symbol *vars_head; /* symbols */
171 struct coff_symbol *vars_tail;
172
173 struct coff_scope *list_head; /* children */
174 struct coff_scope *list_tail;
175
176 };
177
178
179 struct coff_visible
180 {
181 enum coff_vis_type
182 {
183 coff_vis_ext_def,
184 coff_vis_ext_ref,
185 coff_vis_int_def,
186 coff_vis_common,
187 coff_vis_auto,
188 coff_vis_register,
189 coff_vis_tag,
190 coff_vis_member_of_struct,
191 coff_vis_member_of_enum,
f462a9ea 192 coff_vis_autoparam,
252b5132
RH
193 coff_vis_regparam,
194 } type;
195 };
196
197 struct coff_where
198 {
199 enum
200 {
201 coff_where_stack, coff_where_memory, coff_where_register, coff_where_unknown,
202 coff_where_strtag, coff_where_member_of_struct,
203 coff_where_member_of_enum, coff_where_entag, coff_where_typedef
204
205 } where;
206 int offset;
207 int bitoffset;
208 int bitsize;
209 struct coff_section *section;
210 };
211
212 struct coff_symbol
213 {
214 char *name;
215 int tag;
216 struct coff_type *type;
217 struct coff_where *where;
218 struct coff_visible *visible;
219 struct coff_symbol *next;
220 struct coff_symbol *next_in_ofile_list; /* For the ofile list */
221 int number;
222 int er_number;
223 struct coff_sfile *sfile;
224 };
225
b51f1626 226struct coff_ofile *coff_grok (bfd *);
This page took 0.556676 seconds and 4 git commands to generate.