GetLongPathName rewrite.
[wine.git] / debugger / types.c
blob1719586e617aab27e05247675626c459d661ac59
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"
26 #define NR_TYPE_HASH 521
28 int DEBUG_nchar;
29 static int DEBUG_maxchar = 1024;
31 struct en_values
33 struct en_values* next;
34 char * name;
35 int value;
38 struct member
40 struct member * next;
41 char * name;
42 struct datatype * type;
43 int offset;
44 int size;
47 struct datatype
49 enum debug_type type;
50 struct datatype * next;
51 char * name;
52 union
54 struct
56 char basic_type;
57 char * output_format;
58 char basic_size;
59 unsigned b_signed:1;
60 } basic;
61 struct
63 unsigned short bitoff;
64 unsigned short nbits;
65 struct datatype * basetype;
66 } bitfield;
68 struct
70 struct datatype * pointsto;
71 } pointer;
72 struct
74 struct datatype * rettype;
75 } funct;
76 struct
78 int start;
79 int end;
80 struct datatype * basictype;
81 } array;
82 struct
84 int size;
85 struct member * members;
86 } structure;
87 struct
89 struct en_values * members;
90 } enumeration;
91 } un;
94 #define BASIC_INT 1
95 #define BASIC_CHAR 2
96 #define BASIC_LONG 3
97 #define BASIC_UINT 4
98 #define BASIC_LUI 5
99 #define BASIC_LONGLONG 6
100 #define BASIC_ULONGLONGI 7
101 #define BASIC_SHORT 8
102 #define BASIC_SHORTUI 9
103 #define BASIC_SCHAR 10
104 #define BASIC_UCHAR 11
105 #define BASIC_FLT 12
106 #define BASIC_LONG_DOUBLE 13
107 #define BASIC_DOUBLE 14
108 #define BASIC_CMPLX_INT 15
109 #define BASIC_CMPLX_FLT 16
110 #define BASIC_CMPLX_DBL 17
111 #define BASIC_CMPLX_LONG_DBL 18
112 #define BASIC_VOID 19
114 struct datatype * DEBUG_TypeInt = NULL;
115 struct datatype * DEBUG_TypeIntConst = NULL;
116 struct datatype * DEBUG_TypeUSInt = NULL;
117 struct datatype * DEBUG_TypeString = NULL;
120 * All of the types that have been defined so far.
122 static struct datatype * type_hash_table[NR_TYPE_HASH + 1];
123 static struct datatype * pointer_types = NULL;
125 static unsigned int type_hash( const char * name )
127 unsigned int hash = 0;
128 unsigned int tmp;
129 const char * p;
131 p = name;
133 while (*p)
135 hash = (hash << 4) + *p++;
137 if( (tmp = (hash & 0xf0000000)) )
139 hash ^= tmp >> 24;
141 hash &= ~tmp;
143 return hash % NR_TYPE_HASH;
147 static struct datatype *
148 DEBUG_InitBasic(int type, char * name, int size, int b_signed,
149 char * output_format)
151 int hash;
153 struct datatype * dt;
154 dt = (struct datatype *) DBG_alloc(sizeof(struct datatype));
156 if( dt != NULL )
158 if( name != NULL )
160 hash = type_hash(name);
162 else
164 hash = NR_TYPE_HASH;
167 dt->type = DT_BASIC;
168 dt->name = name;
169 dt->next = type_hash_table[hash];
170 type_hash_table[hash] = dt;
171 dt->un.basic.basic_type = type;
172 dt->un.basic.basic_size = size;
173 dt->un.basic.b_signed = b_signed;
174 dt->un.basic.output_format = output_format;
177 return dt;
180 static
181 struct datatype *
182 DEBUG_LookupDataType(enum debug_type xtype, int hash, const char * typename)
184 struct datatype * dt = NULL;
186 if( typename != NULL )
188 for( dt = type_hash_table[hash]; dt; dt = dt->next )
190 if( xtype != dt->type || dt->name == NULL
191 || dt->name[0] != typename[0])
193 continue;
196 if( strcmp(dt->name, typename) == 0 )
198 return dt;
203 return dt;
206 struct datatype *
207 DEBUG_NewDataType(enum debug_type xtype, const char * typename)
209 struct datatype * dt = NULL;
210 int hash;
213 * The last bucket is special, and is used to hold typeless names.
215 if( typename == NULL )
217 hash = NR_TYPE_HASH;
219 else
221 hash = type_hash(typename);
224 dt = DEBUG_LookupDataType(xtype, hash, typename);
226 if( dt == NULL )
228 dt = (struct datatype *) DBG_alloc(sizeof(struct datatype));
230 if( dt != NULL )
232 memset(dt, 0, sizeof(*dt));
234 dt->type = xtype;
235 if( typename != NULL )
237 dt->name = DBG_strdup(typename);
239 else
241 dt->name = NULL;
243 if( xtype == DT_POINTER )
245 dt->next = pointer_types;
246 pointer_types = dt;
248 else
250 dt->next = type_hash_table[hash];
251 type_hash_table[hash] = dt;
256 return dt;
259 struct datatype *
260 DEBUG_FindOrMakePointerType(struct datatype * reftype)
262 struct datatype * dt = NULL;
264 if( reftype != NULL )
266 for( dt = pointer_types; dt; dt = dt->next )
268 if( dt->type != DT_POINTER )
270 continue;
273 if( dt->un.pointer.pointsto == reftype )
275 return dt;
280 if( dt == NULL )
282 dt = (struct datatype *) DBG_alloc(sizeof(struct datatype));
284 if( dt != NULL )
286 dt->type = DT_POINTER;
287 dt->un.pointer.pointsto = reftype;
288 dt->next = pointer_types;
289 pointer_types = dt;
293 return dt;
296 void
297 DEBUG_InitTypes()
299 static int beenhere = 0;
300 struct datatype * chartype;
302 if( beenhere++ != 0 )
304 return;
308 * Special version of int used with constants of various kinds.
310 DEBUG_TypeIntConst = DEBUG_InitBasic(BASIC_INT,NULL,4,1,"%d");
313 * Initialize a few builtin types.
317 DEBUG_TypeInt = DEBUG_InitBasic(BASIC_INT,"int",4,1,"%d");
318 chartype = DEBUG_InitBasic(BASIC_CHAR,"char",1,1,"'%c'");
319 DEBUG_InitBasic(BASIC_LONG,"long int",4,1,"%d");
320 DEBUG_TypeUSInt = DEBUG_InitBasic(BASIC_UINT,"unsigned int",4,0,"%d");
321 DEBUG_InitBasic(BASIC_LUI,"long unsigned int",4,0,"%d");
322 DEBUG_InitBasic(BASIC_LONGLONG,"long long int",8,1,"%ld");
323 DEBUG_InitBasic(BASIC_ULONGLONGI,"long long unsigned int",8,0,"%ld");
324 DEBUG_InitBasic(BASIC_SHORT,"short int",2,1,"%d");
325 DEBUG_InitBasic(BASIC_SHORTUI,"short unsigned int",2,0,"%d");
326 DEBUG_InitBasic(BASIC_SCHAR,"signed char",1,1,"'%c'");
327 DEBUG_InitBasic(BASIC_UCHAR,"unsigned char",1,0,"'%c'");
328 DEBUG_InitBasic(BASIC_FLT,"float",4,0,"%f");
329 DEBUG_InitBasic(BASIC_LONG_DOUBLE,"double",8,0,"%lf");
330 DEBUG_InitBasic(BASIC_DOUBLE,"long double",12,0,NULL);
331 DEBUG_InitBasic(BASIC_CMPLX_INT,"complex int",8,1,NULL);
332 DEBUG_InitBasic(BASIC_CMPLX_FLT,"complex float",8,0,NULL);
333 DEBUG_InitBasic(BASIC_CMPLX_DBL,"complex double",16,0,NULL);
334 DEBUG_InitBasic(BASIC_CMPLX_LONG_DBL,"complex long double",24,0,NULL);
335 DEBUG_InitBasic(BASIC_VOID,"void",0,0,NULL);
337 DEBUG_TypeString = DEBUG_NewDataType(DT_POINTER, NULL);
338 DEBUG_SetPointerType(DEBUG_TypeString, chartype);
341 * Now initialize the builtins for codeview.
343 DEBUG_InitCVDataTypes();
347 long long int
348 DEBUG_GetExprValue(DBG_ADDR * addr, char ** format)
350 DBG_ADDR address = *addr;
351 unsigned int rtn;
352 struct datatype * type2 = NULL;
353 struct en_values * e;
354 char * def_format = "0x%x";
356 rtn = 0;
357 address.seg = 0; /* FIXME? I don't quite get this... */
358 assert(addr->type != NULL);
360 switch(addr->type->type)
362 case DT_BASIC:
363 if (!DBG_CHECK_READ_PTR( &address, addr->type->un.basic.basic_size))
365 return 0;
368 memcpy(&rtn, (char *) addr->off, addr->type->un.basic.basic_size);
369 if( (addr->type->un.basic.b_signed)
370 && ((addr->type->un.basic.basic_size & 3) != 0)
371 && ((rtn >> (addr->type->un.basic.basic_size * 8 - 1)) != 0) )
373 rtn = rtn | ((-1) << (addr->type->un.basic.basic_size * 8));
375 if( addr->type->un.basic.output_format != NULL )
377 def_format = addr->type->un.basic.output_format;
381 * Check for single character prints that are out of range.
383 if( addr->type->un.basic.basic_size == 1
384 && strcmp(def_format, "'%c'") == 0
385 && ((rtn < 0x20) || (rtn > 0x80)) )
387 def_format = "%d";
389 break;
390 case DT_POINTER:
391 if (!DBG_CHECK_READ_PTR( &address, 1 )) return 0;
392 rtn = (unsigned int) *((unsigned char **)addr->off);
393 type2 = addr->type->un.pointer.pointsto;
395 if (!type2)
397 def_format = "Internal symbol error: unable to access memory location 0x%08x";
398 rtn = 0;
399 break;
402 if( type2->type == DT_BASIC && type2->un.basic.basic_size == 1 )
404 def_format = "\"%s\"";
405 address.off = rtn;
406 address.seg = 0;
407 if (!DBG_CHECK_READ_PTR( &address, 1 )) return 0;
408 break;
410 else
412 def_format = "0x%8.8x";
414 break;
415 case DT_ARRAY:
416 case DT_STRUCT:
417 if (!DBG_CHECK_READ_PTR( &address, 1 )) return 0;
418 rtn = (unsigned int) *((unsigned char **)addr->off);
419 def_format = "0x%8.8x";
420 break;
421 case DT_ENUM:
422 if (!DBG_CHECK_READ_PTR( &address, 1 )) return 0;
423 rtn = (unsigned int) *((unsigned char **)addr->off);
424 for(e = addr->type->un.enumeration.members; e; e = e->next )
426 if( e->value == rtn )
428 break;
431 if( e != NULL )
433 rtn = (int) e->name;
434 def_format = "%s";
436 else
438 def_format = "%d";
440 break;
441 default:
442 rtn = 0;
443 break;
447 if( format != NULL )
449 *format = def_format;
451 return rtn;
454 unsigned int
455 DEBUG_TypeDerefPointer(DBG_ADDR * addr, struct datatype ** newtype)
457 DBG_ADDR address = *addr;
460 * Make sure that this really makes sense.
462 if( addr->type->type != DT_POINTER )
464 *newtype = NULL;
465 return 0;
468 *newtype = addr->type->un.pointer.pointsto;
469 address.off = *(unsigned int*) (addr->off);
470 return (unsigned int)DBG_ADDR_TO_LIN(&address); /* FIXME: is this right (or "better") ? */
473 unsigned int
474 DEBUG_FindStructElement(DBG_ADDR * addr, const char * ele_name, int * tmpbuf)
476 struct member * m;
477 unsigned int mask;
480 * Make sure that this really makes sense.
482 if( addr->type->type != DT_STRUCT )
484 addr->type = NULL;
485 return FALSE;
488 for(m = addr->type->un.structure.members; m; m = m->next)
490 if( strcmp(m->name, ele_name) == 0 )
492 addr->type = m->type;
493 if( (m->offset & 7) != 0 || (m->size & 7) != 0)
496 * Bitfield operation. We have to extract the field and store
497 * it in a temporary buffer so that we get it all right.
499 *tmpbuf = ((*(int* ) (addr->off + (m->offset >> 3))) >> (m->offset & 7));
500 addr->off = (int) tmpbuf;
502 mask = 0xffffffff << (m->size);
503 *tmpbuf &= ~mask;
505 * OK, now we have the correct part of the number.
506 * Check to see whether the basic type is signed or not, and if so,
507 * we need to sign extend the number.
509 if( m->type->type == DT_BASIC && m->type->un.basic.b_signed != 0
510 && (*tmpbuf & (1 << (m->size - 1))) != 0 )
512 *tmpbuf |= mask;
515 else
517 addr->off += (m->offset >> 3);
519 return TRUE;
523 addr->type = NULL;
524 return FALSE;
528 DEBUG_SetStructSize(struct datatype * dt, int size)
530 assert(dt->type == DT_STRUCT);
532 if( dt->un.structure.members != NULL )
534 return FALSE;
537 dt->un.structure.size = size;
538 dt->un.structure.members = NULL;
540 return TRUE;
544 DEBUG_CopyFieldlist(struct datatype * dt, struct datatype * dt2)
547 assert( dt->type == dt2->type && ((dt->type == DT_STRUCT) || (dt->type == DT_ENUM)));
549 if( dt->type == DT_STRUCT )
551 dt->un.structure.members = dt2->un.structure.members;
553 else
555 dt->un.enumeration.members = dt2->un.enumeration.members;
558 return TRUE;
562 DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type,
563 int offset, int size)
565 struct member * m;
566 struct member * last;
567 struct en_values * e;
569 if( dt->type == DT_STRUCT )
571 for(last = dt->un.structure.members; last; last = last->next)
573 if( (last->name[0] == name[0])
574 && (strcmp(last->name, name) == 0) )
576 return TRUE;
578 if( last->next == NULL )
580 break;
583 m = (struct member *) DBG_alloc(sizeof(struct member));
584 if( m == FALSE )
586 return FALSE;
589 m->name = DBG_strdup(name);
590 m->type = type;
591 m->offset = offset;
592 m->size = size;
593 if( last == NULL )
595 m->next = dt->un.structure.members;
596 dt->un.structure.members = m;
598 else
600 last->next = m;
601 m->next = NULL;
604 * If the base type is bitfield, then adjust the offsets here so that we
605 * are able to look things up without lots of falter-all.
607 if( type->type == DT_BITFIELD )
609 m->offset += m->type->un.bitfield.bitoff;
610 m->size = m->type->un.bitfield.nbits;
611 m->type = m->type->un.bitfield.basetype;
614 else if( dt->type == DT_ENUM )
616 e = (struct en_values *) DBG_alloc(sizeof(struct en_values));
617 if( e == FALSE )
619 return FALSE;
622 e->name = DBG_strdup(name);
623 e->value = offset;
624 e->next = dt->un.enumeration.members;
625 dt->un.enumeration.members = e;
627 else
629 assert(FALSE);
631 return TRUE;
634 struct datatype *
635 DEBUG_GetPointerType(struct datatype * dt)
637 if( dt->type == DT_POINTER )
639 return dt->un.pointer.pointsto;
642 return NULL;
646 DEBUG_SetPointerType(struct datatype * dt, struct datatype * dt2)
648 switch(dt->type)
650 case DT_POINTER:
651 dt->un.pointer.pointsto = dt2;
652 break;
653 case DT_FUNC:
654 dt->un.funct.rettype = dt2;
655 break;
656 default:
657 assert(FALSE);
660 return TRUE;
664 DEBUG_SetArrayParams(struct datatype * dt, int min, int max, struct datatype * dt2)
666 assert(dt->type == DT_ARRAY);
667 dt->un.array.start = min;
668 dt->un.array.end = max;
669 dt->un.array.basictype = dt2;
671 return TRUE;
675 DEBUG_SetBitfieldParams(struct datatype * dt, int offset, int nbits,
676 struct datatype * dt2)
678 assert(dt->type == DT_BITFIELD);
679 dt->un.bitfield.bitoff = offset;
680 dt->un.bitfield.nbits = nbits;
681 dt->un.bitfield.basetype = dt2;
683 return TRUE;
686 int DEBUG_GetObjectSize(struct datatype * dt)
688 if( dt == NULL )
690 return 0;
693 switch(dt->type)
695 case DT_BASIC:
696 return dt->un.basic.basic_size;
697 case DT_POINTER:
698 return sizeof(int *);
699 case DT_STRUCT:
700 return dt->un.structure.size;
701 case DT_ENUM:
702 return sizeof(int);
703 case DT_ARRAY:
704 return (dt->un.array.end - dt->un.array.start)
705 * DEBUG_GetObjectSize(dt->un.array.basictype);
706 case DT_BITFIELD:
708 * Bitfields have to be handled seperately later on
709 * when we insert the element into the structure.
711 return 0;
712 case DT_TYPEDEF:
713 case DT_FUNC:
714 case DT_CONST:
715 assert(FALSE);
717 return 0;
720 unsigned int
721 DEBUG_ArrayIndex(DBG_ADDR * addr, DBG_ADDR * result, int index)
723 int size;
726 * Make sure that this really makes sense.
728 if( addr->type->type == DT_POINTER )
731 * Get the base type, so we know how much to index by.
733 size = DEBUG_GetObjectSize(addr->type->un.pointer.pointsto);
734 result->type = addr->type->un.pointer.pointsto;
735 result->off = (*(unsigned int*) (addr->off)) + size * index;
737 else if (addr->type->type == DT_ARRAY)
739 size = DEBUG_GetObjectSize(addr->type->un.array.basictype);
740 result->type = addr->type->un.array.basictype;
741 result->off = addr->off + size * (index - addr->type->un.array.start);
744 return TRUE;
747 /***********************************************************************
748 * DEBUG_Print
750 * Implementation of the 'print' command.
752 void
753 DEBUG_Print( const DBG_ADDR *addr, int count, char format, int level )
755 DBG_ADDR addr1;
756 int i;
757 struct member * m;
758 char * pnt;
759 int size;
760 long long int value;
762 if (count != 1)
764 fprintf( stderr, "Count other than 1 is meaningless in 'print' command\n" );
765 return;
768 if( addr->type == NULL )
770 /* No type, just print the addr value */
771 if (addr->seg && (addr->seg != 0xffffffff))
772 DEBUG_nchar += fprintf( stderr, "0x%04lx: ", addr->seg );
773 DEBUG_nchar += fprintf( stderr, "0x%08lx", addr->off );
774 goto leave;
777 if( level == 0 )
779 DEBUG_nchar = 0;
782 if( DEBUG_nchar > DEBUG_maxchar )
784 fprintf(stderr, "...");
785 goto leave;
788 if( format == 'i' || format == 's' || format == 'w' || format == 'b' )
790 fprintf( stderr, "Format specifier '%c' is meaningless in 'print' command\n", format );
791 format = '\0';
794 switch(addr->type->type)
796 case DT_BASIC:
797 case DT_ENUM:
798 case DT_CONST:
799 case DT_POINTER:
800 DEBUG_PrintBasic(addr, 1, format);
801 break;
802 case DT_STRUCT:
803 DEBUG_nchar += fprintf(stderr, "{");
804 for(m = addr->type->un.structure.members; m; m = m->next)
806 addr1 = *addr;
807 DEBUG_FindStructElement(&addr1, m->name,
808 (int *) &value);
809 DEBUG_nchar += fprintf(stderr, "%s=", m->name);
810 DEBUG_Print(&addr1, 1, format, level + 1);
811 if( m->next != NULL )
813 DEBUG_nchar += fprintf(stderr, ", ");
815 if( DEBUG_nchar > DEBUG_maxchar )
817 fprintf(stderr, "...}");
818 goto leave;
821 DEBUG_nchar += fprintf(stderr, "}");
822 break;
823 case DT_ARRAY:
825 * Loop over all of the entries, printing stuff as we go.
827 size = DEBUG_GetObjectSize(addr->type->un.array.basictype);
828 if( size == 1 )
831 * Special handling for character arrays.
833 pnt = (char *) addr->off;
834 DEBUG_nchar += fprintf(stderr, "\"");
835 for( i=addr->type->un.array.start; i < addr->type->un.array.end; i++ )
837 fputc(*pnt++, stderr);
838 DEBUG_nchar++;
839 if( DEBUG_nchar > DEBUG_maxchar )
841 fprintf(stderr, "...\"");
842 goto leave;
845 DEBUG_nchar += fprintf(stderr, "\"");
846 break;
848 addr1 = *addr;
849 addr1.type = addr->type->un.array.basictype;
850 DEBUG_nchar += fprintf(stderr, "{");
851 for( i=addr->type->un.array.start; i <= addr->type->un.array.end; i++ )
853 DEBUG_Print(&addr1, 1, format, level + 1);
854 addr1.off += size;
855 if( i == addr->type->un.array.end )
857 DEBUG_nchar += fprintf(stderr, "}");
859 else
861 DEBUG_nchar += fprintf(stderr, ", ");
863 if( DEBUG_nchar > DEBUG_maxchar )
865 fprintf(stderr, "...}");
866 goto leave;
869 break;
870 default:
871 assert(FALSE);
872 break;
875 leave:
877 if( level == 0 )
879 DEBUG_nchar += fprintf(stderr, "\n");
881 return;
885 DEBUG_DumpTypes()
887 struct datatype * dt = NULL;
888 struct member * m;
889 int hash;
890 int nm;
891 char * name;
892 char * member_name;
894 for(hash = 0; hash < NR_TYPE_HASH + 1; hash++)
896 for( dt = type_hash_table[hash]; dt; dt = dt->next )
898 name = "none";
899 if( dt->name != NULL )
901 name = dt->name;
903 switch(dt->type)
905 case DT_BASIC:
906 fprintf(stderr, "0x%p - BASIC(%s)\n",
907 dt, name);
908 break;
909 case DT_POINTER:
910 fprintf(stderr, "0x%p - POINTER(%s)(%p)\n",
911 dt, name, dt->un.pointer.pointsto);
912 break;
913 case DT_STRUCT:
914 member_name = "none";
915 nm = 0;
916 if( dt->un.structure.members != NULL
917 && dt->un.structure.members->name != NULL )
919 member_name = dt->un.structure.members->name;
920 for( m = dt->un.structure.members; m; m = m->next)
922 nm++;
925 fprintf(stderr, "0x%p - STRUCT(%s) %d %d %s\n", dt, name,
926 dt->un.structure.size, nm, member_name);
927 break;
928 case DT_ARRAY:
929 fprintf(stderr, "0x%p - ARRAY(%s)(%p)\n",
930 dt, name, dt->un.array.basictype);
931 break;
932 case DT_ENUM:
933 fprintf(stderr, "0x%p - ENUM(%s)\n",
934 dt, name);
935 break;
936 case DT_BITFIELD:
937 fprintf(stderr, "0x%p - BITFIELD(%s)\n", dt, name);
938 break;
939 case DT_FUNC:
940 fprintf(stderr, "0x%p - FUNC(%s)(%p)\n",
941 dt, name, dt->un.funct.rettype);
942 break;
943 case DT_CONST:
944 case DT_TYPEDEF:
945 fprintf(stderr, "What???\n");
946 break;
950 return TRUE;
954 enum debug_type DEBUG_GetType(struct datatype * dt)
956 return dt->type;
959 struct datatype *
960 DEBUG_TypeCast(enum debug_type type, const char * name)
962 int hash;
963 struct datatype * rtn;
966 * The last bucket is special, and is used to hold typeless names.
968 if( name == NULL )
970 hash = NR_TYPE_HASH;
972 else
974 hash = type_hash(name);
977 rtn = DEBUG_LookupDataType(type, hash, name);
979 return rtn;
984 DEBUG_PrintTypeCast(struct datatype * dt)
986 char * name;
988 name = "none";
989 if( dt->name != NULL )
991 name = dt->name;
994 switch(dt->type)
996 case DT_BASIC:
997 fprintf(stderr, "%s", name);
998 break;
999 case DT_POINTER:
1000 DEBUG_PrintTypeCast(dt->un.pointer.pointsto);
1001 fprintf(stderr, "*");
1002 break;
1003 case DT_STRUCT:
1004 fprintf(stderr, "struct %s", name);
1005 break;
1006 case DT_ARRAY:
1007 fprintf(stderr, "%s[]", name);
1008 break;
1009 case DT_ENUM:
1010 fprintf(stderr, "enum %s", name);
1011 break;
1012 case DT_BITFIELD:
1013 fprintf(stderr, "unsigned %s", name);
1014 break;
1015 case DT_FUNC:
1016 DEBUG_PrintTypeCast(dt->un.funct.rettype);
1017 fprintf(stderr, "(*%s)()", name);
1018 break;
1019 case DT_CONST:
1020 case DT_TYPEDEF:
1021 fprintf(stderr, "What???\n");
1022 break;
1025 return TRUE;