2 * File types.c - datatype handling stuff for internal debugger.
4 * Copyright (C) 1997, Eric Youngdale.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library 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 GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 * Note: This really doesn't do much at the moment, but it forms the framework
21 * upon which full support for datatype handling will eventually be built.
28 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(winedbg
);
32 /******************************************************************
35 * Get rid of any potential typedef in the lvalue's type to get
36 * to the 'real' type (the one we can work upon).
38 BOOL
types_get_real_type(struct dbg_type
* type
, DWORD
* tag
)
40 if (type
->id
== dbg_itype_none
) return FALSE
;
43 if (!types_get_info(type
, TI_GET_SYMTAG
, tag
))
45 if (*tag
!= SymTagTypedef
) return TRUE
;
46 } while (types_get_info(type
, TI_GET_TYPE
, &type
->id
));
50 /******************************************************************
51 * types_extract_as_longlong
53 * Given a lvalue, try to get an integral (or pointer/address) value
56 LONGLONG
types_extract_as_longlong(const struct dbg_lvalue
* lvalue
,
57 unsigned* psize
, BOOL
*issigned
)
62 struct dbg_type type
= lvalue
->type
;
65 if (!types_get_real_type(&type
, &tag
))
66 RaiseException(DEBUG_STATUS_NOT_AN_INTEGER
, 0, 0, NULL
);
68 if (type
.id
== dbg_itype_segptr
)
70 return (LONG_PTR
)memory_to_linear_addr(&lvalue
->addr
);
73 if (psize
) *psize
= 0;
74 if (issigned
) *issigned
= FALSE
;
78 if (!types_get_info(&type
, TI_GET_LENGTH
, &size
) ||
79 !types_get_info(&type
, TI_GET_BASETYPE
, &bt
))
81 WINE_ERR("Couldn't get information\n");
82 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
85 if (size
> sizeof(rtn
))
87 WINE_ERR("Size too large (%s)\n", wine_dbgstr_longlong(size
));
88 RaiseException(DEBUG_STATUS_NOT_AN_INTEGER
, 0, 0, NULL
);
95 if (!dbg_curr_process
->be_cpu
->fetch_integer(lvalue
, (unsigned)size
, s
= TRUE
, &rtn
))
96 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
99 if (!dbg_curr_process
->be_cpu
->fetch_integer(lvalue
, (unsigned)size
, s
= FALSE
, &rtn
))
100 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
103 RaiseException(DEBUG_STATUS_NOT_AN_INTEGER
, 0, 0, NULL
);
105 if (psize
) *psize
= (unsigned)size
;
106 if (issigned
) *issigned
= s
;
108 case SymTagPointerType
:
109 if (!dbg_curr_process
->be_cpu
->fetch_integer(lvalue
, sizeof(void*), s
= FALSE
, &rtn
))
110 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
112 case SymTagArrayType
:
114 if (!dbg_curr_process
->be_cpu
->fetch_integer(lvalue
, sizeof(unsigned), s
= FALSE
, &rtn
))
115 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
118 /* FIXME: we don't handle enum size */
119 if (!dbg_curr_process
->be_cpu
->fetch_integer(lvalue
, sizeof(unsigned), s
= FALSE
, &rtn
))
120 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
122 case SymTagFunctionType
:
123 rtn
= (ULONG_PTR
)memory_to_linear_addr(&lvalue
->addr
);
126 WINE_FIXME("Unsupported tag %u\n", tag
);
127 RaiseException(DEBUG_STATUS_NOT_AN_INTEGER
, 0, 0, NULL
);
133 /******************************************************************
134 * types_extract_as_integer
136 * Given a lvalue, try to get an integral (or pointer/address) value
139 long int types_extract_as_integer(const struct dbg_lvalue
* lvalue
)
141 return types_extract_as_longlong(lvalue
, NULL
, NULL
);
144 /******************************************************************
145 * types_extract_as_address
149 void types_extract_as_address(const struct dbg_lvalue
* lvalue
, ADDRESS64
* addr
)
151 if (lvalue
->type
.id
== dbg_itype_segptr
&& lvalue
->type
.module
== 0)
153 *addr
= lvalue
->addr
;
157 addr
->Mode
= AddrModeFlat
;
158 addr
->Offset
= types_extract_as_longlong(lvalue
, NULL
, NULL
);
162 BOOL
types_store_value(struct dbg_lvalue
* lvalue_to
, const struct dbg_lvalue
* lvalue_from
)
168 if (!types_get_info(&lvalue_to
->type
, TI_GET_LENGTH
, &size
)) return FALSE
;
169 if (sizeof(val
) < size
)
171 dbg_printf("Insufficient size\n");
174 /* FIXME: should support floats as well */
175 val
= types_extract_as_longlong(lvalue_from
, NULL
, &is_signed
);
176 return dbg_curr_process
->be_cpu
->store_integer(lvalue_to
, size
, is_signed
, val
);
179 /******************************************************************
180 * types_get_udt_element_lvalue
182 * Implement a structure derefencement
184 static BOOL
types_get_udt_element_lvalue(struct dbg_lvalue
* lvalue
,
185 const struct dbg_type
* type
, long int* tmpbuf
)
187 DWORD offset
, bitoffset
;
193 types_get_info(type
, TI_GET_TYPE
, &lvalue
->type
.id
);
194 lvalue
->type
.module
= type
->module
;
195 if (!types_get_info(type
, TI_GET_OFFSET
, &offset
)) return FALSE
;
196 lvalue
->addr
.Offset
+= offset
;
198 if (types_get_info(type
, TI_GET_BITPOSITION
, &bitoffset
))
200 types_get_info(type
, TI_GET_LENGTH
, &length
);
201 /* FIXME: this test isn't sufficient, depending on start of bitfield
202 * (ie a 32 bit field can spread across 5 bytes)
204 if (length
> 8 * sizeof(*tmpbuf
)) return FALSE
;
205 lvalue
->addr
.Offset
+= bitoffset
>> 3;
207 * Bitfield operation. We have to extract the field and store
208 * it in a temporary buffer so that we get it all right.
210 if (!memory_read_value(lvalue
, sizeof(*tmpbuf
), tmpbuf
)) return FALSE
;
211 mask
= 0xffffffff << (DWORD
)length
;
212 *tmpbuf
>>= bitoffset
& 7;
215 lvalue
->cookie
= DLV_HOST
;
216 lvalue
->addr
.Offset
= (ULONG_PTR
)tmpbuf
;
219 * OK, now we have the correct part of the number.
220 * Check to see whether the basic type is signed or not, and if so,
221 * we need to sign extend the number.
223 if (types_get_info(&lvalue
->type
, TI_GET_BASETYPE
, &bt
) &&
224 bt
== btInt
&& (*tmpbuf
& (1 << ((DWORD
)length
- 1))))
231 if (!memory_read_value(lvalue
, sizeof(*tmpbuf
), tmpbuf
)) return FALSE
;
236 /******************************************************************
237 * types_udt_find_element
240 BOOL
types_udt_find_element(struct dbg_lvalue
* lvalue
, const char* name
, long int* tmpbuf
)
243 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
244 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
247 struct dbg_type type
;
249 if (!types_get_real_type(&lvalue
->type
, &tag
) || tag
!= SymTagUDT
)
252 if (types_get_info(&lvalue
->type
, TI_GET_CHILDRENCOUNT
, &count
))
257 fcp
->Count
= min(count
, 256);
258 if (types_get_info(&lvalue
->type
, TI_FINDCHILDREN
, fcp
))
261 type
.module
= lvalue
->type
.module
;
262 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
265 type
.id
= fcp
->ChildId
[i
];
266 types_get_info(&type
, TI_GET_SYMNAME
, &ptr
);
268 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
269 HeapFree(GetProcessHeap(), 0, ptr
);
270 if (strcmp(tmp
, name
)) continue;
272 return types_get_udt_element_lvalue(lvalue
, &type
, tmpbuf
);
275 count
-= min(count
, 256);
282 /******************************************************************
285 * Grab an element from an array
287 BOOL
types_array_index(const struct dbg_lvalue
* lvalue
, int index
, struct dbg_lvalue
* result
)
289 struct dbg_type type
= lvalue
->type
;
292 memset(result
, 0, sizeof(*result
));
293 result
->type
.id
= dbg_itype_none
;
294 result
->type
.module
= 0;
296 if (!types_get_real_type(&type
, &tag
)) return FALSE
;
299 case SymTagArrayType
:
300 if (!types_get_info(&type
, TI_GET_COUNT
, &count
)) return FALSE
;
301 if (index
< 0 || index
>= count
) return FALSE
;
302 result
->addr
= lvalue
->addr
;
304 case SymTagPointerType
:
305 if (!memory_read_value(lvalue
, dbg_curr_process
->be_cpu
->pointer_size
, &result
->addr
.Offset
))
307 result
->addr
.Mode
= AddrModeFlat
;
308 switch (dbg_curr_process
->be_cpu
->pointer_size
)
310 case 4: result
->addr
.Offset
= (DWORD
)result
->addr
.Offset
; break;
319 * Get the base type, so we know how much to index by.
321 if (!types_get_info(&type
, TI_GET_TYPE
, &result
->type
.id
)) return FALSE
;
322 result
->type
.module
= type
.module
;
326 if (!types_get_info(&result
->type
, TI_GET_LENGTH
, &length
)) return FALSE
;
327 result
->addr
.Offset
+= index
* (DWORD
)length
;
329 /* FIXME: the following statement is not always true (and can lead to buggy behavior).
330 * There is no way to tell where the deref:ed value is...
332 * x is a pointer to struct s, x being on the stack
333 * => lvalue is in debuggee, result is in debugger
334 * x is a pointer to struct s, x being optimized into a reg
335 * => lvalue is debugger, result is debuggee
336 * x is a pointer to internal variable x
337 * => lvalue is debugger, result is debuggee
338 * So we always force debuggee address space, because dereferencing pointers to
339 * internal variables is very unlikely. A correct fix would be
342 result
->cookie
= DLV_TARGET
;
348 unsigned long result
; /* out: the found type */
349 enum SymTagEnum tag
; /* in: the tag to look for */
352 unsigned long typeid; /* when tag is SymTagUDT */
353 const char* name
; /* when tag is SymTagPointerType */
357 static BOOL CALLBACK
types_cb(PSYMBOL_INFO sym
, ULONG size
, void* _user
)
359 struct type_find_t
* user
= _user
;
361 struct dbg_type type
;
364 if (sym
->Tag
== user
->tag
)
369 if (!strcmp(user
->u
.name
, sym
->Name
))
371 user
->result
= sym
->TypeIndex
;
375 case SymTagPointerType
:
376 type
.module
= sym
->ModBase
;
377 type
.id
= sym
->TypeIndex
;
378 if (types_get_info(&type
, TI_GET_TYPE
, &type_id
) && type_id
== user
->u
.typeid)
380 user
->result
= sym
->TypeIndex
;
390 /******************************************************************
393 * Should look up in module based at linear whether (typeid*) exists
394 * Otherwise, we could create it locally
396 struct dbg_type
types_find_pointer(const struct dbg_type
* type
)
398 struct type_find_t f
;
401 f
.result
= dbg_itype_none
;
402 f
.tag
= SymTagPointerType
;
403 f
.u
.typeid = type
->id
;
404 SymEnumTypes(dbg_curr_process
->handle
, type
->module
, types_cb
, &f
);
405 ret
.module
= type
->module
;
410 /******************************************************************
413 * Should look up in the module based at linear address whether a type
414 * named 'name' and with the correct tag exists
416 struct dbg_type
types_find_type(unsigned long linear
, const char* name
, enum SymTagEnum tag
)
419 struct type_find_t f
;
422 f
.result
= dbg_itype_none
;
425 SymEnumTypes(dbg_curr_process
->handle
, linear
, types_cb
, &f
);
431 /***********************************************************************
434 * Implementation of the 'print' command.
436 void print_value(const struct dbg_lvalue
* lvalue
, char format
, int level
)
438 struct dbg_type type
= lvalue
->type
;
439 struct dbg_lvalue lvalue_field
;
445 if (!types_get_real_type(&type
, &tag
))
447 WINE_FIXME("---error\n");
451 if (type
.id
== dbg_itype_none
)
453 /* No type, just print the addr value */
454 print_bare_address(&lvalue
->addr
);
458 if (format
== 'i' || format
== 's' || format
== 'w' || format
== 'b' || format
== 'g')
460 dbg_printf("Format specifier '%c' is meaningless in 'print' command\n", format
);
468 case SymTagPointerType
:
469 /* FIXME: this in not 100% optimal (as we're going through the typedef handling
472 print_basic(lvalue
, format
);
475 if (types_get_info(&type
, TI_GET_CHILDRENCOUNT
, &count
))
477 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
478 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
482 struct dbg_type sub_type
;
488 fcp
->Count
= min(count
, 256);
489 if (types_get_info(&type
, TI_FINDCHILDREN
, fcp
))
491 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
494 sub_type
.module
= type
.module
;
495 sub_type
.id
= fcp
->ChildId
[i
];
496 types_get_info(&sub_type
, TI_GET_SYMNAME
, &ptr
);
498 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
499 dbg_printf("%s=", tmp
);
500 HeapFree(GetProcessHeap(), 0, ptr
);
501 lvalue_field
= *lvalue
;
502 if (types_get_udt_element_lvalue(&lvalue_field
, &sub_type
, &tmpbuf
))
504 print_value(&lvalue_field
, format
, level
+ 1);
506 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
509 count
-= min(count
, 256);
515 case SymTagArrayType
:
517 * Loop over all of the entries, printing stuff as we go.
520 types_get_info(&type
, TI_GET_COUNT
, &count
);
521 types_get_info(&type
, TI_GET_LENGTH
, &size
);
528 * Special handling for character arrays.
530 /* FIXME should check basic type here (should be a char!!!!)... */
531 len
= min(count
, sizeof(buffer
));
532 memory_get_string(dbg_curr_process
,
533 memory_to_linear_addr(&lvalue
->addr
),
534 lvalue
->cookie
== DLV_TARGET
, TRUE
, buffer
, len
);
535 dbg_printf("\"%s%s\"", buffer
, (len
< count
) ? "..." : "");
538 lvalue_field
= *lvalue
;
539 types_get_info(&type
, TI_GET_TYPE
, &lvalue_field
.type
.id
);
541 for (i
= 0; i
< count
; i
++)
543 print_value(&lvalue_field
, format
, level
+ 1);
544 lvalue_field
.addr
.Offset
+= size
/ count
;
545 dbg_printf((i
== count
- 1) ? "}" : ", ");
548 case SymTagFunctionType
:
549 dbg_printf("Function ");
550 print_bare_address(&lvalue
->addr
);
552 types_print_type(&type
, FALSE
);
555 lvalue_field
= *lvalue
;
556 types_get_info(&lvalue
->type
, TI_GET_TYPE
, &lvalue_field
.type
.id
);
557 print_value(&lvalue_field
, format
, level
);
560 WINE_FIXME("Unknown tag (%u)\n", tag
);
561 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
567 if (level
== 0) dbg_printf("\n");
570 static BOOL CALLBACK
print_types_cb(PSYMBOL_INFO sym
, ULONG size
, void* ctx
)
572 struct dbg_type type
;
573 type
.module
= sym
->ModBase
;
574 type
.id
= sym
->TypeIndex
;
575 dbg_printf("Mod: %08lx ID: %08lx\n", type
.module
, type
.id
);
576 types_print_type(&type
, TRUE
);
581 static BOOL CALLBACK
print_types_mod_cb(PCSTR mod_name
, DWORD64 base
, PVOID ctx
)
583 return SymEnumTypes(dbg_curr_process
->handle
, base
, print_types_cb
, ctx
);
586 BOOL
print_types(void)
588 if (!dbg_curr_process
)
590 dbg_printf("No known process, cannot print types\n");
593 SymEnumerateModules64(dbg_curr_process
->handle
, print_types_mod_cb
, NULL
);
597 BOOL
types_print_type(const struct dbg_type
* type
, BOOL details
)
602 DWORD tag
, udt
, count
;
603 struct dbg_type subtype
;
605 if (type
->id
== dbg_itype_none
|| !types_get_info(type
, TI_GET_SYMTAG
, &tag
))
607 dbg_printf("--invalid--<%lxh>--", type
->id
);
611 if (types_get_info(type
, TI_GET_SYMNAME
, &ptr
) && ptr
)
613 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
615 HeapFree(GetProcessHeap(), 0, ptr
);
617 else name
= "--none--";
622 if (details
) dbg_printf("Basic<%s>", name
); else dbg_printf("%s", name
);
624 case SymTagPointerType
:
625 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
626 subtype
.module
= type
->module
;
627 types_print_type(&subtype
, FALSE
);
631 types_get_info(type
, TI_GET_UDTKIND
, &udt
);
634 case UdtStruct
: dbg_printf("struct %s", name
); break;
635 case UdtUnion
: dbg_printf("union %s", name
); break;
636 case UdtClass
: dbg_printf("class %s", name
); break;
637 default: WINE_ERR("Unsupported UDT type (%d) for %s\n", udt
, name
); break;
640 types_get_info(type
, TI_GET_CHILDRENCOUNT
, &count
))
642 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
643 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
647 struct dbg_type type_elt
;
653 fcp
->Count
= min(count
, 256);
654 if (types_get_info(type
, TI_FINDCHILDREN
, fcp
))
656 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
659 type_elt
.module
= type
->module
;
660 type_elt
.id
= fcp
->ChildId
[i
];
661 types_get_info(&type_elt
, TI_GET_SYMNAME
, &ptr
);
663 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
664 HeapFree(GetProcessHeap(), 0, ptr
);
665 dbg_printf("%s", tmp
);
666 if (types_get_info(&type_elt
, TI_GET_TYPE
, &type_elt
.id
))
669 types_print_type(&type_elt
, details
);
671 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
674 count
-= min(count
, 256);
680 case SymTagArrayType
:
681 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
682 subtype
.module
= type
->module
;
683 types_print_type(&subtype
, details
);
684 if (types_get_info(type
, TI_GET_COUNT
, &count
))
685 dbg_printf(" %s[%d]", name
, count
);
687 dbg_printf(" %s[]", name
);
690 dbg_printf("enum %s", name
);
692 case SymTagFunctionType
:
693 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
694 /* is the returned type the same object as function sig itself ? */
695 if (subtype
.id
!= type
->id
)
697 subtype
.module
= type
->module
;
698 types_print_type(&subtype
, FALSE
);
703 dbg_printf("<ret_type=self>");
705 dbg_printf(" (*%s)(", name
);
706 if (types_get_info(type
, TI_GET_CHILDRENCOUNT
, &count
))
708 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
709 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
713 if (!count
) dbg_printf("void");
716 fcp
->Count
= min(count
, 256);
717 if (types_get_info(type
, TI_FINDCHILDREN
, fcp
))
719 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
721 subtype
.id
= fcp
->ChildId
[i
];
722 types_get_info(&subtype
, TI_GET_TYPE
, &subtype
.id
);
723 types_print_type(&subtype
, FALSE
);
724 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
727 count
-= min(count
, 256);
734 dbg_printf("%s", name
);
737 WINE_ERR("Unknown type %u for %s\n", tag
, name
);
744 /* helper to typecast pInfo to its expected type (_t) */
745 #define X(_t) (*((_t*)pInfo))
747 BOOL
types_get_info(const struct dbg_type
* type
, IMAGEHLP_SYMBOL_TYPE_INFO ti
, void* pInfo
)
749 if (type
->id
== dbg_itype_none
) return FALSE
;
750 if (type
->module
!= 0)
753 ret
= SymGetTypeInfo(dbg_curr_process
->handle
, type
->module
, type
->id
, ti
, pInfo
);
755 SymGetTypeInfo(dbg_curr_process
->handle
, type
->module
, type
->id
, TI_GET_SYMTAG
, &tag
) &&
756 tag
== SymTagBaseType
&&
757 SymGetTypeInfo(dbg_curr_process
->handle
, type
->module
, type
->id
, TI_GET_BASETYPE
, &bt
))
759 static const WCHAR voidW
[] = {'v','o','i','d','\0'};
760 static const WCHAR charW
[] = {'c','h','a','r','\0'};
761 static const WCHAR wcharW
[] = {'W','C','H','A','R','\0'};
762 static const WCHAR intW
[] = {'i','n','t','\0'};
763 static const WCHAR uintW
[] = {'u','n','s','i','g','n','e','d',' ','i','n','t','\0'};
764 static const WCHAR floatW
[] = {'f','l','o','a','t','\0'};
765 static const WCHAR boolW
[] = {'b','o','o','l','\0'};
766 static const WCHAR longW
[] = {'l','o','n','g',' ','i','n','t','\0'};
767 static const WCHAR ulongW
[] = {'u','n','s','i','g','n','e','d',' ','l','o','n','g',' ','i','n','t','\0'};
768 static const WCHAR complexW
[] = {'c','o','m','p','l','e','x','\0'};
769 const WCHAR
* name
= NULL
;
773 case btVoid
: name
= voidW
; break;
774 case btChar
: name
= charW
; break;
775 case btWChar
: name
= wcharW
; break;
776 case btInt
: name
= intW
; break;
777 case btUInt
: name
= uintW
; break;
778 case btFloat
: name
= floatW
; break;
779 case btBool
: name
= boolW
; break;
780 case btLong
: name
= longW
; break;
781 case btULong
: name
= ulongW
; break;
782 case btComplex
: name
= complexW
; break;
783 default: WINE_FIXME("Unsupported basic type %u\n", bt
); return FALSE
;
785 X(WCHAR
*) = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(name
) + 1) * sizeof(WCHAR
));
788 lstrcpyW(X(WCHAR
*), name
);
795 assert(type
->id
>= dbg_itype_first
);
799 case dbg_itype_unsigned_long_int
:
802 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
803 case TI_GET_LENGTH
: X(DWORD64
) = ADDRSIZE
; break;
804 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
805 default: WINE_FIXME("unsupported %u for u-long int\n", ti
); return FALSE
;
808 case dbg_itype_signed_long_int
:
811 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
812 case TI_GET_LENGTH
: X(DWORD64
) = ADDRSIZE
; break;
813 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
814 default: WINE_FIXME("unsupported %u for s-long int\n", ti
); return FALSE
;
817 case dbg_itype_unsigned_int
:
820 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
821 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
822 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
823 default: WINE_FIXME("unsupported %u for u-int\n", ti
); return FALSE
;
826 case dbg_itype_signed_int
:
829 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
830 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
831 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
832 default: WINE_FIXME("unsupported %u for s-int\n", ti
); return FALSE
;
835 case dbg_itype_unsigned_short_int
:
838 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
839 case TI_GET_LENGTH
: X(DWORD64
) = 2; break;
840 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
841 default: WINE_FIXME("unsupported %u for u-short int\n", ti
); return FALSE
;
844 case dbg_itype_signed_short_int
:
847 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
848 case TI_GET_LENGTH
: X(DWORD64
) = 2; break;
849 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
850 default: WINE_FIXME("unsupported %u for s-short int\n", ti
); return FALSE
;
853 case dbg_itype_unsigned_char_int
:
856 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
857 case TI_GET_LENGTH
: X(DWORD64
) = 1; break;
858 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
859 default: WINE_FIXME("unsupported %u for u-char int\n", ti
); return FALSE
;
862 case dbg_itype_signed_char_int
:
865 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
866 case TI_GET_LENGTH
: X(DWORD64
) = 1; break;
867 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
868 default: WINE_FIXME("unsupported %u for s-char int\n", ti
); return FALSE
;
874 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
875 case TI_GET_LENGTH
: X(DWORD64
) = 1; break;
876 case TI_GET_BASETYPE
: X(DWORD
) = btChar
; break;
877 default: WINE_FIXME("unsupported %u for char int\n", ti
); return FALSE
;
880 case dbg_itype_astring
:
883 case TI_GET_SYMTAG
: X(DWORD
) = SymTagPointerType
; break;
884 case TI_GET_LENGTH
: X(DWORD64
) = ADDRSIZE
; break;
885 case TI_GET_TYPE
: X(DWORD
) = dbg_itype_char
; break;
886 default: WINE_FIXME("unsupported %u for a string\n", ti
); return FALSE
;
889 case dbg_itype_segptr
:
892 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
893 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
894 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
895 default: WINE_FIXME("unsupported %u for seg-ptr\n", ti
); return FALSE
;
898 case dbg_itype_short_real
:
901 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
902 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
903 case TI_GET_BASETYPE
: X(DWORD
) = btFloat
; break;
904 default: WINE_FIXME("unsupported %u for short real\n", ti
); return FALSE
;
910 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
911 case TI_GET_LENGTH
: X(DWORD64
) = 8; break;
912 case TI_GET_BASETYPE
: X(DWORD
) = btFloat
; break;
913 default: WINE_FIXME("unsupported %u for real\n", ti
); return FALSE
;
916 case dbg_itype_long_real
:
919 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
920 case TI_GET_LENGTH
: X(DWORD64
) = 10; break;
921 case TI_GET_BASETYPE
: X(DWORD
) = btFloat
; break;
922 default: WINE_FIXME("unsupported %u for long real\n", ti
); return FALSE
;
925 case dbg_itype_m128a
:
928 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
929 case TI_GET_LENGTH
: X(DWORD64
) = 16; break;
930 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
931 default: WINE_FIXME("unsupported %u for XMM register\n", ti
); return FALSE
;
934 default: WINE_FIXME("unsupported type id 0x%lx\n", type
->id
);