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 (!be_cpu
->fetch_integer(lvalue
, (unsigned)size
, s
= TRUE
, &rtn
))
96 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
99 if (!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 (!be_cpu
->fetch_integer(lvalue
, sizeof(void*), s
= FALSE
, &rtn
))
110 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
112 case SymTagArrayType
:
114 if (!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 (!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("Unsufficient size\n");
174 /* FIXME: should support floats as well */
175 val
= types_extract_as_longlong(lvalue_from
, NULL
, &is_signed
);
176 return 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
, be_cpu
->pointer_size
, &result
->addr
.Offset
)) return FALSE
;
306 result
->addr
.Mode
= AddrModeFlat
;
307 switch (be_cpu
->pointer_size
)
309 case 4: result
->addr
.Offset
= (DWORD
)result
->addr
.Offset
; break;
318 * Get the base type, so we know how much to index by.
320 if (!types_get_info(&type
, TI_GET_TYPE
, &result
->type
.id
)) return FALSE
;
321 result
->type
.module
= type
.module
;
325 if (!types_get_info(&result
->type
, TI_GET_LENGTH
, &length
)) return FALSE
;
326 result
->addr
.Offset
+= index
* (DWORD
)length
;
328 /* FIXME: the following statement is not always true (and can lead to buggy behavior).
329 * There is no way to tell where the deref:ed value is...
331 * x is a pointer to struct s, x being on the stack
332 * => lvalue is in debuggee, result is in debugger
333 * x is a pointer to struct s, x being optimized into a reg
334 * => lvalue is debugger, result is debuggee
335 * x is a pointer to internal variable x
336 * => lvalue is debugger, result is debuggee
337 * So we always force debuggee address space, because dereferencing pointers to
338 * internal variables is very unlikely. A correct fix would be
341 result
->cookie
= DLV_TARGET
;
347 unsigned long result
; /* out: the found type */
348 enum SymTagEnum tag
; /* in: the tag to look for */
351 unsigned long typeid; /* when tag is SymTagUDT */
352 const char* name
; /* when tag is SymTagPointerType */
356 static BOOL CALLBACK
types_cb(PSYMBOL_INFO sym
, ULONG size
, void* _user
)
358 struct type_find_t
* user
= _user
;
360 struct dbg_type type
;
363 if (sym
->Tag
== user
->tag
)
368 if (!strcmp(user
->u
.name
, sym
->Name
))
370 user
->result
= sym
->TypeIndex
;
374 case SymTagPointerType
:
375 type
.module
= sym
->ModBase
;
376 type
.id
= sym
->TypeIndex
;
377 if (types_get_info(&type
, TI_GET_TYPE
, &type_id
) && type_id
== user
->u
.typeid)
379 user
->result
= sym
->TypeIndex
;
389 /******************************************************************
392 * Should look up in module based at linear whether (typeid*) exists
393 * Otherwise, we could create it locally
395 struct dbg_type
types_find_pointer(const struct dbg_type
* type
)
397 struct type_find_t f
;
400 f
.result
= dbg_itype_none
;
401 f
.tag
= SymTagPointerType
;
402 f
.u
.typeid = type
->id
;
403 SymEnumTypes(dbg_curr_process
->handle
, type
->module
, types_cb
, &f
);
404 ret
.module
= type
->module
;
409 /******************************************************************
412 * Should look up in the module based at linear address whether a type
413 * named 'name' and with the correct tag exists
415 struct dbg_type
types_find_type(unsigned long linear
, const char* name
, enum SymTagEnum tag
)
418 struct type_find_t f
;
421 f
.result
= dbg_itype_none
;
424 SymEnumTypes(dbg_curr_process
->handle
, linear
, types_cb
, &f
);
430 /***********************************************************************
433 * Implementation of the 'print' command.
435 void print_value(const struct dbg_lvalue
* lvalue
, char format
, int level
)
437 struct dbg_type type
= lvalue
->type
;
438 struct dbg_lvalue lvalue_field
;
444 if (!types_get_real_type(&type
, &tag
))
446 WINE_FIXME("---error\n");
450 if (type
.id
== dbg_itype_none
)
452 /* No type, just print the addr value */
453 print_bare_address(&lvalue
->addr
);
457 if (format
== 'i' || format
== 's' || format
== 'w' || format
== 'b' || format
== 'g')
459 dbg_printf("Format specifier '%c' is meaningless in 'print' command\n", format
);
467 case SymTagPointerType
:
468 /* FIXME: this in not 100% optimal (as we're going through the typedef handling
471 print_basic(lvalue
, format
);
474 if (types_get_info(&type
, TI_GET_CHILDRENCOUNT
, &count
))
476 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
477 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
481 struct dbg_type sub_type
;
487 fcp
->Count
= min(count
, 256);
488 if (types_get_info(&type
, TI_FINDCHILDREN
, fcp
))
490 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
493 sub_type
.module
= type
.module
;
494 sub_type
.id
= fcp
->ChildId
[i
];
495 types_get_info(&sub_type
, TI_GET_SYMNAME
, &ptr
);
497 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
498 dbg_printf("%s=", tmp
);
499 HeapFree(GetProcessHeap(), 0, ptr
);
500 lvalue_field
= *lvalue
;
501 if (types_get_udt_element_lvalue(&lvalue_field
, &sub_type
, &tmpbuf
))
503 print_value(&lvalue_field
, format
, level
+ 1);
505 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
508 count
-= min(count
, 256);
514 case SymTagArrayType
:
516 * Loop over all of the entries, printing stuff as we go.
519 types_get_info(&type
, TI_GET_COUNT
, &count
);
520 types_get_info(&type
, TI_GET_LENGTH
, &size
);
527 * Special handling for character arrays.
529 /* FIXME should check basic type here (should be a char!!!!)... */
530 len
= min(count
, sizeof(buffer
));
531 memory_get_string(dbg_curr_process
,
532 memory_to_linear_addr(&lvalue
->addr
),
533 lvalue
->cookie
== DLV_TARGET
, TRUE
, buffer
, len
);
534 dbg_printf("\"%s%s\"", buffer
, (len
< count
) ? "..." : "");
537 lvalue_field
= *lvalue
;
538 types_get_info(&type
, TI_GET_TYPE
, &lvalue_field
.type
.id
);
540 for (i
= 0; i
< count
; i
++)
542 print_value(&lvalue_field
, format
, level
+ 1);
543 lvalue_field
.addr
.Offset
+= size
/ count
;
544 dbg_printf((i
== count
- 1) ? "}" : ", ");
547 case SymTagFunctionType
:
548 dbg_printf("Function ");
549 print_bare_address(&lvalue
->addr
);
551 types_print_type(&type
, FALSE
);
554 lvalue_field
= *lvalue
;
555 types_get_info(&lvalue
->type
, TI_GET_TYPE
, &lvalue_field
.type
.id
);
556 print_value(&lvalue_field
, format
, level
);
559 WINE_FIXME("Unknown tag (%u)\n", tag
);
560 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
566 if (level
== 0) dbg_printf("\n");
569 static BOOL CALLBACK
print_types_cb(PSYMBOL_INFO sym
, ULONG size
, void* ctx
)
571 struct dbg_type type
;
572 type
.module
= sym
->ModBase
;
573 type
.id
= sym
->TypeIndex
;
574 dbg_printf("Mod: %08lx ID: %08lx\n", type
.module
, type
.id
);
575 types_print_type(&type
, TRUE
);
580 static BOOL CALLBACK
print_types_mod_cb(PCSTR mod_name
, DWORD64 base
, PVOID ctx
)
582 return SymEnumTypes(dbg_curr_process
->handle
, base
, print_types_cb
, ctx
);
585 BOOL
print_types(void)
587 if (!dbg_curr_process
)
589 dbg_printf("No known process, cannot print types\n");
592 SymEnumerateModules64(dbg_curr_process
->handle
, print_types_mod_cb
, NULL
);
596 BOOL
types_print_type(const struct dbg_type
* type
, BOOL details
)
601 DWORD tag
, udt
, count
;
602 struct dbg_type subtype
;
604 if (type
->id
== dbg_itype_none
|| !types_get_info(type
, TI_GET_SYMTAG
, &tag
))
606 dbg_printf("--invalid--<%lxh>--", type
->id
);
610 if (types_get_info(type
, TI_GET_SYMNAME
, &ptr
) && ptr
)
612 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
614 HeapFree(GetProcessHeap(), 0, ptr
);
616 else name
= "--none--";
621 if (details
) dbg_printf("Basic<%s>", name
); else dbg_printf("%s", name
);
623 case SymTagPointerType
:
624 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
625 subtype
.module
= type
->module
;
626 types_print_type(&subtype
, FALSE
);
630 types_get_info(type
, TI_GET_UDTKIND
, &udt
);
633 case UdtStruct
: dbg_printf("struct %s", name
); break;
634 case UdtUnion
: dbg_printf("union %s", name
); break;
635 case UdtClass
: dbg_printf("class %s", name
); break;
636 default: WINE_ERR("Unsupported UDT type (%d) for %s\n", udt
, name
); break;
639 types_get_info(type
, TI_GET_CHILDRENCOUNT
, &count
))
641 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
642 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
646 struct dbg_type type_elt
;
652 fcp
->Count
= min(count
, 256);
653 if (types_get_info(type
, TI_FINDCHILDREN
, fcp
))
655 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
658 type_elt
.module
= type
->module
;
659 type_elt
.id
= fcp
->ChildId
[i
];
660 types_get_info(&type_elt
, TI_GET_SYMNAME
, &ptr
);
662 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
663 HeapFree(GetProcessHeap(), 0, ptr
);
664 dbg_printf("%s", tmp
);
665 if (types_get_info(&type_elt
, TI_GET_TYPE
, &type_elt
.id
))
668 types_print_type(&type_elt
, details
);
670 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
673 count
-= min(count
, 256);
679 case SymTagArrayType
:
680 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
681 subtype
.module
= type
->module
;
682 types_print_type(&subtype
, details
);
683 if (types_get_info(type
, TI_GET_COUNT
, &count
))
684 dbg_printf(" %s[%d]", name
, count
);
686 dbg_printf(" %s[]", name
);
689 dbg_printf("enum %s", name
);
691 case SymTagFunctionType
:
692 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
693 /* is the returned type the same object as function sig itself ? */
694 if (subtype
.id
!= type
->id
)
696 subtype
.module
= type
->module
;
697 types_print_type(&subtype
, FALSE
);
702 dbg_printf("<ret_type=self>");
704 dbg_printf(" (*%s)(", name
);
705 if (types_get_info(type
, TI_GET_CHILDRENCOUNT
, &count
))
707 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
708 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
712 if (!count
) dbg_printf("void");
715 fcp
->Count
= min(count
, 256);
716 if (types_get_info(type
, TI_FINDCHILDREN
, fcp
))
718 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
720 subtype
.id
= fcp
->ChildId
[i
];
721 types_get_info(&subtype
, TI_GET_TYPE
, &subtype
.id
);
722 types_print_type(&subtype
, FALSE
);
723 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
726 count
-= min(count
, 256);
733 dbg_printf("%s", name
);
736 WINE_ERR("Unknown type %u for %s\n", tag
, name
);
743 /* helper to typecast pInfo to its expected type (_t) */
744 #define X(_t) (*((_t*)pInfo))
746 BOOL
types_get_info(const struct dbg_type
* type
, IMAGEHLP_SYMBOL_TYPE_INFO ti
, void* pInfo
)
748 if (type
->id
== dbg_itype_none
) return FALSE
;
749 if (type
->module
!= 0)
752 ret
= SymGetTypeInfo(dbg_curr_process
->handle
, type
->module
, type
->id
, ti
, pInfo
);
754 SymGetTypeInfo(dbg_curr_process
->handle
, type
->module
, type
->id
, TI_GET_SYMTAG
, &tag
) &&
755 tag
== SymTagBaseType
&&
756 SymGetTypeInfo(dbg_curr_process
->handle
, type
->module
, type
->id
, TI_GET_BASETYPE
, &bt
))
758 static const WCHAR voidW
[] = {'v','o','i','d','\0'};
759 static const WCHAR charW
[] = {'c','h','a','r','\0'};
760 static const WCHAR wcharW
[] = {'W','C','H','A','R','\0'};
761 static const WCHAR intW
[] = {'i','n','t','\0'};
762 static const WCHAR uintW
[] = {'u','n','s','i','g','n','e','d',' ','i','n','t','\0'};
763 static const WCHAR floatW
[] = {'f','l','o','a','t','\0'};
764 static const WCHAR boolW
[] = {'b','o','o','l','\0'};
765 static const WCHAR longW
[] = {'l','o','n','g',' ','i','n','t','\0'};
766 static const WCHAR ulongW
[] = {'u','n','s','i','g','n','e','d',' ','l','o','n','g',' ','i','n','t','\0'};
767 static const WCHAR complexW
[] = {'c','o','m','p','l','e','x','\0'};
768 const WCHAR
* name
= NULL
;
772 case btVoid
: name
= voidW
; break;
773 case btChar
: name
= charW
; break;
774 case btWChar
: name
= wcharW
; break;
775 case btInt
: name
= intW
; break;
776 case btUInt
: name
= uintW
; break;
777 case btFloat
: name
= floatW
; break;
778 case btBool
: name
= boolW
; break;
779 case btLong
: name
= longW
; break;
780 case btULong
: name
= ulongW
; break;
781 case btComplex
: name
= complexW
; break;
782 default: WINE_FIXME("Unsupported basic type %u\n", bt
); return FALSE
;
784 X(WCHAR
*) = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(name
) + 1) * sizeof(WCHAR
));
787 lstrcpyW(X(WCHAR
*), name
);
794 assert(type
->id
>= dbg_itype_first
);
798 case dbg_itype_unsigned_long_int
:
801 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
802 case TI_GET_LENGTH
: X(DWORD64
) = ADDRSIZE
; break;
803 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
804 default: WINE_FIXME("unsupported %u for u-long int\n", ti
); return FALSE
;
807 case dbg_itype_signed_long_int
:
810 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
811 case TI_GET_LENGTH
: X(DWORD64
) = ADDRSIZE
; break;
812 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
813 default: WINE_FIXME("unsupported %u for s-long int\n", ti
); return FALSE
;
816 case dbg_itype_unsigned_int
:
819 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
820 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
821 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
822 default: WINE_FIXME("unsupported %u for u-int\n", ti
); return FALSE
;
825 case dbg_itype_signed_int
:
828 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
829 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
830 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
831 default: WINE_FIXME("unsupported %u for s-int\n", ti
); return FALSE
;
834 case dbg_itype_unsigned_short_int
:
837 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
838 case TI_GET_LENGTH
: X(DWORD64
) = 2; break;
839 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
840 default: WINE_FIXME("unsupported %u for u-short int\n", ti
); return FALSE
;
843 case dbg_itype_signed_short_int
:
846 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
847 case TI_GET_LENGTH
: X(DWORD64
) = 2; break;
848 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
849 default: WINE_FIXME("unsupported %u for s-short int\n", ti
); return FALSE
;
852 case dbg_itype_unsigned_char_int
:
855 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
856 case TI_GET_LENGTH
: X(DWORD64
) = 1; break;
857 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
858 default: WINE_FIXME("unsupported %u for u-char int\n", ti
); return FALSE
;
861 case dbg_itype_signed_char_int
:
864 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
865 case TI_GET_LENGTH
: X(DWORD64
) = 1; break;
866 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
867 default: WINE_FIXME("unsupported %u for s-char int\n", ti
); return FALSE
;
873 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
874 case TI_GET_LENGTH
: X(DWORD64
) = 1; break;
875 case TI_GET_BASETYPE
: X(DWORD
) = btChar
; break;
876 default: WINE_FIXME("unsupported %u for char int\n", ti
); return FALSE
;
879 case dbg_itype_astring
:
882 case TI_GET_SYMTAG
: X(DWORD
) = SymTagPointerType
; break;
883 case TI_GET_LENGTH
: X(DWORD64
) = ADDRSIZE
; break;
884 case TI_GET_TYPE
: X(DWORD
) = dbg_itype_char
; break;
885 default: WINE_FIXME("unsupported %u for a string\n", ti
); return FALSE
;
888 case dbg_itype_segptr
:
891 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
892 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
893 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
894 default: WINE_FIXME("unsupported %u for seg-ptr\n", ti
); return FALSE
;
897 case dbg_itype_short_real
:
900 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
901 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
902 case TI_GET_BASETYPE
: X(DWORD
) = btFloat
; break;
903 default: WINE_FIXME("unsupported %u for short real\n", ti
); return FALSE
;
909 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
910 case TI_GET_LENGTH
: X(DWORD64
) = 8; break;
911 case TI_GET_BASETYPE
: X(DWORD
) = btFloat
; break;
912 default: WINE_FIXME("unsupported %u for real\n", ti
); return FALSE
;
915 case dbg_itype_long_real
:
918 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
919 case TI_GET_LENGTH
: X(DWORD64
) = 10; break;
920 case TI_GET_BASETYPE
: X(DWORD
) = btFloat
; break;
921 default: WINE_FIXME("unsupported %u for long real\n", ti
); return FALSE
;
924 case dbg_itype_m128a
:
927 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
928 case TI_GET_LENGTH
: X(DWORD64
) = 16; break;
929 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
930 default: WINE_FIXME("unsupported %u for XMM register\n", ti
); return FALSE
;
933 default: WINE_FIXME("unsupported type id 0x%lx\n", type
->id
);