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
);
131 /******************************************************************
132 * types_extract_as_integer
134 * Given a lvalue, try to get an integral (or pointer/address) value
137 long int types_extract_as_integer(const struct dbg_lvalue
* lvalue
)
139 return types_extract_as_longlong(lvalue
, NULL
, NULL
);
142 /******************************************************************
143 * types_extract_as_address
147 void types_extract_as_address(const struct dbg_lvalue
* lvalue
, ADDRESS64
* addr
)
149 if (lvalue
->type
.id
== dbg_itype_segptr
&& lvalue
->type
.module
== 0)
151 *addr
= lvalue
->addr
;
155 addr
->Mode
= AddrModeFlat
;
156 addr
->Offset
= types_extract_as_longlong(lvalue
, NULL
, NULL
);
160 BOOL
types_store_value(struct dbg_lvalue
* lvalue_to
, const struct dbg_lvalue
* lvalue_from
)
166 if (!types_get_info(&lvalue_to
->type
, TI_GET_LENGTH
, &size
)) return FALSE
;
167 if (sizeof(val
) < size
)
169 dbg_printf("Unsufficient size\n");
172 /* FIXME: should support floats as well */
173 val
= types_extract_as_longlong(lvalue_from
, NULL
, &is_signed
);
174 return be_cpu
->store_integer(lvalue_to
, size
, is_signed
, val
);
177 /******************************************************************
178 * types_get_udt_element_lvalue
180 * Implement a structure derefencement
182 static BOOL
types_get_udt_element_lvalue(struct dbg_lvalue
* lvalue
,
183 const struct dbg_type
* type
, long int* tmpbuf
)
185 DWORD offset
, bitoffset
;
191 types_get_info(type
, TI_GET_TYPE
, &lvalue
->type
.id
);
192 lvalue
->type
.module
= type
->module
;
193 if (!types_get_info(type
, TI_GET_OFFSET
, &offset
)) return FALSE
;
194 lvalue
->addr
.Offset
+= offset
;
196 if (types_get_info(type
, TI_GET_BITPOSITION
, &bitoffset
))
198 types_get_info(type
, TI_GET_LENGTH
, &length
);
199 /* FIXME: this test isn't sufficient, depending on start of bitfield
200 * (ie a 32 bit field can spread across 5 bytes)
202 if (length
> 8 * sizeof(*tmpbuf
)) return FALSE
;
203 lvalue
->addr
.Offset
+= bitoffset
>> 3;
205 * Bitfield operation. We have to extract the field and store
206 * it in a temporary buffer so that we get it all right.
208 if (!memory_read_value(lvalue
, sizeof(*tmpbuf
), tmpbuf
)) return FALSE
;
209 mask
= 0xffffffff << (DWORD
)length
;
210 *tmpbuf
>>= bitoffset
& 7;
213 lvalue
->cookie
= DLV_HOST
;
214 lvalue
->addr
.Offset
= (ULONG_PTR
)tmpbuf
;
217 * OK, now we have the correct part of the number.
218 * Check to see whether the basic type is signed or not, and if so,
219 * we need to sign extend the number.
221 if (types_get_info(&lvalue
->type
, TI_GET_BASETYPE
, &bt
) &&
222 bt
== btInt
&& (*tmpbuf
& (1 << ((DWORD
)length
- 1))))
229 if (!memory_read_value(lvalue
, sizeof(*tmpbuf
), tmpbuf
)) return FALSE
;
234 /******************************************************************
235 * types_udt_find_element
238 BOOL
types_udt_find_element(struct dbg_lvalue
* lvalue
, const char* name
, long int* tmpbuf
)
241 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
242 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
245 struct dbg_type type
;
247 if (!types_get_real_type(&lvalue
->type
, &tag
) || tag
!= SymTagUDT
)
250 if (types_get_info(&lvalue
->type
, TI_GET_CHILDRENCOUNT
, &count
))
255 fcp
->Count
= min(count
, 256);
256 if (types_get_info(&lvalue
->type
, TI_FINDCHILDREN
, fcp
))
259 type
.module
= lvalue
->type
.module
;
260 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
263 type
.id
= fcp
->ChildId
[i
];
264 types_get_info(&type
, TI_GET_SYMNAME
, &ptr
);
266 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
267 HeapFree(GetProcessHeap(), 0, ptr
);
268 if (strcmp(tmp
, name
)) continue;
270 return types_get_udt_element_lvalue(lvalue
, &type
, tmpbuf
);
273 count
-= min(count
, 256);
280 /******************************************************************
283 * Grab an element from an array
285 BOOL
types_array_index(const struct dbg_lvalue
* lvalue
, int index
, struct dbg_lvalue
* result
)
287 struct dbg_type type
= lvalue
->type
;
290 memset(result
, 0, sizeof(*result
));
291 result
->type
.id
= dbg_itype_none
;
292 result
->type
.module
= 0;
294 if (!types_get_real_type(&type
, &tag
)) return FALSE
;
297 case SymTagArrayType
:
298 if (!types_get_info(&type
, TI_GET_COUNT
, &count
)) return FALSE
;
299 if (index
< 0 || index
>= count
) return FALSE
;
300 result
->addr
= lvalue
->addr
;
302 case SymTagPointerType
:
303 if (!memory_read_value(lvalue
, be_cpu
->pointer_size
, &result
->addr
.Offset
)) return FALSE
;
304 result
->addr
.Mode
= AddrModeFlat
;
305 switch (be_cpu
->pointer_size
)
307 case 4: result
->addr
.Offset
= (DWORD
)result
->addr
.Offset
; break;
316 * Get the base type, so we know how much to index by.
318 if (!types_get_info(&type
, TI_GET_TYPE
, &result
->type
.id
)) return FALSE
;
319 result
->type
.module
= type
.module
;
323 if (!types_get_info(&result
->type
, TI_GET_LENGTH
, &length
)) return FALSE
;
324 result
->addr
.Offset
+= index
* (DWORD
)length
;
326 /* FIXME: the following statement is not always true (and can lead to buggy behavior).
327 * There is no way to tell were the deref:ed value is...
329 * x is a pointer to struct s, x being on the stack
330 * => lvalue is in debuggee, result is in debugger
331 * x is a pointer to struct s, x being optimized into a reg
332 * => lvalue is debugger, result is debuggee
333 * x is a pointer to internal variable x
334 * => lvalue is debugger, result is debuggee
335 * So we always force debuggee address space, because dereferencing pointers to
336 * internal variables is very unlikely. A correct fix would be
339 result
->cookie
= DLV_TARGET
;
345 unsigned long result
; /* out: the found type */
346 enum SymTagEnum tag
; /* in: the tag to look for */
349 unsigned long typeid; /* when tag is SymTagUDT */
350 const char* name
; /* when tag is SymTagPointerType */
354 static BOOL CALLBACK
types_cb(PSYMBOL_INFO sym
, ULONG size
, void* _user
)
356 struct type_find_t
* user
= _user
;
358 struct dbg_type type
;
361 if (sym
->Tag
== user
->tag
)
366 if (!strcmp(user
->u
.name
, sym
->Name
))
368 user
->result
= sym
->TypeIndex
;
372 case SymTagPointerType
:
373 type
.module
= sym
->ModBase
;
374 type
.id
= sym
->TypeIndex
;
375 if (types_get_info(&type
, TI_GET_TYPE
, &type_id
) && type_id
== user
->u
.typeid)
377 user
->result
= sym
->TypeIndex
;
387 /******************************************************************
390 * Should look up in module based at linear whether (typeid*) exists
391 * Otherwise, we could create it locally
393 struct dbg_type
types_find_pointer(const struct dbg_type
* type
)
395 struct type_find_t f
;
398 f
.result
= dbg_itype_none
;
399 f
.tag
= SymTagPointerType
;
400 f
.u
.typeid = type
->id
;
401 SymEnumTypes(dbg_curr_process
->handle
, type
->module
, types_cb
, &f
);
402 ret
.module
= type
->module
;
407 /******************************************************************
410 * Should look up in the module based at linear address whether a type
411 * named 'name' and with the correct tag exists
413 struct dbg_type
types_find_type(unsigned long linear
, const char* name
, enum SymTagEnum tag
)
416 struct type_find_t f
;
419 f
.result
= dbg_itype_none
;
422 SymEnumTypes(dbg_curr_process
->handle
, linear
, types_cb
, &f
);
428 /***********************************************************************
431 * Implementation of the 'print' command.
433 void print_value(const struct dbg_lvalue
* lvalue
, char format
, int level
)
435 struct dbg_type type
= lvalue
->type
;
436 struct dbg_lvalue lvalue_field
;
442 if (!types_get_real_type(&type
, &tag
))
444 WINE_FIXME("---error\n");
448 if (type
.id
== dbg_itype_none
)
450 /* No type, just print the addr value */
451 print_bare_address(&lvalue
->addr
);
455 if (format
== 'i' || format
== 's' || format
== 'w' || format
== 'b' || format
== 'g')
457 dbg_printf("Format specifier '%c' is meaningless in 'print' command\n", format
);
465 case SymTagPointerType
:
466 /* FIXME: this in not 100% optimal (as we're going through the typedef handling
469 print_basic(lvalue
, format
);
472 if (types_get_info(&type
, TI_GET_CHILDRENCOUNT
, &count
))
474 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
475 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
479 struct dbg_type sub_type
;
485 fcp
->Count
= min(count
, 256);
486 if (types_get_info(&type
, TI_FINDCHILDREN
, fcp
))
488 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
491 sub_type
.module
= type
.module
;
492 sub_type
.id
= fcp
->ChildId
[i
];
493 types_get_info(&sub_type
, TI_GET_SYMNAME
, &ptr
);
495 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
496 dbg_printf("%s=", tmp
);
497 HeapFree(GetProcessHeap(), 0, ptr
);
498 lvalue_field
= *lvalue
;
499 if (types_get_udt_element_lvalue(&lvalue_field
, &sub_type
, &tmpbuf
))
501 print_value(&lvalue_field
, format
, level
+ 1);
503 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
506 count
-= min(count
, 256);
512 case SymTagArrayType
:
514 * Loop over all of the entries, printing stuff as we go.
517 types_get_info(&type
, TI_GET_COUNT
, &count
);
518 types_get_info(&type
, TI_GET_LENGTH
, &size
);
525 * Special handling for character arrays.
527 /* FIXME should check basic type here (should be a char!!!!)... */
528 len
= min(count
, sizeof(buffer
));
529 memory_get_string(dbg_curr_process
,
530 memory_to_linear_addr(&lvalue
->addr
),
531 lvalue
->cookie
== DLV_TARGET
, TRUE
, buffer
, len
);
532 dbg_printf("\"%s%s\"", buffer
, (len
< count
) ? "..." : "");
535 lvalue_field
= *lvalue
;
536 types_get_info(&type
, TI_GET_TYPE
, &lvalue_field
.type
.id
);
538 for (i
= 0; i
< count
; i
++)
540 print_value(&lvalue_field
, format
, level
+ 1);
541 lvalue_field
.addr
.Offset
+= size
/ count
;
542 dbg_printf((i
== count
- 1) ? "}" : ", ");
545 case SymTagFunctionType
:
546 dbg_printf("Function ");
547 print_bare_address(&lvalue
->addr
);
549 types_print_type(&type
, FALSE
);
552 lvalue_field
= *lvalue
;
553 types_get_info(&lvalue
->type
, TI_GET_TYPE
, &lvalue_field
.type
.id
);
554 print_value(&lvalue_field
, format
, level
);
557 WINE_FIXME("Unknown tag (%u)\n", tag
);
558 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
564 if (level
== 0) dbg_printf("\n");
567 static BOOL CALLBACK
print_types_cb(PSYMBOL_INFO sym
, ULONG size
, void* ctx
)
569 struct dbg_type type
;
570 type
.module
= sym
->ModBase
;
571 type
.id
= sym
->TypeIndex
;
572 dbg_printf("Mod: %08lx ID: %08lx\n", type
.module
, type
.id
);
573 types_print_type(&type
, TRUE
);
578 static BOOL CALLBACK
print_types_mod_cb(PCSTR mod_name
, DWORD64 base
, PVOID ctx
)
580 return SymEnumTypes(dbg_curr_process
->handle
, base
, print_types_cb
, ctx
);
583 BOOL
print_types(void)
585 if (!dbg_curr_process
)
587 dbg_printf("No known process, cannot print types\n");
590 SymEnumerateModules64(dbg_curr_process
->handle
, print_types_mod_cb
, NULL
);
594 BOOL
types_print_type(const struct dbg_type
* type
, BOOL details
)
599 DWORD tag
, udt
, count
;
600 struct dbg_type subtype
;
602 if (type
->id
== dbg_itype_none
|| !types_get_info(type
, TI_GET_SYMTAG
, &tag
))
604 dbg_printf("--invalid--<%lxh>--", type
->id
);
608 if (types_get_info(type
, TI_GET_SYMNAME
, &ptr
) && ptr
)
610 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
612 HeapFree(GetProcessHeap(), 0, ptr
);
614 else name
= "--none--";
619 if (details
) dbg_printf("Basic<%s>", name
); else dbg_printf("%s", name
);
621 case SymTagPointerType
:
622 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
623 subtype
.module
= type
->module
;
624 types_print_type(&subtype
, FALSE
);
628 types_get_info(type
, TI_GET_UDTKIND
, &udt
);
631 case UdtStruct
: dbg_printf("struct %s", name
); break;
632 case UdtUnion
: dbg_printf("union %s", name
); break;
633 case UdtClass
: dbg_printf("class %s", name
); break;
634 default: WINE_ERR("Unsupported UDT type (%d) for %s\n", udt
, name
); break;
637 types_get_info(type
, TI_GET_CHILDRENCOUNT
, &count
))
639 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
640 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
644 struct dbg_type type_elt
;
650 fcp
->Count
= min(count
, 256);
651 if (types_get_info(type
, TI_FINDCHILDREN
, fcp
))
653 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
656 type_elt
.module
= type
->module
;
657 type_elt
.id
= fcp
->ChildId
[i
];
658 types_get_info(&type_elt
, TI_GET_SYMNAME
, &ptr
);
660 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
661 HeapFree(GetProcessHeap(), 0, ptr
);
662 dbg_printf("%s", tmp
);
663 if (types_get_info(&type_elt
, TI_GET_TYPE
, &type_elt
.id
))
666 types_print_type(&type_elt
, details
);
668 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
671 count
-= min(count
, 256);
677 case SymTagArrayType
:
678 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
679 subtype
.module
= type
->module
;
680 types_print_type(&subtype
, details
);
681 if (types_get_info(type
, TI_GET_COUNT
, &count
))
682 dbg_printf(" %s[%d]", name
, count
);
684 dbg_printf(" %s[]", name
);
687 dbg_printf("enum %s", name
);
689 case SymTagFunctionType
:
690 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
691 /* is the returned type the same object as function sig itself ? */
692 if (subtype
.id
!= type
->id
)
694 subtype
.module
= type
->module
;
695 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
);