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.
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(winedbg
);
31 /******************************************************************
34 * Get rid of any potential typedef in the lvalue's type to get
35 * to the 'real' type (the one we can work upon).
37 BOOL
types_get_real_type(struct dbg_type
* type
, DWORD
* tag
)
39 if (type
->id
== dbg_itype_none
) return FALSE
;
42 if (!types_get_info(type
, TI_GET_SYMTAG
, tag
))
44 if (*tag
!= SymTagTypedef
) return TRUE
;
45 } while (types_get_info(type
, TI_GET_TYPE
, &type
->id
));
49 /******************************************************************
50 * types_extract_as_lgint
52 * Given a lvalue, try to get an integral (or pointer/address) value
55 dbg_lgint_t
types_extract_as_lgint(const struct dbg_lvalue
* lvalue
,
56 unsigned* psize
, BOOL
*issigned
)
61 struct dbg_type type
= lvalue
->type
;
64 if (!types_get_real_type(&type
, &tag
))
65 RaiseException(DEBUG_STATUS_NOT_AN_INTEGER
, 0, 0, NULL
);
67 if (type
.id
== dbg_itype_segptr
)
69 return (LONG_PTR
)memory_to_linear_addr(&lvalue
->addr
);
71 if (tag
!= SymTagBaseType
&& lvalue
->bitlen
) dbg_printf("Unexpected bitfield on tag %d\n", tag
);
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 (%I64x)\n", size
);
88 RaiseException(DEBUG_STATUS_NOT_AN_INTEGER
, 0, 0, NULL
);
95 if (!memory_fetch_integer(lvalue
, (unsigned)size
, s
= TRUE
, &rtn
))
96 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
99 if (!memory_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 (!types_get_info(&type
, TI_GET_LENGTH
, &size
) ||
110 !memory_fetch_integer(lvalue
, (unsigned)size
, s
= FALSE
, &rtn
))
111 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
113 case SymTagArrayType
:
115 if (!memory_fetch_integer(lvalue
, sizeof(unsigned), s
= FALSE
, &rtn
))
116 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
119 if (!types_get_info(&type
, TI_GET_LENGTH
, &size
) ||
120 !memory_fetch_integer(lvalue
, (unsigned)size
, s
= FALSE
, &rtn
))
121 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
123 case SymTagFunctionType
:
124 rtn
= (ULONG_PTR
)memory_to_linear_addr(&lvalue
->addr
);
127 WINE_FIXME("Unsupported tag %u\n", tag
);
128 RaiseException(DEBUG_STATUS_NOT_AN_INTEGER
, 0, 0, NULL
);
134 /******************************************************************
135 * types_extract_as_integer
137 * Given a lvalue, try to get an integral (or pointer/address) value
140 dbg_lgint_t
types_extract_as_integer(const struct dbg_lvalue
* lvalue
)
142 return types_extract_as_lgint(lvalue
, NULL
, NULL
);
145 /******************************************************************
146 * types_extract_as_address
150 void types_extract_as_address(const struct dbg_lvalue
* lvalue
, ADDRESS64
* addr
)
152 if (lvalue
->type
.id
== dbg_itype_segptr
&& lvalue
->type
.module
== 0)
154 *addr
= lvalue
->addr
;
158 addr
->Mode
= AddrModeFlat
;
159 addr
->Offset
= types_extract_as_lgint(lvalue
, NULL
, NULL
);
163 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_integer(lvalue_from
);
176 return memory_store_integer(lvalue_to
, 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
, const struct dbg_type
* type
)
186 DWORD offset
, bitoffset
;
189 types_get_info(type
, TI_GET_TYPE
, &lvalue
->type
.id
);
190 lvalue
->type
.module
= type
->module
;
191 if (!types_get_info(type
, TI_GET_OFFSET
, &offset
)) return FALSE
;
192 lvalue
->addr
.Offset
+= offset
;
194 if (types_get_info(type
, TI_GET_BITPOSITION
, &bitoffset
))
196 types_get_info(type
, TI_GET_LENGTH
, &length
);
197 lvalue
->bitlen
= length
;
198 lvalue
->bitstart
= bitoffset
;
199 if (lvalue
->bitlen
!= length
|| lvalue
->bitstart
!= bitoffset
)
201 dbg_printf("too wide bitfields\n"); /* shouldn't happen */
206 lvalue
->bitlen
= lvalue
->bitstart
= 0;
211 /******************************************************************
212 * types_udt_find_element
215 BOOL
types_udt_find_element(struct dbg_lvalue
* lvalue
, const char* name
)
218 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
219 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
222 struct dbg_type type
;
224 if (!types_get_real_type(&lvalue
->type
, &tag
) || tag
!= SymTagUDT
)
227 if (types_get_info(&lvalue
->type
, TI_GET_CHILDRENCOUNT
, &count
))
232 fcp
->Count
= min(count
, 256);
233 if (types_get_info(&lvalue
->type
, TI_FINDCHILDREN
, fcp
))
236 type
.module
= lvalue
->type
.module
;
237 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
239 type
.id
= fcp
->ChildId
[i
];
240 if (types_get_info(&type
, TI_GET_SYMNAME
, &ptr
) && ptr
)
242 WideCharToMultiByte(CP_ACP
, 0, ptr
, -1, tmp
, sizeof(tmp
), NULL
, NULL
);
243 HeapFree(GetProcessHeap(), 0, ptr
);
244 if (!strcmp(tmp
, name
))
245 return types_get_udt_element_lvalue(lvalue
, &type
);
249 count
-= min(count
, 256);
256 /******************************************************************
259 * Grab an element from an array
261 BOOL
types_array_index(const struct dbg_lvalue
* lvalue
, int index
, struct dbg_lvalue
* result
)
263 struct dbg_type type
= lvalue
->type
;
266 memset(result
, 0, sizeof(*result
));
267 result
->type
.id
= dbg_itype_none
;
268 result
->type
.module
= 0;
270 if (!types_get_real_type(&type
, &tag
)) return FALSE
;
273 case SymTagArrayType
:
274 if (!types_get_info(&type
, TI_GET_COUNT
, &count
)) return FALSE
;
275 if (index
< 0 || index
>= count
) return FALSE
;
276 result
->addr
= lvalue
->addr
;
278 case SymTagPointerType
:
279 if (!memory_read_value(lvalue
, dbg_curr_process
->be_cpu
->pointer_size
, &result
->addr
.Offset
))
281 result
->addr
.Mode
= AddrModeFlat
;
282 switch (dbg_curr_process
->be_cpu
->pointer_size
)
284 case 4: result
->addr
.Offset
= (DWORD
)result
->addr
.Offset
; break;
293 * Get the base type, so we know how much to index by.
295 if (!types_get_info(&type
, TI_GET_TYPE
, &result
->type
.id
)) return FALSE
;
296 result
->type
.module
= type
.module
;
300 if (!types_get_info(&result
->type
, TI_GET_LENGTH
, &length
)) return FALSE
;
301 result
->addr
.Offset
+= index
* (DWORD
)length
;
303 /* FIXME: the following statement is not always true (and can lead to buggy behavior).
304 * There is no way to tell where the deref:ed value is...
306 * x is a pointer to struct s, x being on the stack
307 * => lvalue is in debuggee, result is in debugger
308 * x is a pointer to struct s, x being optimized into a reg
309 * => lvalue is debugger, result is debuggee
310 * x is a pointer to internal variable x
311 * => lvalue is debugger, result is debuggee
312 * So we always force debuggee address space, because dereferencing pointers to
313 * internal variables is very unlikely. A correct fix would be
316 result
->in_debuggee
= 1;
322 ULONG result
; /* out: the found type */
323 enum SymTagEnum tag
; /* in: the tag to look for */
326 ULONG
typeid; /* when tag is SymTagUDT */
327 const char* name
; /* when tag is SymTagPointerType */
331 static BOOL CALLBACK
types_cb(PSYMBOL_INFO sym
, ULONG size
, void* _user
)
333 struct type_find_t
* user
= _user
;
335 struct dbg_type type
;
338 if (sym
->Tag
== user
->tag
)
343 if (!strcmp(user
->u
.name
, sym
->Name
))
345 user
->result
= sym
->TypeIndex
;
349 case SymTagPointerType
:
350 type
.module
= sym
->ModBase
;
351 type
.id
= sym
->TypeIndex
;
352 if (types_get_info(&type
, TI_GET_TYPE
, &type_id
) && type_id
== user
->u
.typeid)
354 user
->result
= sym
->TypeIndex
;
364 /******************************************************************
367 * Should look up in module based at linear whether (typeid*) exists
368 * Otherwise, we could create it locally
370 struct dbg_type
types_find_pointer(const struct dbg_type
* type
)
372 struct type_find_t f
;
375 f
.result
= dbg_itype_none
;
376 f
.tag
= SymTagPointerType
;
377 f
.u
.typeid = type
->id
;
378 SymEnumTypes(dbg_curr_process
->handle
, type
->module
, types_cb
, &f
);
379 ret
.module
= type
->module
;
384 /******************************************************************
387 * Should look up in the module based at linear address whether a type
388 * named 'name' and with the correct tag exists
390 struct dbg_type
types_find_type(DWORD64 linear
, const char* name
, enum SymTagEnum tag
)
393 struct type_find_t f
;
396 f
.result
= dbg_itype_none
;
399 SymEnumTypes(dbg_curr_process
->handle
, linear
, types_cb
, &f
);
405 /***********************************************************************
408 * Implementation of the 'print' command.
410 void print_value(const struct dbg_lvalue
* lvalue
, char format
, int level
)
412 struct dbg_type type
= lvalue
->type
;
413 struct dbg_lvalue lvalue_field
;
419 if (!types_get_real_type(&type
, &tag
))
421 WINE_FIXME("---error\n");
425 if (type
.id
== dbg_itype_none
)
427 /* No type, just print the addr value */
428 print_bare_address(&lvalue
->addr
);
432 if (format
== 'i' || format
== 's' || format
== 'w' || format
== 'b' || format
== 'g')
434 dbg_printf("Format specifier '%c' is meaningless in 'print' command\n", format
);
442 case SymTagPointerType
:
443 /* FIXME: this in not 100% optimal (as we're going through the typedef handling
446 print_basic(lvalue
, format
);
449 if (types_get_info(&type
, TI_GET_CHILDRENCOUNT
, &count
))
451 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
452 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
454 struct dbg_type sub_type
;
460 fcp
->Count
= min(count
, 256);
461 if (types_get_info(&type
, TI_FINDCHILDREN
, fcp
))
463 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
465 sub_type
.module
= type
.module
;
466 sub_type
.id
= fcp
->ChildId
[i
];
467 if (!types_get_info(&sub_type
, TI_GET_SYMNAME
, &ptr
) || !ptr
) continue;
468 dbg_printf("%ls=", ptr
);
469 HeapFree(GetProcessHeap(), 0, ptr
);
470 lvalue_field
= *lvalue
;
471 if (types_get_udt_element_lvalue(&lvalue_field
, &sub_type
))
473 print_value(&lvalue_field
, format
, level
+ 1);
475 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
478 count
-= min(count
, 256);
484 case SymTagArrayType
:
486 * Loop over all of the entries, printing stuff as we go.
489 types_get_info(&type
, TI_GET_COUNT
, &count
);
490 types_get_info(&type
, TI_GET_LENGTH
, &size
);
491 lvalue_field
= *lvalue
;
492 types_get_info(&lvalue_field
.type
, TI_GET_TYPE
, &lvalue_field
.type
.id
);
493 types_get_real_type(&lvalue_field
.type
, &tag
);
495 if (size
== count
&& tag
== SymTagBaseType
)
499 types_get_info(&lvalue_field
.type
, TI_GET_BASETYPE
, &basetype
);
500 if (basetype
== btChar
)
504 * Special handling for character arrays.
506 unsigned len
= min(count
, sizeof(buffer
));
507 memory_get_string(dbg_curr_process
,
508 memory_to_linear_addr(&lvalue
->addr
),
509 lvalue
->in_debuggee
, TRUE
, buffer
, len
);
510 dbg_printf("\"%s%s\"", buffer
, (len
< count
) ? "..." : "");
515 for (i
= 0; i
< count
; i
++)
517 print_value(&lvalue_field
, format
, level
+ 1);
518 lvalue_field
.addr
.Offset
+= size
/ count
;
519 dbg_printf((i
== count
- 1) ? "}" : ", ");
522 case SymTagFunctionType
:
523 dbg_printf("Function ");
524 print_bare_address(&lvalue
->addr
);
526 types_print_type(&type
, FALSE
);
529 lvalue_field
= *lvalue
;
530 types_get_info(&lvalue
->type
, TI_GET_TYPE
, &lvalue_field
.type
.id
);
531 print_value(&lvalue_field
, format
, level
);
534 WINE_FIXME("Unknown tag (%u)\n", tag
);
535 RaiseException(DEBUG_STATUS_INTERNAL_ERROR
, 0, 0, NULL
);
541 if (level
== 0) dbg_printf("\n");
544 static BOOL CALLBACK
print_types_cb(PSYMBOL_INFO sym
, ULONG size
, void* ctx
)
546 struct dbg_type type
;
547 type
.module
= sym
->ModBase
;
548 type
.id
= sym
->TypeIndex
;
549 dbg_printf("Mod: %0*Ix ID: %08x\n", ADDRWIDTH
, type
.module
, type
.id
);
550 types_print_type(&type
, TRUE
);
555 static BOOL CALLBACK
print_types_mod_cb(PCSTR mod_name
, DWORD64 base
, PVOID ctx
)
557 return SymEnumTypes(dbg_curr_process
->handle
, base
, print_types_cb
, ctx
);
560 BOOL
print_types(void)
562 if (!dbg_curr_process
)
564 dbg_printf("No known process, cannot print types\n");
567 SymEnumerateModules64(dbg_curr_process
->handle
, print_types_mod_cb
, NULL
);
571 BOOL
types_print_type(const struct dbg_type
* type
, BOOL details
)
575 DWORD tag
, udt
, count
;
576 struct dbg_type subtype
;
578 if (type
->id
== dbg_itype_none
|| !types_get_info(type
, TI_GET_SYMTAG
, &tag
))
580 dbg_printf("--invalid--<%xh>--", type
->id
);
584 name
= (types_get_info(type
, TI_GET_SYMNAME
, &ptr
) && ptr
) ? ptr
: L
"--none--";
589 if (details
) dbg_printf("Basic<%ls>", name
); else dbg_printf("%ls", name
);
591 case SymTagPointerType
:
592 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
593 subtype
.module
= type
->module
;
594 types_print_type(&subtype
, FALSE
);
598 types_get_info(type
, TI_GET_UDTKIND
, &udt
);
601 case UdtStruct
: dbg_printf("struct %ls", name
); break;
602 case UdtUnion
: dbg_printf("union %ls", name
); break;
603 case UdtClass
: dbg_printf("class %ls", name
); break;
604 default: WINE_ERR("Unsupported UDT type (%d) for %ls\n", udt
, name
); break;
607 types_get_info(type
, TI_GET_CHILDRENCOUNT
, &count
))
609 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
610 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
613 struct dbg_type type_elt
;
619 fcp
->Count
= min(count
, 256);
620 if (types_get_info(type
, TI_FINDCHILDREN
, fcp
))
622 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
624 type_elt
.module
= type
->module
;
625 type_elt
.id
= fcp
->ChildId
[i
];
626 if (!types_get_info(&type_elt
, TI_GET_SYMNAME
, &ptr
) || !ptr
) continue;
627 dbg_printf("%ls", ptr
);
628 HeapFree(GetProcessHeap(), 0, ptr
);
629 if (types_get_info(&type_elt
, TI_GET_TYPE
, &type_elt
.id
))
632 types_print_type(&type_elt
, details
);
634 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
637 count
-= min(count
, 256);
643 case SymTagArrayType
:
644 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
645 subtype
.module
= type
->module
;
646 types_print_type(&subtype
, details
);
647 if (types_get_info(type
, TI_GET_COUNT
, &count
))
648 dbg_printf(" %ls[%d]", name
, count
);
650 dbg_printf(" %ls[]", name
);
653 dbg_printf("enum %ls", name
);
655 case SymTagFunctionType
:
656 types_get_info(type
, TI_GET_TYPE
, &subtype
.id
);
657 /* is the returned type the same object as function sig itself ? */
658 if (subtype
.id
!= type
->id
)
660 subtype
.module
= type
->module
;
661 types_print_type(&subtype
, FALSE
);
666 dbg_printf("<ret_type=self>");
668 dbg_printf(" (*%ls)(", name
);
669 if (types_get_info(type
, TI_GET_CHILDRENCOUNT
, &count
))
671 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
672 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
676 if (!count
) dbg_printf("void");
679 fcp
->Count
= min(count
, 256);
680 if (types_get_info(type
, TI_FINDCHILDREN
, fcp
))
682 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
684 subtype
.id
= fcp
->ChildId
[i
];
685 types_get_info(&subtype
, TI_GET_TYPE
, &subtype
.id
);
686 types_print_type(&subtype
, FALSE
);
687 if (i
< min(fcp
->Count
, count
) - 1 || count
> 256) dbg_printf(", ");
690 count
-= min(count
, 256);
697 dbg_printf("%ls", name
);
700 WINE_ERR("Unknown type %u for %ls\n", tag
, name
);
704 HeapFree(GetProcessHeap(), 0, ptr
);
708 /* helper to typecast pInfo to its expected type (_t) */
709 #define X(_t) (*((_t*)pInfo))
711 BOOL
types_get_info(const struct dbg_type
* type
, IMAGEHLP_SYMBOL_TYPE_INFO ti
, void* pInfo
)
713 if (type
->id
== dbg_itype_none
) return FALSE
;
714 if (type
->module
!= 0)
717 ret
= SymGetTypeInfo(dbg_curr_process
->handle
, type
->module
, type
->id
, ti
, pInfo
);
719 ti
== TI_GET_SYMNAME
&&
720 SymGetTypeInfo(dbg_curr_process
->handle
, type
->module
, type
->id
, TI_GET_SYMTAG
, &tag
) &&
721 tag
== SymTagBaseType
&&
722 SymGetTypeInfo(dbg_curr_process
->handle
, type
->module
, type
->id
, TI_GET_BASETYPE
, &bt
))
724 const WCHAR
* name
= NULL
;
728 case btVoid
: name
= L
"void"; break;
729 case btChar
: name
= L
"char"; break;
730 case btWChar
: name
= L
"WCHAR"; break;
731 case btInt
: name
= L
"int"; break;
732 case btUInt
: name
= L
"unsigned int"; break;
733 case btFloat
: name
= L
"float"; break;
734 case btBool
: name
= L
"bool"; break;
735 case btLong
: name
= L
"long int"; break;
736 case btULong
: name
= L
"unsigned long int"; break;
737 case btComplex
: name
= L
"complex"; break;
738 default: WINE_FIXME("Unsupported basic type %u\n", bt
); return FALSE
;
740 X(WCHAR
*) = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(name
) + 1) * sizeof(WCHAR
));
743 lstrcpyW(X(WCHAR
*), name
);
750 assert(type
->id
>= dbg_itype_first
);
754 case dbg_itype_lguint
:
757 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
758 case TI_GET_LENGTH
: X(DWORD64
) = sizeof(dbg_lguint_t
); break;
759 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
760 default: WINE_FIXME("unsupported %u for lguint_t\n", ti
); return FALSE
;
763 case dbg_itype_lgint
:
766 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
767 case TI_GET_LENGTH
: X(DWORD64
) = sizeof(dbg_lgint_t
); break;
768 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
769 default: WINE_FIXME("unsupported %u for lgint_t\n", ti
); return FALSE
;
772 case dbg_itype_unsigned_long_int
:
775 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
776 case TI_GET_LENGTH
: X(DWORD64
) = ADDRSIZE
; break;
777 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
778 default: WINE_FIXME("unsupported %u for u-long int\n", ti
); return FALSE
;
781 case dbg_itype_signed_long_int
:
784 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
785 case TI_GET_LENGTH
: X(DWORD64
) = ADDRSIZE
; break;
786 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
787 default: WINE_FIXME("unsupported %u for s-long int\n", ti
); return FALSE
;
790 case dbg_itype_unsigned_int
:
793 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
794 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
795 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
796 default: WINE_FIXME("unsupported %u for u-int\n", ti
); return FALSE
;
799 case dbg_itype_signed_int
:
802 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
803 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
804 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
805 default: WINE_FIXME("unsupported %u for s-int\n", ti
); return FALSE
;
808 case dbg_itype_unsigned_short_int
:
811 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
812 case TI_GET_LENGTH
: X(DWORD64
) = 2; break;
813 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
814 default: WINE_FIXME("unsupported %u for u-short int\n", ti
); return FALSE
;
817 case dbg_itype_signed_short_int
:
820 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
821 case TI_GET_LENGTH
: X(DWORD64
) = 2; break;
822 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
823 default: WINE_FIXME("unsupported %u for s-short int\n", ti
); return FALSE
;
826 case dbg_itype_unsigned_char_int
:
829 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
830 case TI_GET_LENGTH
: X(DWORD64
) = 1; break;
831 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
832 default: WINE_FIXME("unsupported %u for u-char int\n", ti
); return FALSE
;
835 case dbg_itype_signed_char_int
:
838 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
839 case TI_GET_LENGTH
: X(DWORD64
) = 1; break;
840 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
841 default: WINE_FIXME("unsupported %u for s-char int\n", ti
); return FALSE
;
847 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
848 case TI_GET_LENGTH
: X(DWORD64
) = 1; break;
849 case TI_GET_BASETYPE
: X(DWORD
) = btChar
; break;
850 default: WINE_FIXME("unsupported %u for char int\n", ti
); return FALSE
;
853 case dbg_itype_astring
:
856 case TI_GET_SYMTAG
: X(DWORD
) = SymTagPointerType
; break;
857 case TI_GET_LENGTH
: X(DWORD64
) = ADDRSIZE
; break;
858 case TI_GET_TYPE
: X(DWORD
) = dbg_itype_char
; break;
859 default: WINE_FIXME("unsupported %u for a string\n", ti
); return FALSE
;
862 case dbg_itype_segptr
:
865 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
866 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
867 case TI_GET_BASETYPE
: X(DWORD
) = btInt
; break;
868 default: WINE_FIXME("unsupported %u for seg-ptr\n", ti
); return FALSE
;
871 case dbg_itype_short_real
:
874 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
875 case TI_GET_LENGTH
: X(DWORD64
) = 4; break;
876 case TI_GET_BASETYPE
: X(DWORD
) = btFloat
; break;
877 default: WINE_FIXME("unsupported %u for short real\n", ti
); return FALSE
;
883 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
884 case TI_GET_LENGTH
: X(DWORD64
) = 8; break;
885 case TI_GET_BASETYPE
: X(DWORD
) = btFloat
; break;
886 default: WINE_FIXME("unsupported %u for real\n", ti
); return FALSE
;
889 case dbg_itype_long_real
:
892 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
893 case TI_GET_LENGTH
: X(DWORD64
) = 10; break;
894 case TI_GET_BASETYPE
: X(DWORD
) = btFloat
; break;
895 default: WINE_FIXME("unsupported %u for long real\n", ti
); return FALSE
;
898 case dbg_itype_m128a
:
901 case TI_GET_SYMTAG
: X(DWORD
) = SymTagBaseType
; break;
902 case TI_GET_LENGTH
: X(DWORD64
) = 16; break;
903 case TI_GET_BASETYPE
: X(DWORD
) = btUInt
; break;
904 default: WINE_FIXME("unsupported %u for XMM register\n", ti
); return FALSE
;
907 default: WINE_FIXME("unsupported type id 0x%x\n", type
->id
);