Moved various DLLs to dlls/
[wine/hacks.git] / debugger / types.c
blobbb04bc098100c44d34ad791535b9fbd700ecd17e
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 "config.h"
11 #include <stdio.h>
12 #include <stdlib.h>
14 #include <assert.h>
15 #include <fcntl.h>
16 #include <sys/types.h>
17 #include <sys/stat.h>
18 #include <limits.h>
19 #include <string.h>
20 #include <unistd.h>
22 #include "pe_image.h"
23 #include "peexe.h"
24 #include "debugger.h"
25 #include "peexe.h"
27 #define NR_TYPE_HASH 521
29 int DEBUG_nchar;
30 static int DEBUG_maxchar = 1024;
32 struct en_values
34 struct en_values* next;
35 char * name;
36 int value;
39 struct member
41 struct member * next;
42 char * name;
43 struct datatype * type;
44 int offset;
45 int size;
48 struct datatype
50 enum debug_type type;
51 struct datatype * next;
52 char * name;
53 union
55 struct
57 char basic_type;
58 char * output_format;
59 char basic_size;
60 unsigned b_signed:1;
61 } basic;
62 struct
64 unsigned short bitoff;
65 unsigned short nbits;
66 struct datatype * basetype;
67 } bitfield;
69 struct
71 struct datatype * pointsto;
72 } pointer;
73 struct
75 struct datatype * rettype;
76 } funct;
77 struct
79 int start;
80 int end;
81 struct datatype * basictype;
82 } array;
83 struct
85 int size;
86 struct member * members;
87 } structure;
88 struct
90 struct en_values * members;
91 } enumeration;
92 } un;
95 #define BASIC_INT 1
96 #define BASIC_CHAR 2
97 #define BASIC_LONG 3
98 #define BASIC_UINT 4
99 #define BASIC_LUI 5
100 #define BASIC_LONGLONG 6
101 #define BASIC_ULONGLONGI 7
102 #define BASIC_SHORT 8
103 #define BASIC_SHORTUI 9
104 #define BASIC_SCHAR 10
105 #define BASIC_UCHAR 11
106 #define BASIC_FLT 12
107 #define BASIC_LONG_DOUBLE 13
108 #define BASIC_DOUBLE 14
109 #define BASIC_CMPLX_INT 15
110 #define BASIC_CMPLX_FLT 16
111 #define BASIC_CMPLX_DBL 17
112 #define BASIC_CMPLX_LONG_DBL 18
113 #define BASIC_VOID 19
115 struct datatype * DEBUG_TypeInt = NULL;
116 struct datatype * DEBUG_TypeIntConst = NULL;
117 struct datatype * DEBUG_TypeUSInt = NULL;
118 struct datatype * DEBUG_TypeString = NULL;
121 * All of the types that have been defined so far.
123 static struct datatype * type_hash_table[NR_TYPE_HASH + 1];
124 static struct datatype * pointer_types = NULL;
126 static unsigned int type_hash( const char * name )
128 unsigned int hash = 0;
129 unsigned int tmp;
130 const char * p;
132 p = name;
134 while (*p)
136 hash = (hash << 4) + *p++;
138 if( (tmp = (hash & 0xf0000000)) )
140 hash ^= tmp >> 24;
142 hash &= ~tmp;
144 return hash % NR_TYPE_HASH;
148 static struct datatype *
149 DEBUG_InitBasic(int type, char * name, int size, int b_signed,
150 char * output_format)
152 int hash;
154 struct datatype * dt;
155 dt = (struct datatype *) DBG_alloc(sizeof(struct datatype));
157 if( dt != NULL )
159 if( name != NULL )
161 hash = type_hash(name);
163 else
165 hash = NR_TYPE_HASH;
168 dt->type = DT_BASIC;
169 dt->name = name;
170 dt->next = type_hash_table[hash];
171 type_hash_table[hash] = dt;
172 dt->un.basic.basic_type = type;
173 dt->un.basic.basic_size = size;
174 dt->un.basic.b_signed = b_signed;
175 dt->un.basic.output_format = output_format;
178 return dt;
181 static
182 struct datatype *
183 DEBUG_LookupDataType(enum debug_type xtype, int hash, const char * typename)
185 struct datatype * dt = NULL;
187 if( typename != NULL )
189 for( dt = type_hash_table[hash]; dt; dt = dt->next )
191 if( xtype != dt->type || dt->name == NULL
192 || dt->name[0] != typename[0])
194 continue;
197 if( strcmp(dt->name, typename) == 0 )
199 return dt;
204 return dt;
207 struct datatype *
208 DEBUG_NewDataType(enum debug_type xtype, const char * typename)
210 struct datatype * dt = NULL;
211 int hash;
214 * The last bucket is special, and is used to hold typeless names.
216 if( typename == NULL )
218 hash = NR_TYPE_HASH;
220 else
222 hash = type_hash(typename);
225 dt = DEBUG_LookupDataType(xtype, hash, typename);
227 if( dt == NULL )
229 dt = (struct datatype *) DBG_alloc(sizeof(struct datatype));
231 if( dt != NULL )
233 memset(dt, 0, sizeof(*dt));
235 dt->type = xtype;
236 if( typename != NULL )
238 dt->name = DBG_strdup(typename);
240 else
242 dt->name = NULL;
244 if( xtype == DT_POINTER )
246 dt->next = pointer_types;
247 pointer_types = dt;
249 else
251 dt->next = type_hash_table[hash];
252 type_hash_table[hash] = dt;
257 return dt;
260 struct datatype *
261 DEBUG_FindOrMakePointerType(struct datatype * reftype)
263 struct datatype * dt = NULL;
265 if( reftype != NULL )
267 for( dt = pointer_types; dt; dt = dt->next )
269 if( dt->type != DT_POINTER )
271 continue;
274 if( dt->un.pointer.pointsto == reftype )
276 return dt;
281 if( dt == NULL )
283 dt = (struct datatype *) DBG_alloc(sizeof(struct datatype));
285 if( dt != NULL )
287 dt->type = DT_POINTER;
288 dt->un.pointer.pointsto = reftype;
289 dt->next = pointer_types;
290 pointer_types = dt;
294 return dt;
297 void
298 DEBUG_InitTypes()
300 static int beenhere = 0;
301 struct datatype * chartype;
303 if( beenhere++ != 0 )
305 return;
309 * Special version of int used with constants of various kinds.
311 DEBUG_TypeIntConst = DEBUG_InitBasic(BASIC_INT,NULL,4,1,"%d");
314 * Initialize a few builtin types.
318 DEBUG_TypeInt = DEBUG_InitBasic(BASIC_INT,"int",4,1,"%d");
319 chartype = DEBUG_InitBasic(BASIC_CHAR,"char",1,1,"'%c'");
320 DEBUG_InitBasic(BASIC_LONG,"long int",4,1,"%d");
321 DEBUG_TypeUSInt = DEBUG_InitBasic(BASIC_UINT,"unsigned int",4,0,"%d");
322 DEBUG_InitBasic(BASIC_LUI,"long unsigned int",4,0,"%d");
323 DEBUG_InitBasic(BASIC_LONGLONG,"long long int",8,1,"%ld");
324 DEBUG_InitBasic(BASIC_ULONGLONGI,"long long unsigned int",8,0,"%ld");
325 DEBUG_InitBasic(BASIC_SHORT,"short int",2,1,"%d");
326 DEBUG_InitBasic(BASIC_SHORTUI,"short unsigned int",2,0,"%d");
327 DEBUG_InitBasic(BASIC_SCHAR,"signed char",1,1,"'%c'");
328 DEBUG_InitBasic(BASIC_UCHAR,"unsigned char",1,0,"'%c'");
329 DEBUG_InitBasic(BASIC_FLT,"float",4,0,"%f");
330 DEBUG_InitBasic(BASIC_LONG_DOUBLE,"double",8,0,"%lf");
331 DEBUG_InitBasic(BASIC_DOUBLE,"long double",12,0,NULL);
332 DEBUG_InitBasic(BASIC_CMPLX_INT,"complex int",8,1,NULL);
333 DEBUG_InitBasic(BASIC_CMPLX_FLT,"complex float",8,0,NULL);
334 DEBUG_InitBasic(BASIC_CMPLX_DBL,"complex double",16,0,NULL);
335 DEBUG_InitBasic(BASIC_CMPLX_LONG_DBL,"complex long double",24,0,NULL);
336 DEBUG_InitBasic(BASIC_VOID,"void",0,0,NULL);
338 DEBUG_TypeString = DEBUG_NewDataType(DT_POINTER, NULL);
339 DEBUG_SetPointerType(DEBUG_TypeString, chartype);
342 * Now initialize the builtins for codeview.
344 DEBUG_InitCVDataTypes();
348 long long int
349 DEBUG_GetExprValue(DBG_ADDR * addr, char ** format)
351 DBG_ADDR address = *addr;
352 unsigned int rtn;
353 struct datatype * type2 = NULL;
354 struct en_values * e;
355 char * def_format = "0x%x";
357 rtn = 0;
358 address.seg = 0; /* FIXME? I don't quite get this... */
359 assert(addr->type != NULL);
361 switch(addr->type->type)
363 case DT_BASIC:
364 if (!DBG_CHECK_READ_PTR( &address, addr->type->un.basic.basic_size))
366 return 0;
369 memcpy(&rtn, (char *) addr->off, addr->type->un.basic.basic_size);
370 if( (addr->type->un.basic.b_signed)
371 && ((addr->type->un.basic.basic_size & 3) != 0)
372 && ((rtn >> (addr->type->un.basic.basic_size * 8 - 1)) != 0) )
374 rtn = rtn | ((-1) << (addr->type->un.basic.basic_size * 8));
376 if( addr->type->un.basic.output_format != NULL )
378 def_format = addr->type->un.basic.output_format;
382 * Check for single character prints that are out of range.
384 if( addr->type->un.basic.basic_size == 1
385 && strcmp(def_format, "'%c'") == 0
386 && ((rtn < 0x20) || (rtn > 0x80)) )
388 def_format = "%d";
390 break;
391 case DT_POINTER:
392 if (!DBG_CHECK_READ_PTR( &address, 1 )) return 0;
393 rtn = (unsigned int) *((unsigned char **)addr->off);
394 type2 = addr->type->un.pointer.pointsto;
396 if (!type2)
398 def_format = "Internal symbol error: unable to access memory location 0x%08x";
399 rtn = 0;
400 break;
403 if( type2->type == DT_BASIC && type2->un.basic.basic_size == 1 )
405 def_format = "\"%s\"";
406 break;
408 else
410 def_format = "0x%8.8x";
412 break;
413 case DT_ARRAY:
414 case DT_STRUCT:
415 if (!DBG_CHECK_READ_PTR( &address, 1 )) return 0;
416 rtn = (unsigned int) *((unsigned char **)addr->off);
417 def_format = "0x%8.8x";
418 break;
419 case DT_ENUM:
420 if (!DBG_CHECK_READ_PTR( &address, 1 )) return 0;
421 rtn = (unsigned int) *((unsigned char **)addr->off);
422 for(e = addr->type->un.enumeration.members; e; e = e->next )
424 if( e->value == rtn )
426 break;
429 if( e != NULL )
431 rtn = (int) e->name;
432 def_format = "%s";
434 else
436 def_format = "%d";
438 break;
439 default:
440 rtn = 0;
441 break;
445 if( format != NULL )
447 *format = def_format;
449 return rtn;
452 unsigned int
453 DEBUG_TypeDerefPointer(DBG_ADDR * addr, struct datatype ** newtype)
455 DBG_ADDR address = *addr;
458 * Make sure that this really makes sense.
460 if( addr->type->type != DT_POINTER )
462 *newtype = NULL;
463 return 0;
466 *newtype = addr->type->un.pointer.pointsto;
467 address.off = *(unsigned int*) (addr->off);
468 return (unsigned int)DBG_ADDR_TO_LIN(&address); /* FIXME: is this right (or "better") ? */
471 unsigned int
472 DEBUG_FindStructElement(DBG_ADDR * addr, const char * ele_name, int * tmpbuf)
474 struct member * m;
475 unsigned int mask;
478 * Make sure that this really makes sense.
480 if( addr->type->type != DT_STRUCT )
482 addr->type = NULL;
483 return FALSE;
486 for(m = addr->type->un.structure.members; m; m = m->next)
488 if( strcmp(m->name, ele_name) == 0 )
490 addr->type = m->type;
491 if( (m->offset & 7) != 0 || (m->size & 7) != 0)
494 * Bitfield operation. We have to extract the field and store
495 * it in a temporary buffer so that we get it all right.
497 *tmpbuf = ((*(int* ) (addr->off + (m->offset >> 3))) >> (m->offset & 7));
498 addr->off = (int) tmpbuf;
500 mask = 0xffffffff << (m->size);
501 *tmpbuf &= ~mask;
503 * OK, now we have the correct part of the number.
504 * Check to see whether the basic type is signed or not, and if so,
505 * we need to sign extend the number.
507 if( m->type->type == DT_BASIC && m->type->un.basic.b_signed != 0
508 && (*tmpbuf & (1 << (m->size - 1))) != 0 )
510 *tmpbuf |= mask;
513 else
515 addr->off += (m->offset >> 3);
517 return TRUE;
521 addr->type = NULL;
522 return FALSE;
526 DEBUG_SetStructSize(struct datatype * dt, int size)
528 assert(dt->type == DT_STRUCT);
530 if( dt->un.structure.members != NULL )
532 return FALSE;
535 dt->un.structure.size = size;
536 dt->un.structure.members = NULL;
538 return TRUE;
542 DEBUG_CopyFieldlist(struct datatype * dt, struct datatype * dt2)
545 assert( dt->type == dt2->type && ((dt->type == DT_STRUCT) || (dt->type == DT_ENUM)));
547 if( dt->type == DT_STRUCT )
549 dt->un.structure.members = dt2->un.structure.members;
551 else
553 dt->un.enumeration.members = dt2->un.enumeration.members;
556 return TRUE;
560 DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type,
561 int offset, int size)
563 struct member * m;
564 struct member * last;
565 struct en_values * e;
567 if( dt->type == DT_STRUCT )
569 for(last = dt->un.structure.members; last; last = last->next)
571 if( (last->name[0] == name[0])
572 && (strcmp(last->name, name) == 0) )
574 return TRUE;
576 if( last->next == NULL )
578 break;
581 m = (struct member *) DBG_alloc(sizeof(struct member));
582 if( m == FALSE )
584 return FALSE;
587 m->name = DBG_strdup(name);
588 m->type = type;
589 m->offset = offset;
590 m->size = size;
591 if( last == NULL )
593 m->next = dt->un.structure.members;
594 dt->un.structure.members = m;
596 else
598 last->next = m;
599 m->next = NULL;
602 * If the base type is bitfield, then adjust the offsets here so that we
603 * are able to look things up without lots of falter-all.
605 if( type->type == DT_BITFIELD )
607 m->offset += m->type->un.bitfield.bitoff;
608 m->size = m->type->un.bitfield.nbits;
609 m->type = m->type->un.bitfield.basetype;
612 else if( dt->type == DT_ENUM )
614 e = (struct en_values *) DBG_alloc(sizeof(struct en_values));
615 if( e == FALSE )
617 return FALSE;
620 e->name = DBG_strdup(name);
621 e->value = offset;
622 e->next = dt->un.enumeration.members;
623 dt->un.enumeration.members = e;
625 else
627 assert(FALSE);
629 return TRUE;
632 struct datatype *
633 DEBUG_GetPointerType(struct datatype * dt)
635 if( dt->type == DT_POINTER )
637 return dt->un.pointer.pointsto;
640 return NULL;
644 DEBUG_SetPointerType(struct datatype * dt, struct datatype * dt2)
646 switch(dt->type)
648 case DT_POINTER:
649 dt->un.pointer.pointsto = dt2;
650 break;
651 case DT_FUNC:
652 dt->un.funct.rettype = dt2;
653 break;
654 default:
655 assert(FALSE);
658 return TRUE;
662 DEBUG_SetArrayParams(struct datatype * dt, int min, int max, struct datatype * dt2)
664 assert(dt->type == DT_ARRAY);
665 dt->un.array.start = min;
666 dt->un.array.end = max;
667 dt->un.array.basictype = dt2;
669 return TRUE;
673 DEBUG_SetBitfieldParams(struct datatype * dt, int offset, int nbits,
674 struct datatype * dt2)
676 assert(dt->type == DT_BITFIELD);
677 dt->un.bitfield.bitoff = offset;
678 dt->un.bitfield.nbits = nbits;
679 dt->un.bitfield.basetype = dt2;
681 return TRUE;
684 int DEBUG_GetObjectSize(struct datatype * dt)
686 if( dt == NULL )
688 return 0;
691 switch(dt->type)
693 case DT_BASIC:
694 return dt->un.basic.basic_size;
695 case DT_POINTER:
696 return sizeof(int *);
697 case DT_STRUCT:
698 return dt->un.structure.size;
699 case DT_ENUM:
700 return sizeof(int);
701 case DT_ARRAY:
702 return (dt->un.array.end - dt->un.array.start)
703 * DEBUG_GetObjectSize(dt->un.array.basictype);
704 case DT_BITFIELD:
706 * Bitfields have to be handled seperately later on
707 * when we insert the element into the structure.
709 return 0;
710 case DT_TYPEDEF:
711 case DT_FUNC:
712 case DT_CONST:
713 assert(FALSE);
715 return 0;
718 unsigned int
719 DEBUG_ArrayIndex(DBG_ADDR * addr, DBG_ADDR * result, int index)
721 int size;
724 * Make sure that this really makes sense.
726 if( addr->type->type == DT_POINTER )
729 * Get the base type, so we know how much to index by.
731 size = DEBUG_GetObjectSize(addr->type->un.pointer.pointsto);
732 result->type = addr->type->un.pointer.pointsto;
733 result->off = (*(unsigned int*) (addr->off)) + size * index;
735 else if (addr->type->type == DT_ARRAY)
737 size = DEBUG_GetObjectSize(addr->type->un.array.basictype);
738 result->type = addr->type->un.array.basictype;
739 result->off = addr->off + size * (index - addr->type->un.array.start);
742 return TRUE;
745 /***********************************************************************
746 * DEBUG_Print
748 * Implementation of the 'print' command.
750 void
751 DEBUG_Print( const DBG_ADDR *addr, int count, char format, int level )
753 DBG_ADDR addr1;
754 int i;
755 struct member * m;
756 char * pnt;
757 int size;
758 long long int value;
760 if (count != 1)
762 fprintf( stderr, "Count other than 1 is meaningless in 'print' command\n" );
763 return;
766 if( addr->type == NULL )
768 /* No type, just print the addr value */
769 if (addr->seg && (addr->seg != 0xffffffff))
770 DEBUG_nchar += fprintf( stderr, "0x%04lx: ", addr->seg );
771 DEBUG_nchar += fprintf( stderr, "0x%08lx", addr->off );
772 goto leave;
775 if( level == 0 )
777 DEBUG_nchar = 0;
780 if( DEBUG_nchar > DEBUG_maxchar )
782 fprintf(stderr, "...");
783 goto leave;
786 if( format == 'i' || format == 's' || format == 'w' || format == 'b' )
788 fprintf( stderr, "Format specifier '%c' is meaningless in 'print' command\n", format );
789 format = '\0';
792 switch(addr->type->type)
794 case DT_BASIC:
795 case DT_ENUM:
796 case DT_CONST:
797 case DT_POINTER:
798 DEBUG_PrintBasic(addr, 1, format);
799 break;
800 case DT_STRUCT:
801 DEBUG_nchar += fprintf(stderr, "{");
802 for(m = addr->type->un.structure.members; m; m = m->next)
804 addr1 = *addr;
805 DEBUG_FindStructElement(&addr1, m->name,
806 (int *) &value);
807 DEBUG_nchar += fprintf(stderr, "%s=", m->name);
808 DEBUG_Print(&addr1, 1, format, level + 1);
809 if( m->next != NULL )
811 DEBUG_nchar += fprintf(stderr, ", ");
813 if( DEBUG_nchar > DEBUG_maxchar )
815 fprintf(stderr, "...}");
816 goto leave;
819 DEBUG_nchar += fprintf(stderr, "}");
820 break;
821 case DT_ARRAY:
823 * Loop over all of the entries, printing stuff as we go.
825 size = DEBUG_GetObjectSize(addr->type->un.array.basictype);
826 if( size == 1 )
829 * Special handling for character arrays.
831 pnt = (char *) addr->off;
832 DEBUG_nchar += fprintf(stderr, "\"");
833 for( i=addr->type->un.array.start; i < addr->type->un.array.end; i++ )
835 fputc(*pnt++, stderr);
836 DEBUG_nchar++;
837 if( DEBUG_nchar > DEBUG_maxchar )
839 fprintf(stderr, "...\"");
840 goto leave;
843 DEBUG_nchar += fprintf(stderr, "\"");
844 break;
846 addr1 = *addr;
847 addr1.type = addr->type->un.array.basictype;
848 DEBUG_nchar += fprintf(stderr, "{");
849 for( i=addr->type->un.array.start; i <= addr->type->un.array.end; i++ )
851 DEBUG_Print(&addr1, 1, format, level + 1);
852 addr1.off += size;
853 if( i == addr->type->un.array.end )
855 DEBUG_nchar += fprintf(stderr, "}");
857 else
859 DEBUG_nchar += fprintf(stderr, ", ");
861 if( DEBUG_nchar > DEBUG_maxchar )
863 fprintf(stderr, "...}");
864 goto leave;
867 break;
868 default:
869 assert(FALSE);
870 break;
873 leave:
875 if( level == 0 )
877 DEBUG_nchar += fprintf(stderr, "\n");
879 return;
883 DEBUG_DumpTypes()
885 struct datatype * dt = NULL;
886 struct member * m;
887 int hash;
888 int nm;
889 char * name;
890 char * member_name;
892 for(hash = 0; hash < NR_TYPE_HASH + 1; hash++)
894 for( dt = type_hash_table[hash]; dt; dt = dt->next )
896 name = "none";
897 if( dt->name != NULL )
899 name = dt->name;
901 switch(dt->type)
903 case DT_BASIC:
904 fprintf(stderr, "0x%p - BASIC(%s)\n",
905 dt, name);
906 break;
907 case DT_POINTER:
908 fprintf(stderr, "0x%p - POINTER(%s)(%p)\n",
909 dt, name, dt->un.pointer.pointsto);
910 break;
911 case DT_STRUCT:
912 member_name = "none";
913 nm = 0;
914 if( dt->un.structure.members != NULL
915 && dt->un.structure.members->name != NULL )
917 member_name = dt->un.structure.members->name;
918 for( m = dt->un.structure.members; m; m = m->next)
920 nm++;
923 fprintf(stderr, "0x%p - STRUCT(%s) %d %d %s\n", dt, name,
924 dt->un.structure.size, nm, member_name);
925 break;
926 case DT_ARRAY:
927 fprintf(stderr, "0x%p - ARRAY(%s)(%p)\n",
928 dt, name, dt->un.array.basictype);
929 break;
930 case DT_ENUM:
931 fprintf(stderr, "0x%p - ENUM(%s)\n",
932 dt, name);
933 break;
934 case DT_BITFIELD:
935 fprintf(stderr, "0x%p - BITFIELD(%s)\n", dt, name);
936 break;
937 case DT_FUNC:
938 fprintf(stderr, "0x%p - FUNC(%s)(%p)\n",
939 dt, name, dt->un.funct.rettype);
940 break;
941 case DT_CONST:
942 case DT_TYPEDEF:
943 fprintf(stderr, "What???\n");
944 break;
948 return TRUE;
952 enum debug_type DEBUG_GetType(struct datatype * dt)
954 return dt->type;
957 struct datatype *
958 DEBUG_TypeCast(enum debug_type type, const char * name)
960 int hash;
961 struct datatype * rtn;
964 * The last bucket is special, and is used to hold typeless names.
966 if( name == NULL )
968 hash = NR_TYPE_HASH;
970 else
972 hash = type_hash(name);
975 rtn = DEBUG_LookupDataType(type, hash, name);
977 return rtn;
982 DEBUG_PrintTypeCast(struct datatype * dt)
984 char * name;
986 name = "none";
987 if( dt->name != NULL )
989 name = dt->name;
992 switch(dt->type)
994 case DT_BASIC:
995 fprintf(stderr, "%s", name);
996 break;
997 case DT_POINTER:
998 DEBUG_PrintTypeCast(dt->un.pointer.pointsto);
999 fprintf(stderr, "*");
1000 break;
1001 case DT_STRUCT:
1002 fprintf(stderr, "struct %s", name);
1003 break;
1004 case DT_ARRAY:
1005 fprintf(stderr, "%s[]", name);
1006 break;
1007 case DT_ENUM:
1008 fprintf(stderr, "enum %s", name);
1009 break;
1010 case DT_BITFIELD:
1011 fprintf(stderr, "unsigned %s", name);
1012 break;
1013 case DT_FUNC:
1014 DEBUG_PrintTypeCast(dt->un.funct.rettype);
1015 fprintf(stderr, "(*%s)()", name);
1016 break;
1017 case DT_CONST:
1018 case DT_TYPEDEF:
1019 fprintf(stderr, "What???\n");
1020 break;
1023 return TRUE;