Hook into the (stubbed) resize code in msdos int10.
[wine/multimedia.git] / debugger / types.c
blob6c94c4d50ef371cf30e14af1a46a4c23b7432ee8
1 /*
2 * File types.c - datatype handling stuff for internal debugger.
4 * Copyright (C) 1997, Eric Youngdale.
6 * This really doesn't do much at the moment, but it forms the framework
7 * upon which full support for datatype handling will eventually be hung.
8 */
10 #include <stdio.h>
11 #include <stdlib.h>
13 #include <assert.h>
14 #include <fcntl.h>
15 #include <sys/types.h>
16 #include <sys/stat.h>
17 #include <limits.h>
18 #include <string.h>
19 #include <unistd.h>
21 #include "win.h"
22 #include "pe_image.h"
23 #include "peexe.h"
24 #include "debugger.h"
25 #include "peexe.h"
26 #include "xmalloc.h"
28 #define NR_TYPE_HASH 521
30 int DEBUG_nchar;
31 static int DEBUG_maxchar = 1024;
33 struct en_values
35 struct en_values* next;
36 char * name;
37 int value;
40 struct member
42 struct member * next;
43 char * name;
44 struct datatype * type;
45 int offset;
46 int size;
49 struct datatype
51 enum debug_type type;
52 struct datatype * next;
53 char * name;
54 union
56 struct
58 char basic_type;
59 char * output_format;
60 char basic_size;
61 unsigned b_signed:1;
62 } basic;
63 struct
65 unsigned short bitoff;
66 unsigned short nbits;
67 struct datatype * basetype;
68 } bitfield;
70 struct
72 struct datatype * pointsto;
73 } pointer;
74 struct
76 struct datatype * rettype;
77 } funct;
78 struct
80 int start;
81 int end;
82 struct datatype * basictype;
83 } array;
84 struct
86 int size;
87 struct member * members;
88 } structure;
89 struct
91 struct en_values * members;
92 } enumeration;
93 } un;
96 #define BASIC_INT 1
97 #define BASIC_CHAR 2
98 #define BASIC_LONG 3
99 #define BASIC_UINT 4
100 #define BASIC_LUI 5
101 #define BASIC_LONGLONG 6
102 #define BASIC_ULONGLONGI 7
103 #define BASIC_SHORT 8
104 #define BASIC_SHORTUI 9
105 #define BASIC_SCHAR 10
106 #define BASIC_UCHAR 11
107 #define BASIC_FLT 12
108 #define BASIC_LONG_DOUBLE 13
109 #define BASIC_DOUBLE 14
110 #define BASIC_CMPLX_INT 15
111 #define BASIC_CMPLX_FLT 16
112 #define BASIC_CMPLX_DBL 17
113 #define BASIC_CMPLX_LONG_DBL 18
114 #define BASIC_VOID 19
116 struct datatype * DEBUG_TypeInt = NULL;
117 struct datatype * DEBUG_TypeIntConst = NULL;
118 struct datatype * DEBUG_TypeUSInt = NULL;
119 struct datatype * DEBUG_TypeString = NULL;
122 * All of the types that have been defined so far.
124 static struct datatype * type_hash_table[NR_TYPE_HASH + 1];
125 static struct datatype * pointer_types = NULL;
127 static unsigned int type_hash( const char * name )
129 unsigned int hash = 0;
130 unsigned int tmp;
131 const char * p;
133 p = name;
135 while (*p)
137 hash = (hash << 4) + *p++;
139 if( (tmp = (hash & 0xf0000000)) )
141 hash ^= tmp >> 24;
143 hash &= ~tmp;
145 return hash % NR_TYPE_HASH;
149 static struct datatype *
150 DEBUG_InitBasic(int type, char * name, int size, int b_signed,
151 char * output_format)
153 int hash;
155 struct datatype * dt;
156 dt = (struct datatype *) xmalloc(sizeof(struct datatype));
158 if( dt != NULL )
160 if( name != NULL )
162 hash = type_hash(name);
164 else
166 hash = NR_TYPE_HASH;
169 dt->type = DT_BASIC;
170 dt->name = name;
171 dt->next = type_hash_table[hash];
172 type_hash_table[hash] = dt;
173 dt->un.basic.basic_type = type;
174 dt->un.basic.basic_size = size;
175 dt->un.basic.b_signed = b_signed;
176 dt->un.basic.output_format = output_format;
179 return dt;
182 static
183 struct datatype *
184 DEBUG_LookupDataType(enum debug_type xtype, int hash, const char * typename)
186 struct datatype * dt = NULL;
188 if( typename != NULL )
190 for( dt = type_hash_table[hash]; dt; dt = dt->next )
192 if( xtype != dt->type || dt->name == NULL
193 || dt->name[0] != typename[0])
195 continue;
198 if( strcmp(dt->name, typename) == 0 )
200 return dt;
205 return dt;
208 struct datatype *
209 DEBUG_NewDataType(enum debug_type xtype, const char * typename)
211 struct datatype * dt = NULL;
212 int hash;
215 * The last bucket is special, and is used to hold typeless names.
217 if( typename == NULL )
219 hash = NR_TYPE_HASH;
221 else
223 hash = type_hash(typename);
226 dt = DEBUG_LookupDataType(xtype, hash, typename);
228 if( dt == NULL )
230 dt = (struct datatype *) xmalloc(sizeof(struct datatype));
232 if( dt != NULL )
234 memset(dt, 0, sizeof(*dt));
236 dt->type = xtype;
237 if( typename != NULL )
239 dt->name = xstrdup(typename);
241 else
243 dt->name = NULL;
245 if( xtype == DT_POINTER )
247 dt->next = pointer_types;
248 pointer_types = dt;
250 else
252 dt->next = type_hash_table[hash];
253 type_hash_table[hash] = dt;
258 return dt;
261 struct datatype *
262 DEBUG_FindOrMakePointerType(struct datatype * reftype)
264 struct datatype * dt = NULL;
266 if( reftype != NULL )
268 for( dt = pointer_types; dt; dt = dt->next )
270 if( dt->type != DT_POINTER )
272 continue;
275 if( dt->un.pointer.pointsto == reftype )
277 return dt;
282 if( dt == NULL )
284 dt = (struct datatype *) xmalloc(sizeof(struct datatype));
286 if( dt != NULL )
288 dt->type = DT_POINTER;
289 dt->un.pointer.pointsto = reftype;
290 dt->next = pointer_types;
291 pointer_types = dt;
295 return dt;
298 void
299 DEBUG_InitTypes()
301 static int beenhere = 0;
302 struct datatype * chartype;
304 if( beenhere++ != 0 )
306 return;
310 * Special version of int used with constants of various kinds.
312 DEBUG_TypeIntConst = DEBUG_InitBasic(BASIC_INT,NULL,4,1,"%d");
315 * Initialize a few builtin types.
319 DEBUG_TypeInt = DEBUG_InitBasic(BASIC_INT,"int",4,1,"%d");
320 chartype = DEBUG_InitBasic(BASIC_CHAR,"char",1,1,"'%c'");
321 DEBUG_InitBasic(BASIC_LONG,"long int",4,1,"%d");
322 DEBUG_TypeUSInt = DEBUG_InitBasic(BASIC_UINT,"unsigned int",4,0,"%d");
323 DEBUG_InitBasic(BASIC_LUI,"long unsigned int",4,0,"%d");
324 DEBUG_InitBasic(BASIC_LONGLONG,"long long int",8,1,"%ld");
325 DEBUG_InitBasic(BASIC_ULONGLONGI,"long long unsigned int",8,0,"%ld");
326 DEBUG_InitBasic(BASIC_SHORT,"short int",2,1,"%d");
327 DEBUG_InitBasic(BASIC_SHORTUI,"short unsigned int",2,0,"%d");
328 DEBUG_InitBasic(BASIC_SCHAR,"signed char",1,1,"'%c'");
329 DEBUG_InitBasic(BASIC_UCHAR,"unsigned char",1,0,"'%c'");
330 DEBUG_InitBasic(BASIC_FLT,"float",4,0,"%f");
331 DEBUG_InitBasic(BASIC_LONG_DOUBLE,"double",8,0,"%lf");
332 DEBUG_InitBasic(BASIC_DOUBLE,"long double",12,0,NULL);
333 DEBUG_InitBasic(BASIC_CMPLX_INT,"complex int",8,1,NULL);
334 DEBUG_InitBasic(BASIC_CMPLX_FLT,"complex float",8,0,NULL);
335 DEBUG_InitBasic(BASIC_CMPLX_DBL,"complex double",16,0,NULL);
336 DEBUG_InitBasic(BASIC_CMPLX_LONG_DBL,"complex long double",24,0,NULL);
337 DEBUG_InitBasic(BASIC_VOID,"void",0,0,NULL);
339 DEBUG_TypeString = DEBUG_NewDataType(DT_POINTER, NULL);
340 DEBUG_SetPointerType(DEBUG_TypeString, chartype);
343 * Now initialize the builtins for codeview.
345 DEBUG_InitCVDataTypes();
349 long long int
350 DEBUG_GetExprValue(DBG_ADDR * addr, char ** format)
352 DBG_ADDR address = *addr;
353 unsigned int rtn;
354 struct datatype * type2 = NULL;
355 struct en_values * e;
356 char * def_format = "0x%x";
358 rtn = 0;
359 address.seg = 0; /* FIXME? I don't quite get this... */
360 assert(addr->type != NULL);
362 switch(addr->type->type)
364 case DT_BASIC:
365 if (!DBG_CHECK_READ_PTR( &address, addr->type->un.basic.basic_size))
367 return 0;
370 memcpy(&rtn, (char *) addr->off, addr->type->un.basic.basic_size);
371 if( (addr->type->un.basic.b_signed)
372 && ((addr->type->un.basic.basic_size & 3) != 0)
373 && ((rtn >> (addr->type->un.basic.basic_size * 8 - 1)) != 0) )
375 rtn = rtn | ((-1) << (addr->type->un.basic.basic_size * 8));
377 if( addr->type->un.basic.output_format != NULL )
379 def_format = addr->type->un.basic.output_format;
383 * Check for single character prints that are out of range.
385 if( addr->type->un.basic.basic_size == 1
386 && strcmp(def_format, "'%c'") == 0
387 && ((rtn < 0x20) || (rtn > 0x80)) )
389 def_format = "%d";
391 break;
392 case DT_POINTER:
393 if (!DBG_CHECK_READ_PTR( &address, 1 )) return 0;
394 rtn = (unsigned int) *((unsigned char **)addr->off);
395 type2 = addr->type->un.pointer.pointsto;
396 if( type2->type == DT_BASIC && type2->un.basic.basic_size == 1 )
398 def_format = "\"%s\"";
399 break;
401 else
403 def_format = "0x%8.8x";
405 break;
406 case DT_ARRAY:
407 case DT_STRUCT:
408 if (!DBG_CHECK_READ_PTR( &address, 1 )) return 0;
409 rtn = (unsigned int) *((unsigned char **)addr->off);
410 def_format = "0x%8.8x";
411 break;
412 case DT_ENUM:
413 if (!DBG_CHECK_READ_PTR( &address, 1 )) return 0;
414 rtn = (unsigned int) *((unsigned char **)addr->off);
415 for(e = addr->type->un.enumeration.members; e; e = e->next )
417 if( e->value == rtn )
419 break;
422 if( e != NULL )
424 rtn = (int) e->name;
425 def_format = "%s";
427 else
429 def_format = "%d";
431 break;
432 default:
433 rtn = 0;
434 break;
438 if( format != NULL )
440 *format = def_format;
442 return rtn;
445 unsigned int
446 DEBUG_TypeDerefPointer(DBG_ADDR * addr, struct datatype ** newtype)
448 DBG_ADDR address = *addr;
451 * Make sure that this really makes sense.
453 if( addr->type->type != DT_POINTER )
455 *newtype = NULL;
456 return 0;
459 *newtype = addr->type->un.pointer.pointsto;
460 address.off = *(unsigned int*) (addr->off);
461 return (unsigned int)DBG_ADDR_TO_LIN(&address); /* FIXME: is this right (or "better") ? */
464 unsigned int
465 DEBUG_FindStructElement(DBG_ADDR * addr, const char * ele_name, int * tmpbuf)
467 struct member * m;
468 unsigned int mask;
471 * Make sure that this really makes sense.
473 if( addr->type->type != DT_STRUCT )
475 addr->type = NULL;
476 return FALSE;
479 for(m = addr->type->un.structure.members; m; m = m->next)
481 if( strcmp(m->name, ele_name) == 0 )
483 addr->type = m->type;
484 if( (m->offset & 7) != 0 || (m->size & 7) != 0)
487 * Bitfield operation. We have to extract the field and store
488 * it in a temporary buffer so that we get it all right.
490 *tmpbuf = ((*(int* ) (addr->off + (m->offset >> 3))) >> (m->offset & 7));
491 addr->off = (int) tmpbuf;
493 mask = 0xffffffff << (m->size);
494 *tmpbuf &= ~mask;
496 * OK, now we have the correct part of the number.
497 * Check to see whether the basic type is signed or not, and if so,
498 * we need to sign extend the number.
500 if( m->type->type == DT_BASIC && m->type->un.basic.b_signed != 0
501 && (*tmpbuf & (1 << (m->size - 1))) != 0 )
503 *tmpbuf |= mask;
506 else
508 addr->off += (m->offset >> 3);
510 return TRUE;
514 addr->type = NULL;
515 return FALSE;
519 DEBUG_SetStructSize(struct datatype * dt, int size)
521 assert(dt->type == DT_STRUCT);
523 if( dt->un.structure.members != NULL )
525 return FALSE;
528 dt->un.structure.size = size;
529 dt->un.structure.members = NULL;
531 return TRUE;
535 DEBUG_CopyFieldlist(struct datatype * dt, struct datatype * dt2)
538 assert( dt->type == dt2->type && ((dt->type == DT_STRUCT) || (dt->type == DT_ENUM)));
540 if( dt->type == DT_STRUCT )
542 dt->un.structure.members = dt2->un.structure.members;
544 else
546 dt->un.enumeration.members = dt2->un.enumeration.members;
549 return TRUE;
553 DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type,
554 int offset, int size)
556 struct member * m;
557 struct member * last;
558 struct en_values * e;
560 if( dt->type == DT_STRUCT )
562 for(last = dt->un.structure.members; last; last = last->next)
564 if( (last->name[0] == name[0])
565 && (strcmp(last->name, name) == 0) )
567 return TRUE;
569 if( last->next == NULL )
571 break;
574 m = (struct member *) xmalloc(sizeof(struct member));
575 if( m == FALSE )
577 return FALSE;
580 m->name = xstrdup(name);
581 m->type = type;
582 m->offset = offset;
583 m->size = size;
584 if( last == NULL )
586 m->next = dt->un.structure.members;
587 dt->un.structure.members = m;
589 else
591 last->next = m;
592 m->next = NULL;
595 * If the base type is bitfield, then adjust the offsets here so that we
596 * are able to look things up without lots of falter-all.
598 if( type->type == DT_BITFIELD )
600 m->offset += m->type->un.bitfield.bitoff;
601 m->size = m->type->un.bitfield.nbits;
602 m->type = m->type->un.bitfield.basetype;
605 else if( dt->type == DT_ENUM )
607 e = (struct en_values *) xmalloc(sizeof(struct en_values));
608 if( e == FALSE )
610 return FALSE;
613 e->name = xstrdup(name);
614 e->value = offset;
615 e->next = dt->un.enumeration.members;
616 dt->un.enumeration.members = e;
618 else
620 assert(FALSE);
622 return TRUE;
625 struct datatype *
626 DEBUG_GetPointerType(struct datatype * dt)
628 if( dt->type == DT_POINTER )
630 return dt->un.pointer.pointsto;
633 return NULL;
637 DEBUG_SetPointerType(struct datatype * dt, struct datatype * dt2)
639 switch(dt->type)
641 case DT_POINTER:
642 dt->un.pointer.pointsto = dt2;
643 break;
644 case DT_FUNC:
645 dt->un.funct.rettype = dt2;
646 break;
647 default:
648 assert(FALSE);
651 return TRUE;
655 DEBUG_SetArrayParams(struct datatype * dt, int min, int max, struct datatype * dt2)
657 assert(dt->type == DT_ARRAY);
658 dt->un.array.start = min;
659 dt->un.array.end = max;
660 dt->un.array.basictype = dt2;
662 return TRUE;
666 DEBUG_SetBitfieldParams(struct datatype * dt, int offset, int nbits,
667 struct datatype * dt2)
669 assert(dt->type == DT_BITFIELD);
670 dt->un.bitfield.bitoff = offset;
671 dt->un.bitfield.nbits = nbits;
672 dt->un.bitfield.basetype = dt2;
674 return TRUE;
677 int DEBUG_GetObjectSize(struct datatype * dt)
679 if( dt == NULL )
681 return 0;
684 switch(dt->type)
686 case DT_BASIC:
687 return dt->un.basic.basic_size;
688 case DT_POINTER:
689 return sizeof(int *);
690 case DT_STRUCT:
691 return dt->un.structure.size;
692 case DT_ENUM:
693 return sizeof(int);
694 case DT_ARRAY:
695 return (dt->un.array.end - dt->un.array.start)
696 * DEBUG_GetObjectSize(dt->un.array.basictype);
697 case DT_BITFIELD:
699 * Bitfields have to be handled seperately later on
700 * when we insert the element into the structure.
702 return 0;
703 case DT_TYPEDEF:
704 case DT_FUNC:
705 case DT_CONST:
706 assert(FALSE);
708 return 0;
711 unsigned int
712 DEBUG_ArrayIndex(DBG_ADDR * addr, DBG_ADDR * result, int index)
714 int size;
717 * Make sure that this really makes sense.
719 if( addr->type->type == DT_POINTER )
722 * Get the base type, so we know how much to index by.
724 size = DEBUG_GetObjectSize(addr->type->un.pointer.pointsto);
725 result->type = addr->type->un.pointer.pointsto;
726 result->off = (*(unsigned int*) (addr->off)) + size * index;
728 else if (addr->type->type == DT_ARRAY)
730 size = DEBUG_GetObjectSize(addr->type->un.array.basictype);
731 result->type = addr->type->un.array.basictype;
732 result->off = addr->off + size * (index - addr->type->un.array.start);
735 return TRUE;
738 /***********************************************************************
739 * DEBUG_Print
741 * Implementation of the 'print' command.
743 void
744 DEBUG_Print( const DBG_ADDR *addr, int count, char format, int level )
746 DBG_ADDR addr1;
747 int i;
748 struct member * m;
749 char * pnt;
750 int size;
751 long long int value;
753 if (count != 1)
755 fprintf( stderr, "Count other than 1 is meaningless in 'print' command\n" );
756 return;
759 if( addr->type == NULL )
761 /* No type, just print the addr value */
762 if (addr->seg && (addr->seg != 0xffffffff))
763 DEBUG_nchar += fprintf( stderr, "0x%04lx: ", addr->seg );
764 DEBUG_nchar += fprintf( stderr, "0x%08lx", addr->off );
765 goto leave;
768 if( level == 0 )
770 DEBUG_nchar = 0;
773 if( DEBUG_nchar > DEBUG_maxchar )
775 fprintf(stderr, "...");
776 goto leave;
779 if( format == 'i' || format == 's' || format == 'w' || format == 'b' )
781 fprintf( stderr, "Format specifier '%c' is meaningless in 'print' command\n", format );
782 format = '\0';
785 switch(addr->type->type)
787 case DT_BASIC:
788 case DT_ENUM:
789 case DT_CONST:
790 case DT_POINTER:
791 DEBUG_PrintBasic(addr, 1, format);
792 break;
793 case DT_STRUCT:
794 DEBUG_nchar += fprintf(stderr, "{");
795 for(m = addr->type->un.structure.members; m; m = m->next)
797 addr1 = *addr;
798 DEBUG_FindStructElement(&addr1, m->name,
799 (int *) &value);
800 DEBUG_nchar += fprintf(stderr, "%s=", m->name);
801 DEBUG_Print(&addr1, 1, format, level + 1);
802 if( m->next != NULL )
804 DEBUG_nchar += fprintf(stderr, ", ");
806 if( DEBUG_nchar > DEBUG_maxchar )
808 fprintf(stderr, "...}");
809 goto leave;
812 DEBUG_nchar += fprintf(stderr, "}");
813 break;
814 case DT_ARRAY:
816 * Loop over all of the entries, printing stuff as we go.
818 size = DEBUG_GetObjectSize(addr->type->un.array.basictype);
819 if( size == 1 )
822 * Special handling for character arrays.
824 pnt = (char *) addr->off;
825 DEBUG_nchar += fprintf(stderr, "\"");
826 for( i=addr->type->un.array.start; i < addr->type->un.array.end; i++ )
828 fputc(*pnt++, stderr);
829 DEBUG_nchar++;
830 if( DEBUG_nchar > DEBUG_maxchar )
832 fprintf(stderr, "...\"");
833 goto leave;
836 DEBUG_nchar += fprintf(stderr, "\"");
837 break;
839 addr1 = *addr;
840 addr1.type = addr->type->un.array.basictype;
841 DEBUG_nchar += fprintf(stderr, "{");
842 for( i=addr->type->un.array.start; i <= addr->type->un.array.end; i++ )
844 DEBUG_Print(&addr1, 1, format, level + 1);
845 addr1.off += size;
846 if( i == addr->type->un.array.end )
848 DEBUG_nchar += fprintf(stderr, "}");
850 else
852 DEBUG_nchar += fprintf(stderr, ", ");
854 if( DEBUG_nchar > DEBUG_maxchar )
856 fprintf(stderr, "...}");
857 goto leave;
860 break;
861 default:
862 assert(FALSE);
863 break;
866 leave:
868 if( level == 0 )
870 DEBUG_nchar += fprintf(stderr, "\n");
872 return;
876 DEBUG_DumpTypes()
878 struct datatype * dt = NULL;
879 struct member * m;
880 int hash;
881 int nm;
882 char * name;
883 char * member_name;
885 for(hash = 0; hash < NR_TYPE_HASH + 1; hash++)
887 for( dt = type_hash_table[hash]; dt; dt = dt->next )
889 name = "none";
890 if( dt->name != NULL )
892 name = dt->name;
894 switch(dt->type)
896 case DT_BASIC:
897 fprintf(stderr, "0x%p - BASIC(%s)\n",
898 dt, name);
899 break;
900 case DT_POINTER:
901 fprintf(stderr, "0x%p - POINTER(%s)(%p)\n",
902 dt, name, dt->un.pointer.pointsto);
903 break;
904 case DT_STRUCT:
905 member_name = "none";
906 nm = 0;
907 if( dt->un.structure.members != NULL
908 && dt->un.structure.members->name != NULL )
910 member_name = dt->un.structure.members->name;
911 for( m = dt->un.structure.members; m; m = m->next)
913 nm++;
916 fprintf(stderr, "0x%p - STRUCT(%s) %d %d %s\n", dt, name,
917 dt->un.structure.size, nm, member_name);
918 break;
919 case DT_ARRAY:
920 fprintf(stderr, "0x%p - ARRAY(%s)(%p)\n",
921 dt, name, dt->un.array.basictype);
922 break;
923 case DT_ENUM:
924 fprintf(stderr, "0x%p - ENUM(%s)\n",
925 dt, name);
926 break;
927 case DT_BITFIELD:
928 fprintf(stderr, "0x%p - BITFIELD(%s)\n", dt, name);
929 break;
930 case DT_FUNC:
931 fprintf(stderr, "0x%p - FUNC(%s)(%p)\n",
932 dt, name, dt->un.funct.rettype);
933 break;
934 case DT_CONST:
935 case DT_TYPEDEF:
936 fprintf(stderr, "What???\n");
937 break;
941 return TRUE;
945 enum debug_type DEBUG_GetType(struct datatype * dt)
947 return dt->type;
950 struct datatype *
951 DEBUG_TypeCast(enum debug_type type, const char * name)
953 int hash;
954 struct datatype * rtn;
957 * The last bucket is special, and is used to hold typeless names.
959 if( name == NULL )
961 hash = NR_TYPE_HASH;
963 else
965 hash = type_hash(name);
968 rtn = DEBUG_LookupDataType(type, hash, name);
970 return rtn;
975 DEBUG_PrintTypeCast(struct datatype * dt)
977 char * name;
979 name = "none";
980 if( dt->name != NULL )
982 name = dt->name;
985 switch(dt->type)
987 case DT_BASIC:
988 fprintf(stderr, "%s", name);
989 break;
990 case DT_POINTER:
991 DEBUG_PrintTypeCast(dt->un.pointer.pointsto);
992 fprintf(stderr, "*");
993 break;
994 case DT_STRUCT:
995 fprintf(stderr, "struct %s", name);
996 break;
997 case DT_ARRAY:
998 fprintf(stderr, "%s[]", name);
999 break;
1000 case DT_ENUM:
1001 fprintf(stderr, "enum %s", name);
1002 break;
1003 case DT_BITFIELD:
1004 fprintf(stderr, "unsigned %s", name);
1005 break;
1006 case DT_FUNC:
1007 DEBUG_PrintTypeCast(dt->un.funct.rettype);
1008 fprintf(stderr, "(*%s)()", name);
1009 break;
1010 case DT_CONST:
1011 case DT_TYPEDEF:
1012 fprintf(stderr, "What???\n");
1013 break;
1016 return TRUE;