wine/programs/winedbg types.c

Alexandre Julliard julliard at wine.codeweavers.com
Fri Nov 18 10:53:32 CST 2005


ChangeSet ID:	21344
CVSROOT:	/opt/cvs-commit
Module name:	wine
Changes by:	julliard at winehq.org	2005/11/18 10:53:32

Modified files:
	programs/winedbg: types.c 

Log message:
	Eric Pouech <eric.pouech at wanadoo.fr>
	Native dbghelp doesn't provide names for basic type, so added relevant
	basic type names in winedbg.

Patch: http://cvs.winehq.org/patch.py?id=21344

Old revision  New revision  Changes     Path
 1.16          1.17          +46 -3      wine/programs/winedbg/types.c

Index: wine/programs/winedbg/types.c
diff -u -p wine/programs/winedbg/types.c:1.16 wine/programs/winedbg/types.c:1.17
--- wine/programs/winedbg/types.c:1.16	18 Nov 2005 16:53:32 -0000
+++ wine/programs/winedbg/types.c	18 Nov 2005 16:53:32 -0000
@@ -646,15 +646,58 @@ int types_print_type(const struct dbg_ty
     return TRUE;
 }
 
+/* helper to typecast pInfo to its expected type (_t) */
+#define X(_t) (*((_t*)pInfo))
+
 BOOL types_get_info(const struct dbg_type* type, IMAGEHLP_SYMBOL_TYPE_INFO ti, void* pInfo)
 {
     if (type->id == dbg_itype_none) return FALSE;
     if (type->module != 0)
-        return SymGetTypeInfo(dbg_curr_process->handle, type->module, type->id, ti, pInfo);
+    {
+        DWORD ret, tag, bt;
+        ret = SymGetTypeInfo(dbg_curr_process->handle, type->module, type->id, ti, pInfo);
+        if (!ret &&
+            SymGetTypeInfo(dbg_curr_process->handle, type->module, type->id, TI_GET_SYMTAG, &tag) &&
+            tag == SymTagBaseType &&
+            SymGetTypeInfo(dbg_curr_process->handle, type->module, type->id, TI_GET_BASETYPE, &bt))
+        {
+            static const WCHAR voidW[] = {'v','o','i','d','\0'};
+            static const WCHAR charW[] = {'c','h','a','r','\0'};
+            static const WCHAR wcharW[] = {'W','C','H','A','R','\0'};
+            static const WCHAR intW[] = {'i','n','t','\0'};
+            static const WCHAR uintW[] = {'u','n','s','i','g','n','e','d',' ','i','n','t','\0'};
+            static const WCHAR floatW[] = {'f','l','o','a','t','\0'};
+            static const WCHAR boolW[] = {'b','o','o','l','\0'};
+            static const WCHAR longW[] = {'l','o','n','g',' ','i','n','t','\0'};
+            static const WCHAR ulongW[] = {'u','n','s','i','g','n','e','d',' ','l','o','n','g',' ','i','n','t','\0'};
+            static const WCHAR complexW[] = {'c','o','m','p','l','e','x','\0'};
+            const WCHAR* name = NULL;
+
+            switch (bt)
+            {
+            case btVoid:        name = voidW; break;
+            case btChar:        name = charW; break;
+            case btWChar:       name = wcharW; break;
+            case btInt:         name = intW; break;
+            case btUInt:        name = uintW; break;
+            case btFloat:       name = floatW; break;
+            case btBool:        name = boolW; break;
+            case btLong:        name = longW; break;
+            case btULong:       name = ulongW; break;
+            case btComplex:     name = complexW; break;
+            default:            WINE_FIXME("Unsupported basic type %ld\n", bt); return FALSE;
+            }
+            X(WCHAR*) = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(name) + 1) * sizeof(WCHAR));
+            if (X(WCHAR*))
+            {
+                lstrcpyW(X(WCHAR*), name);
+                ret = TRUE;
+            }
+        }
+        return ret;
+    }
 
     assert(type->id >= dbg_itype_first);
-/* helper to typecast pInfo to its expected type (_t) */
-#define X(_t) (*((_t*)pInfo))
 
     switch (type->id)
     {



More information about the wine-cvs mailing list