1 /* Copyright (C) 2001, 2004 Free Software Foundation, Inc.
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 Please email any bugs, comments, and/or additions to this file to:
18 bug-gdb@prep.ai.mit.edu */
22 * Initial set of typed variables borrowed from ptype.c
25 #if !defined (__STDC__) && !defined (_AIX)
30 signed char v_signed_char
;
31 unsigned char v_unsigned_char
;
34 signed short v_signed_short
;
35 unsigned short v_unsigned_short
;
38 signed int v_signed_int
;
39 unsigned int v_unsigned_int
;
42 signed long v_signed_long
;
43 unsigned long v_unsigned_long
;
45 long long v_long_long
;
46 signed long long v_signed_long_long
;
47 unsigned long long v_unsigned_long_long
;
53 * Now some derived types, which are arrays, functions-returning,
54 * pointers, structures, unions, and enumerations.
60 signed char v_signed_char_array
[2];
61 unsigned char v_unsigned_char_array
[2];
63 short v_short_array
[2];
64 signed short v_signed_short_array
[2];
65 unsigned short v_unsigned_short_array
[2];
68 signed int v_signed_int_array
[2];
69 unsigned int v_unsigned_int_array
[2];
72 signed long v_signed_long_array
[2];
73 unsigned long v_unsigned_long_array
[2];
75 float v_float_array
[2];
76 double v_double_array
[2];
79 typedef char t_char_array
[];
81 /**** pointers *******/
84 signed char *v_signed_char_pointer
;
85 unsigned char *v_unsigned_char_pointer
;
87 short *v_short_pointer
;
88 signed short *v_signed_short_pointer
;
89 unsigned short *v_unsigned_short_pointer
;
92 signed int *v_signed_int_pointer
;
93 unsigned int *v_unsigned_int_pointer
;
96 signed long *v_signed_long_pointer
;
97 unsigned long *v_unsigned_long_pointer
;
99 float *v_float_pointer
;
100 double *v_double_pointer
;
102 char **v_char_pointer_pointer
;
103 signed char **v_signed_char_pointer_pointer
;
104 unsigned char **v_unsigned_char_pointer_pointer
;
106 short **v_short_pointer_pointer
;
107 signed short **v_signed_short_pointer_pointer
;
108 unsigned short **v_unsigned_short_pointer_pointer
;
110 int **v_int_pointer_pointer
;
111 signed int **v_signed_int_pointer_pointer
;
112 unsigned int **v_unsigned_int_pointer_pointer
;
114 long **v_long_pointer_pointer
;
115 signed long **v_signed_long_pointer_pointer
;
116 unsigned long **v_unsigned_long_pointer_pointer
;
118 float **v_float_pointer_pointer
;
119 double **v_double_pointer_pointer
;
121 /**** pointers to arrays, arrays of pointers *******/
123 char *v_char_array_pointer
[2];
124 signed char *v_signed_char_array_pointer
[2];
125 unsigned char *v_unsigned_char_array_pointer
[2];
127 short *v_short_array_pointer
[2];
128 signed short *v_signed_short_array_pointer
[2];
129 unsigned short *v_unsigned_short_array_pointer
[2];
131 int *v_int_array_pointer
[2];
132 signed int *v_signed_int_array_pointer
[2];
133 unsigned int *v_unsigned_int_array_pointer
[2];
135 long *v_long_array_pointer
[2];
136 signed long *v_signed_long_array_pointer
[2];
137 unsigned long *v_unsigned_long_array_pointer
[2];
139 float *v_float_array_pointer
[2];
140 double *v_double_array_pointer
[2];
142 char (*v_char_pointer_array
)[2];
143 signed char (*v_signed_char_pointer_array
)[2];
144 unsigned char (*v_unsigned_char_pointer_array
)[2];
146 short (*v_short_pointer_array
)[2];
147 signed short (*v_signed_short_pointer_array
)[2];
148 unsigned short (*v_unsigned_short_pointer_array
)[2];
150 int (*v_int_pointer_array
)[2];
151 signed int (*v_signed_int_pointer_array
)[2];
152 unsigned int (*v_unsigned_int_pointer_array
)[2];
154 long (*v_long_pointer_array
)[2];
155 signed long (*v_signed_long_pointer_array
)[2];
156 unsigned long (*v_unsigned_long_pointer_array
)[2];
158 float (*v_float_pointer_array
)[2];
159 double (*v_double_pointer_array
)[2];
162 /**** structs *******/
166 short v_short_member
;
169 float v_float_member
;
170 double v_double_member
;
173 struct t_struct
*v_t_struct_p
;
177 short v_short_member
;
180 float v_float_member
;
181 double v_double_member
;
184 /* typedef'd struct without a tag. */
186 double v_double_member
;
189 /* GCC seems to want a variable of this type, or else it won't put out
193 /**** unions *******/
197 short v_short_member
;
200 float v_float_member
;
201 double v_double_member
;
206 short v_short_member
;
209 float v_float_member
;
210 double v_double_member
;
213 /* typedef'd union without a tag. */
215 double v_double_member
;
218 /* GCC seems to want a variable of this type, or else it won't put out
222 /**** Enumerations *******/
225 /* Work around the bug for compilers which don't put out the right stabs. */
226 #if __GNUC__ < 2 && !defined (_AIX)
229 {red1
, green1
, blue1
} primary1
;
231 enum {red
, green
, blue
} primary
;
232 enum colors
{yellow
, purple
, pink
} nonprimary
;
234 enum {chevy
, ford
} clunker
;
235 enum cars
{bmw
, porsche
} sportscar
;
239 typedef enum {FALSE
, TRUE
} boolean
;
241 /*note: aCC has bool type predefined with 'false' and 'true'*/
242 typedef enum bvals
{my_false
, my_true
} boolean2
;
245 enum misordered
{two
= 2, one
= 1, zero
= 0, three
= 3};
247 /* Seems like we need a variable of this type to get the type to be put
248 in the executable, at least for AIX xlc. */
249 enum misordered v_misordered
= three
;
251 /**** Function pointers *******/
253 char (*v_char_func
) (int, int*);
254 signed char (*v_signed_char_func
) (int, int*);
255 unsigned char (*v_unsigned_char_func
) (int, int*);
257 short (*v_short_func
) (int, int*);
258 signed short (*v_signed_short_func
) (int, int*);
259 unsigned short (*v_unsigned_short_func
) (int, int*);
261 int (*v_int_func
) (int, int*);
262 signed int (*v_signed_int_func
) (int, int*);
263 unsigned int (*v_unsigned_int_func
) (int, int*);
265 long (*v_long_func
) (int, int*);
266 signed long (*v_signed_long_func
) (int, int*);
267 unsigned long (*v_unsigned_long_func
) (int, int*);
269 long long (*v_long_long_func
) (int, int*);
270 signed long long (*v_signed_long_long_func
) (int, int*);
271 unsigned long long (*v_unsigned_long_long_func
) (int, int*);
273 float (*v_float_func
) (int, int*);
274 double (*v_double_func
) (int, int*);
283 use (&v_signed_char
);
284 use (&v_unsigned_char
);
287 use (&v_signed_short
);
288 use (&v_unsigned_short
);
292 use (&v_unsigned_int
);
295 use (&v_signed_long
);
296 use (&v_unsigned_long
);
299 use (&v_signed_long_long
);
300 use (&v_unsigned_long_long
);
306 use (v_signed_char_array
);
307 use (v_unsigned_char_array
);
310 use (v_signed_short_array
);
311 use (v_unsigned_short_array
);
314 use (v_signed_int_array
);
315 use (v_unsigned_int_array
);
318 use (v_signed_long_array
);
319 use (v_unsigned_long_array
);
322 use (v_double_array
);
324 use (v_char_pointer
);
325 use (v_signed_char_pointer
);
326 use (v_unsigned_char_pointer
);
328 use (v_short_pointer
);
329 use (v_signed_short_pointer
);
330 use (v_unsigned_short_pointer
);
333 use (v_signed_int_pointer
);
334 use (v_unsigned_int_pointer
);
336 use (v_long_pointer
);
337 use (v_signed_long_pointer
);
338 use (v_unsigned_long_pointer
);
340 use (v_float_pointer
);
341 use (v_double_pointer
);
343 use (v_char_pointer_pointer
);
344 use (v_signed_char_pointer_pointer
);
345 use (v_unsigned_char_pointer_pointer
);
347 use (v_short_pointer_pointer
);
348 use (v_signed_short_pointer_pointer
);
349 use (v_unsigned_short_pointer_pointer
);
351 use (v_int_pointer_pointer
);
352 use (v_signed_int_pointer_pointer
);
353 use (v_unsigned_int_pointer_pointer
);
355 use (v_long_pointer_pointer
);
356 use (v_signed_long_pointer_pointer
);
357 use (v_unsigned_long_pointer_pointer
);
359 use (v_float_pointer_pointer
);
360 use (v_double_pointer_pointer
);
362 use (v_char_array_pointer
);
363 use (v_signed_char_array_pointer
);
364 use (v_unsigned_char_array_pointer
);
366 use (v_short_array_pointer
);
367 use (v_signed_short_array_pointer
);
368 use (v_unsigned_short_array_pointer
);
370 use (v_int_array_pointer
);
371 use (v_signed_int_array_pointer
);
372 use (v_unsigned_int_array_pointer
);
374 use (v_long_array_pointer
);
375 use (v_signed_long_array_pointer
);
376 use (v_unsigned_long_array_pointer
);
378 use (v_float_array_pointer
);
379 use (v_double_array_pointer
);
381 use (v_char_pointer_array
);
382 use (v_signed_char_pointer_array
);
383 use (v_unsigned_char_pointer_array
);
385 use (v_short_pointer_array
);
386 use (v_signed_short_pointer_array
);
387 use (v_unsigned_short_pointer_array
);
389 use (v_int_pointer_array
);
390 use (v_signed_int_pointer_array
);
391 use (v_unsigned_int_pointer_array
);
393 use (v_long_pointer_array
);
394 use (v_signed_long_pointer_array
);
395 use (v_unsigned_long_pointer_array
);
397 use (v_float_pointer_array
);
398 use (v_double_pointer_array
);
413 use (&v_signed_char_func
);
414 use (&v_unsigned_char_func
);
417 use (&v_signed_short_func
);
418 use (&v_unsigned_short_func
);
421 use (&v_signed_int_func
);
422 use (&v_unsigned_int_func
);
425 use (&v_signed_long_func
);
426 use (&v_unsigned_long_func
);
428 use (&v_long_long_func
);
429 use (&v_signed_long_long_func
);
430 use (&v_unsigned_long_long_func
);
433 use (&v_double_func
);