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
);
84 if (size
> sizeof(rtn
))
86 WINE_ERR("Size too large (%s)\n", wine_dbgstr_longlong(size
));
87 RaiseException(DEBUG_STATUS_NOT_AN_INTEGER
, 0, 0, NULL
);
93 if (!be_cpu
->fetch_integer(lvalue
, (unsigned)size
, s
= TRUE
, &rtn
))
94 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
97 if (!be_cpu
->fetch_integer(lvalue
, (unsigned)size
, s
= FALSE
, &rtn
))
98 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
101 RaiseException(DEBUG_STATUS_NOT_AN_INTEGER
, 0, 0, NULL
);
103 if (psize
) *psize
= (unsigned)size
;
104 if (issigned
) *issigned
= s
;
106 case SymTagPointerType
:
107 if (!be_cpu
->fetch_integer(lvalue
, sizeof(void*), s
= FALSE
, &rtn
))
108 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
110 case SymTagArrayType
:
112 if (!be_cpu
->fetch_integer(lvalue
, sizeof(unsigned), s
= FALSE
, &rtn
))
113 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
116 /* FIXME: we don't handle enum size */
117 if (!be_cpu
->fetch_integer(lvalue
, sizeof(unsigned), s
= FALSE
, &rtn
))
118 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
120 case SymTagFunctionType
:
121 rtn
= (ULONG_PTR
)memory_to_linear_addr(&lvalue
->addr
);
124 WINE_FIXME("Unsupported tag %u\n", tag
);
125 RaiseException(DEBUG_STATUS_NOT_AN_INTEGER
, 0, 0, NULL
);
132 /******************************************************************
133 * types_extract_as_integer
135 * Given a lvalue, try to get an integral (or pointer/address) value
138 long int types_extract_as_integer(const struct dbg_lvalue
* lvalue
)
140 return types_extract_as_longlong(lvalue
, NULL
, NULL
);
143 /******************************************************************
144 * types_extract_as_address
148 void types_extract_as_address(const struct dbg_lvalue
* lvalue
, ADDRESS64
* addr
)
150 if (lvalue
->type
.id
== dbg_itype_segptr
&& lvalue
->type
.module
== 0)
152 *addr
= lvalue
->addr
;
156 addr
->Mode
= AddrModeFlat
;
157 addr
->Offset
= types_extract_as_longlong(lvalue
, NULL
, NULL
);
161 BOOL
types_store_value(struct dbg_lvalue
* lvalue_to
, const struct dbg_lvalue
* lvalue_from
)
167 if (!types_get_info(&lvalue_to
->type
, TI_GET_LENGTH
, &size
)) return FALSE
;
168 if (sizeof(val
) < size
)
170 dbg_printf("Unsufficient size\n");
173 /* FIXME: should support floats as well */
174 val
= types_extract_as_longlong(lvalue_from
, NULL
, &is_signed
);
175 return be_cpu
->store_integer(lvalue_to
, size
, is_signed
, val
);
178 /******************************************************************
179 * types_get_udt_element_lvalue
181 * Implement a structure derefencement
183 static BOOL
types_get_udt_element_lvalue(struct dbg_lvalue
* lvalue
,
184 const struct dbg_type
* type
, long int* tmpbuf
)
186 DWORD offset
, bitoffset
;
192 types_get_info(type
, TI_GET_TYPE
, &lvalue
->type
.id
);
193 lvalue
->type
.module
= type
->module
;
194 if (!types_get_info(type
, TI_GET_OFFSET
, &offset
)) return FALSE
;
195 lvalue
->addr
.Offset
+= offset
;
197 if (types_get_info(type
, TI_GET_BITPOSITION
, &bitoffset
))
199 types_get_info(type
, TI_GET_LENGTH
, &length
);
200 /* FIXME: this test isn't sufficient, depending on start of bitfield
201 * (ie a 32 bit field can spread across 5 bytes)
203 if (length
> 8 * sizeof(*tmpbuf
)) return FALSE
;
204 lvalue
->addr
.Offset
+= bitoffset
>> 3;
206 * Bitfield operation. We have to extract the field and store
207 * it in a temporary buffer so that we get it all right.
209 if (!memory_read_value(lvalue
, sizeof(*tmpbuf
), tmpbuf
)) return FALSE
;
210 mask
= 0xffffffff << (DWORD
)length
;
211 *tmpbuf
>>= bitoffset
& 7;
214 lvalue
->cookie
= DLV_HOST
;
215 lvalue
->addr
.Offset
= (ULONG_PTR
)tmpbuf
;
218 * OK, now we have the correct part of the number.
219 * Check to see whether the basic type is signed or not, and if so,
220 * we need to sign extend the number.
222 if (types_get_info(&lvalue
->type
, TI_GET_BASETYPE
, &bt
) &&
223 bt
== btInt
&& (*tmpbuf
& (1 << ((DWORD
)length
- 1))))
230 if (!memory_read_value(lvalue
, sizeof(*tmpbuf
), tmpbuf
)) return FALSE
;
235 /******************************************************************
236 * types_udt_find_element
239 BOOL
types_udt_find_element(struct dbg_lvalue
* lvalue
, const char* name
, long int* tmpbuf
)
242 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
243 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
246 struct dbg_type type
;
248 if (!types_get_real_type(&lvalue
->type
, &tag
) || tag
!= SymTagUDT
)
251 if (types_get_info(&lvalue
->type
, TI_GET_CHILDRENCOUNT
, &count
))
256 fcp
->Count
= min(count
, 256);
257 if (types_get_info(&lvalue
->type
, TI_FINDCHILDREN
, fcp
))
260 type
.module
= lvalue
->type
.module
;
261 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
264 type
.id
= fcp
->ChildId
[i
];
265 types_get_info(&type
, TI_GET_SYMNAME
, &ptr
);
267 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
268 HeapFree(GetProcessHeap(), 0, ptr
);
269 if (strcmp(tmp
, name
)) continue;
271 return types_get_udt_element_lvalue(lvalue
, &type
, tmpbuf
);
274 count
-= min(count
, 256);
281 /******************************************************************
284 * Grab an element from an array
286 BOOL
types_array_index(const struct dbg_lvalue
* lvalue
, int index
, struct dbg_lvalue
* result
)
288 struct dbg_type type
= lvalue
->type
;
291 memset(result
, 0, sizeof(*result
));
292 result
->type
.id
= dbg_itype_none
;
293 result
->type
.module
= 0;
295 if (!types_get_real_type(&type
, &tag
)) return FALSE
;
298 case SymTagArrayType
:
299 if (!types_get_info(&type
, TI_GET_COUNT
, &count
)) return FALSE
;
300 if (index
< 0 || index
>= count
) return FALSE
;
301 result
->addr
= lvalue
->addr
;
303 case SymTagPointerType
:
304 if (!memory_read_value(lvalue
, be_cpu
->pointer_size
, &result
->addr
.Offset
)) return FALSE
;
305 result
->addr
.Mode
= AddrModeFlat
;
306 switch (be_cpu
->pointer_size
)
308 case 4: result
->addr
.Offset
= (DWORD
)result
->addr
.Offset
; break;
317 * Get the base type, so we know how much to index by.
319 if (!types_get_info(&type
, TI_GET_TYPE
, &result
->type
.id
)) return FALSE
;
320 result
->type
.module
= type
.module
;
324 if (!types_get_info(&result
->type
, TI_GET_LENGTH
, &length
)) return FALSE
;
325 result
->addr
.Offset
+= index
* (DWORD
)length
;
327 /* FIXME: the following statement is not always true (and can lead to buggy behavior).
328 * There is no way to tell were the deref:ed value is...
330 * x is a pointer to struct s, x being on the stack
331 * => lvalue is in debuggee, result is in debugger
332 * x is a pointer to struct s, x being optimized into a reg
333 * => lvalue is debugger, result is debuggee
334 * x is a pointer to internal variable x
335 * => lvalue is debugger, result is debuggee
336 * So we always force debuggee address space, because dereferencing pointers to
337 * internal variables is very unlikely. A correct fix would be
340 result
->cookie
= DLV_TARGET
;
346 unsigned long result
; /* out: the found type */
347 enum SymTagEnum tag
; /* in: the tag to look for */
350 unsigned long typeid; /* when tag is SymTagUDT */
351 const char* name
; /* when tag is SymTagPointerType */
355 static BOOL CALLBACK
types_cb(PSYMBOL_INFO sym
, ULONG size
, void* _user
)
357 struct type_find_t
* user
= _user
;
359 struct dbg_type type
;
362 if (sym
->Tag
== user
->tag
)
367 if (!strcmp(user
->u
.name
, sym
->Name
))
369 user
->result
= sym
->TypeIndex
;
373 case SymTagPointerType
:
374 type
.module
= sym
->ModBase
;
375 type
.id
= sym
->TypeIndex
;
376 if (types_get_info(&type
, TI_GET_TYPE
, &type_id
) && type_id
== user
->u
.typeid)
378 user
->result
= sym
->TypeIndex
;
388 /******************************************************************
391 * Should look up in module based at linear whether (typeid*) exists
392 * Otherwise, we could create it locally
394 struct dbg_type
types_find_pointer(const struct dbg_type
* type
)
396 struct type_find_t f
;
399 f
.result
= dbg_itype_none
;
400 f
.tag
= SymTagPointerType
;
401 f
.u
.typeid = type
->id
;
402 SymEnumTypes(dbg_curr_process
->handle
, type
->module
, types_cb
, &f
);
403 ret
.module
= type
->module
;
408 /******************************************************************
411 * Should look up in the module based at linear address whether a type
412 * named 'name' and with the correct tag exists
414 struct dbg_type
types_find_type(unsigned long linear
, const char* name
, enum SymTagEnum tag
)
417 struct type_find_t f
;
420 f
.result
= dbg_itype_none
;
423 SymEnumTypes(dbg_curr_process
->handle
, linear
, types_cb
, &f
);
429 /***********************************************************************
432 * Implementation of the 'print' command.
434 void print_value(const struct dbg_lvalue
* lvalue
, char format
, int level
)
436 struct dbg_type type
= lvalue
->type
;
437 struct dbg_lvalue lvalue_field
;
443 if (!types_get_real_type(&type
, &tag
))
445 WINE_FIXME("---error\n");
449 if (type
.id
== dbg_itype_none
)
451 /* No type, just print the addr value */
452 print_bare_address(&lvalue
->addr
);
456 if (format
== 'i' || format
== 's' || format
== 'w' || format
== 'b' || format
== 'g')
458 dbg_printf("Format specifier '%c' is meaningless in 'print' command\n", format
);
466 case SymTagPointerType
:
467 /* FIXME: this in not 100% optimal (as we're going through the typedef handling
470 print_basic(lvalue
, format
);
473 if (types_get_info(&type
, TI_GET_CHILDRENCOUNT
, &count
))
475 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
476 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
480 struct dbg_type sub_type
;
486 fcp
->Count
= min(count
, 256);
487 if (types_get_info(&type
, TI_FINDCHILDREN
, fcp
))
489 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
492 sub_type
.module
= type
.module
;
493 sub_type
.id
= fcp
->ChildId
[i
];
494 types_get_info(&sub_type
, TI_GET_SYMNAME
, &ptr
);
496 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
497 dbg_printf("%s=", tmp
);
498 HeapFree(GetProcessHeap(), 0, ptr
);
499 lvalue_field
= *lvalue
;
500 if (types_get_udt_element_lvalue(&lvalue_field
, &sub_type
, &tmpbuf
))
502 print_value(&lvalue_field
, format
, level
+ 1);
504 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
507 count
-= min(count
, 256);
513 case SymTagArrayType
:
515 * Loop over all of the entries, printing stuff as we go.
518 types_get_info(&type
, TI_GET_COUNT
, &count
);
519 types_get_info(&type
, TI_GET_LENGTH
, &size
);
526 * Special handling for character arrays.
528 /* FIXME should check basic type here (should be a char!!!!)... */
529 len
= min(count
, sizeof(buffer
));
530 memory_get_string(dbg_curr_process
,
531 memory_to_linear_addr(&lvalue
->addr
),
532 lvalue
->cookie
== DLV_TARGET
, TRUE
, buffer
, len
);
533 dbg_printf("\"%s%s\"", buffer
, (len
< count
) ? "..." : "");
536 lvalue_field
= *lvalue
;
537 types_get_info(&type
, TI_GET_TYPE
, &lvalue_field
.type
.id
);
539 for (i
= 0; i
< count
; i
++)
541 print_value(&lvalue_field
, format
, level
+ 1);
542 lvalue_field
.addr
.Offset
+= size
/ count
;
543 dbg_printf((i
== count
- 1) ? "}" : ", ");
546 case SymTagFunctionType
:
547 dbg_printf("Function ");
548 print_bare_address(&lvalue
->addr
);
550 types_print_type(&type
, FALSE
);
553 lvalue_field
= *lvalue
;
554 types_get_info(&lvalue
->type
, TI_GET_TYPE
, &lvalue_field
.type
.id
);
555 print_value(&lvalue_field
, format
, level
);
558 WINE_FIXME("Unknown tag (%u)\n", tag
);
559 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
565 if (level
== 0) dbg_printf("\n");
568 static BOOL CALLBACK
print_types_cb(PSYMBOL_INFO sym
, ULONG size
, void* ctx
)
570 struct dbg_type type
;
571 type
.module
= sym
->ModBase
;
572 type
.id
= sym
->TypeIndex
;
573 dbg_printf("Mod: %08lx ID: %08lx\n", type
.module
, type
.id
);
574 types_print_type(&type
, TRUE
);
579 static BOOL CALLBACK
print_types_mod_cb(PCSTR mod_name
, DWORD64 base
, PVOID ctx
)
581 return SymEnumTypes(dbg_curr_process
->handle
, base
, print_types_cb
, ctx
);
584 BOOL
print_types(void)
586 if (!dbg_curr_process
)
588 dbg_printf("No known process, cannot print types\n");
591 SymEnumerateModules64(dbg_curr_process
->handle
, print_types_mod_cb
, NULL
);
595 BOOL
types_print_type(const struct dbg_type
* type
, BOOL details
)
600 DWORD tag
, udt
, count
;
601 struct dbg_type subtype
;
603 if (type
->id
== dbg_itype_none
|| !types_get_info(type
, TI_GET_SYMTAG
, &tag
))
605 dbg_printf("--invalid--<%lxh>--", type
->id
);
609 if (types_get_info(type
, TI_GET_SYMNAME
, &ptr
) && ptr
)
611 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
613 HeapFree(GetProcessHeap(), 0, ptr
);
615 else name
= "--none--";
620 if (details
) dbg_printf("Basic<%s>", name
); else dbg_printf("%s", name
);
622 case SymTagPointerType
:
623 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
624 subtype
.module
= type
->module
;
625 types_print_type(&subtype
, FALSE
);
629 types_get_info(type
, TI_GET_UDTKIND
, &udt
);
632 case UdtStruct
: dbg_printf("struct %s", name
); break;
633 case UdtUnion
: dbg_printf("union %s", name
); break;
634 case UdtClass
: dbg_printf("class %s", name
); break;
635 default: WINE_ERR("Unsupported UDT type (%d) for %s\n", udt
, name
); break;
638 types_get_info(type
, TI_GET_CHILDRENCOUNT
, &count
))
640 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
641 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
645 struct dbg_type type_elt
;
651 fcp
->Count
= min(count
, 256);
652 if (types_get_info(type
, TI_FINDCHILDREN
, fcp
))
654 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
657 type_elt
.module
= type
->module
;
658 type_elt
.id
= fcp
->ChildId
[i
];
659 types_get_info(&type_elt
, TI_GET_SYMNAME
, &ptr
);
661 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
662 HeapFree(GetProcessHeap(), 0, ptr
);
663 dbg_printf("%s", tmp
);
664 if (types_get_info(&type_elt
, TI_GET_TYPE
, &type_elt
.id
))
667 types_print_type(&type_elt
, details
);
669 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
672 count
-= min(count
, 256);
678 case SymTagArrayType
:
679 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
680 subtype
.module
= type
->module
;
681 types_print_type(&subtype
, details
);
682 if (types_get_info(type
, TI_GET_COUNT
, &count
))
683 dbg_printf(" %s[%d]", name
, count
);
685 dbg_printf(" %s[]", name
);
688 dbg_printf("enum %s", name
);
690 case SymTagFunctionType
:
691 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
692 /* is the returned type the same object as function sig itself ? */
693 if (subtype
.id
!= type
->id
)
695 subtype
.module
= type
->module
;
696 types_print_type(&subtype
, FALSE
);
700 dbg_printf("<ret_type=self>");
702 dbg_printf(" (*%s)(", name
);
703 if (types_get_info(type
, TI_GET_CHILDRENCOUNT
, &count
))
705 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
706 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
710 if (!count
) dbg_printf("void");
713 fcp
->Count
= min(count
, 256);
714 if (types_get_info(type
, TI_FINDCHILDREN
, fcp
))
716 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
718 subtype
.id
= fcp
->ChildId
[i
];
719 types_get_info(&subtype
, TI_GET_TYPE
, &subtype
.id
);
720 types_print_type(&subtype
, FALSE
);
721 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
724 count
-= min(count
, 256);
731 dbg_printf("%s", name
);
734 WINE_ERR("Unknown type %u for %s\n", tag
, name
);
741 /* helper to typecast pInfo to its expected type (_t) */
742 #define X(_t) (*((_t*)pInfo))
744 BOOL
types_get_info(const struct dbg_type
* type
, IMAGEHLP_SYMBOL_TYPE_INFO ti
, void* pInfo
)
746 if (type
->id
== dbg_itype_none
) return FALSE
;
747 if (type
->module
!= 0)
750 ret
= SymGetTypeInfo(dbg_curr_process
->handle
, type
->module
, type
->id
, ti
, pInfo
);
752 SymGetTypeInfo(dbg_curr_process
->handle
, type
->module
, type
->id
, TI_GET_SYMTAG
, &tag
) &&
753 tag
== SymTagBaseType
&&
754 SymGetTypeInfo(dbg_curr_process
->handle
, type
->module
, type
->id
, TI_GET_BASETYPE
, &bt
))
756 static const WCHAR voidW
[] = {'v','o','i','d','\0'};
757 static const WCHAR charW
[] = {'c','h','a','r','\0'};
758 static const WCHAR wcharW
[] = {'W','C','H','A','R','\0'};
759 static const WCHAR intW
[] = {'i','n','t','\0'};
760 static const WCHAR uintW
[] = {'u','n','s','i','g','n','e','d',' ','i','n','t','\0'};
761 static const WCHAR floatW
[] = {'f','l','o','a','t','\0'};
762 static const WCHAR boolW
[] = {'b','o','o','l','\0'};
763 static const WCHAR longW
[] = {'l','o','n','g',' ','i','n','t','\0'};
764 static const WCHAR ulongW
[] = {'u','n','s','i','g','n','e','d',' ','l','o','n','g',' ','i','n','t','\0'};
765 static const WCHAR complexW
[] = {'c','o','m','p','l','e','x','\0'};
766 const WCHAR
* name
= NULL
;
770 case btVoid
: name
= voidW
; break;
771 case btChar
: name
= charW
; break;
772 case btWChar
: name
= wcharW
; break;
773 case btInt
: name
= intW
; break;
774 case btUInt
: name
= uintW
; break;
775 case btFloat
: name
= floatW
; break;
776 case btBool
: name
= boolW
; break;
777 case btLong
: name
= longW
; break;
778 case btULong
: name
= ulongW
; break;
779 case btComplex
: name
= complexW
; break;
780 default: WINE_FIXME("Unsupported basic type %u\n", bt
); return FALSE
;
782 X(WCHAR
*) = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(name
) + 1) * sizeof(WCHAR
));
785 lstrcpyW(X(WCHAR
*), name
);
792 assert(type
->id
>= dbg_itype_first
);
796 case dbg_itype_unsigned_long_int
:
799 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
800 case TI_GET_LENGTH
: X(DWORD64
) = ADDRSIZE
; break;
801 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
802 default: WINE_FIXME("unsupported %u for u-long int\n", ti
); return FALSE
;
805 case dbg_itype_signed_long_int
:
808 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
809 case TI_GET_LENGTH
: X(DWORD64
) = ADDRSIZE
; break;
810 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
811 default: WINE_FIXME("unsupported %u for s-long int\n", ti
); return FALSE
;
814 case dbg_itype_unsigned_int
:
817 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
818 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
819 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
820 default: WINE_FIXME("unsupported %u for u-int\n", ti
); return FALSE
;
823 case dbg_itype_signed_int
:
826 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
827 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
828 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
829 default: WINE_FIXME("unsupported %u for s-int\n", ti
); return FALSE
;
832 case dbg_itype_unsigned_short_int
:
835 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
836 case TI_GET_LENGTH
: X(DWORD64
) = 2; break;
837 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
838 default: WINE_FIXME("unsupported %u for u-short int\n", ti
); return FALSE
;
841 case dbg_itype_signed_short_int
:
844 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
845 case TI_GET_LENGTH
: X(DWORD64
) = 2; break;
846 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
847 default: WINE_FIXME("unsupported %u for s-short int\n", ti
); return FALSE
;
850 case dbg_itype_unsigned_char_int
:
853 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
854 case TI_GET_LENGTH
: X(DWORD64
) = 1; break;
855 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
856 default: WINE_FIXME("unsupported %u for u-char int\n", ti
); return FALSE
;
859 case dbg_itype_signed_char_int
:
862 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
863 case TI_GET_LENGTH
: X(DWORD64
) = 1; break;
864 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
865 default: WINE_FIXME("unsupported %u for s-char int\n", ti
); return FALSE
;
871 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
872 case TI_GET_LENGTH
: X(DWORD64
) = 1; break;
873 case TI_GET_BASETYPE
: X(DWORD
) = btChar
; break;
874 default: WINE_FIXME("unsupported %u for char int\n", ti
); return FALSE
;
877 case dbg_itype_astring
:
880 case TI_GET_SYMTAG
: X(DWORD
) = SymTagPointerType
; break;
881 case TI_GET_LENGTH
: X(DWORD64
) = ADDRSIZE
; break;
882 case TI_GET_TYPE
: X(DWORD
) = dbg_itype_char
; break;
883 default: WINE_FIXME("unsupported %u for a string\n", ti
); return FALSE
;
886 case dbg_itype_segptr
:
889 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
890 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
891 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
892 default: WINE_FIXME("unsupported %u for seg-ptr\n", ti
); return FALSE
;
895 default: WINE_FIXME("unsupported type id 0x%lx\n", type
->id
);