oleaut32: Use debugstr_variant for dump_Variant implementation.

This commit is contained in:
Jacek Caban 2014-05-23 15:40:39 +02:00 committed by Alexandre Julliard
parent 5614770c24
commit 18a42e0211
2 changed files with 34 additions and 53 deletions

View File

@ -1539,57 +1539,7 @@ static void dump_TLBImplType(const TLBImplType * impl, UINT n)
static void dump_Variant(const VARIANT * pvar) static void dump_Variant(const VARIANT * pvar)
{ {
SYSTEMTIME st; TRACE("%s\n", debugstr_variant(pvar));
TRACE("%p->{%s", pvar, debugstr_vt(V_VT(pvar)));
if (pvar)
{
if (V_ISBYREF(pvar) || V_TYPE(pvar) == VT_UNKNOWN ||
V_TYPE(pvar) == VT_DISPATCH || V_TYPE(pvar) == VT_RECORD)
{
TRACE(",%p", V_BYREF(pvar));
}
else if (V_ISARRAY(pvar) || V_ISVECTOR(pvar))
{
TRACE(",%p", V_ARRAY(pvar));
}
else switch (V_TYPE(pvar))
{
case VT_I1: TRACE(",%d", V_I1(pvar)); break;
case VT_UI1: TRACE(",%d", V_UI1(pvar)); break;
case VT_I2: TRACE(",%d", V_I2(pvar)); break;
case VT_UI2: TRACE(",%d", V_UI2(pvar)); break;
case VT_INT:
case VT_I4: TRACE(",%d", V_I4(pvar)); break;
case VT_UINT:
case VT_UI4: TRACE(",%d", V_UI4(pvar)); break;
case VT_I8: TRACE(",0x%08x,0x%08x", (ULONG)(V_I8(pvar) >> 32),
(ULONG)(V_I8(pvar) & 0xffffffff)); break;
case VT_UI8: TRACE(",0x%08x,0x%08x", (ULONG)(V_UI8(pvar) >> 32),
(ULONG)(V_UI8(pvar) & 0xffffffff)); break;
case VT_R4: TRACE(",%3.3e", V_R4(pvar)); break;
case VT_R8: TRACE(",%3.3e", V_R8(pvar)); break;
case VT_BOOL: TRACE(",%s", V_BOOL(pvar) ? "TRUE" : "FALSE"); break;
case VT_BSTR: TRACE(",%s", debugstr_w(V_BSTR(pvar))); break;
case VT_CY: TRACE(",0x%08x,0x%08x", V_CY(pvar).s.Hi,
V_CY(pvar).s.Lo); break;
case VT_DATE:
if(!VariantTimeToSystemTime(V_DATE(pvar), &st))
TRACE(",<invalid>");
else
TRACE(",%04d/%02d/%02d %02d:%02d:%02d", st.wYear, st.wMonth, st.wDay,
st.wHour, st.wMinute, st.wSecond);
break;
case VT_ERROR:
case VT_VOID:
case VT_USERDEFINED:
case VT_EMPTY:
case VT_NULL: break;
default: TRACE(",?"); break;
}
}
TRACE("}\n");
} }
static void dump_DispParms(const DISPPARAMS * pdp) static void dump_DispParms(const DISPPARAMS * pdp)

View File

@ -98,13 +98,20 @@ const char *debugstr_variant(const VARIANT *v)
if(!v) if(!v)
return "(null)"; return "(null)";
if(V_VT(v) & VT_BYREF) {
if(V_VT(v) == (VT_VARIANT|VT_BYREF))
return wine_dbg_sprintf("%p {VT_VARIANT|VT_BYREF: %s}", v, debugstr_variant(V_VARIANTREF(v)));
return wine_dbg_sprintf("%p {%s %p}", v, debugstr_vt(V_VT(v)), V_BYREF(v));
}
if(V_ISARRAY(v) || V_ISVECTOR(v))
return wine_dbg_sprintf("%p {%s %p}", v, debugstr_vt(V_VT(v)), V_ARRAY(v));
switch(V_VT(v)) { switch(V_VT(v)) {
case VT_EMPTY: case VT_EMPTY:
return wine_dbg_sprintf("%p {VT_EMPTY}", v); return wine_dbg_sprintf("%p {VT_EMPTY}", v);
case VT_NULL: case VT_NULL:
return wine_dbg_sprintf("%p {VT_NULL}", v); return wine_dbg_sprintf("%p {VT_NULL}", v);
case VT_I1:
return wine_dbg_sprintf("%p {VT_I1: %d}", v, V_I1(v));
case VT_I2: case VT_I2:
return wine_dbg_sprintf("%p {VT_I2: %d}", v, V_I2(v)); return wine_dbg_sprintf("%p {VT_I2: %d}", v, V_I2(v));
case VT_I4: case VT_I4:
@ -113,6 +120,10 @@ const char *debugstr_variant(const VARIANT *v)
return wine_dbg_sprintf("%p {VT_R4: %f}", v, V_R4(v)); return wine_dbg_sprintf("%p {VT_R4: %f}", v, V_R4(v));
case VT_R8: case VT_R8:
return wine_dbg_sprintf("%p {VT_R8: %lf}", v, V_R8(v)); return wine_dbg_sprintf("%p {VT_R8: %lf}", v, V_R8(v));
case VT_CY:
return wine_dbg_sprintf("%p {VT_CY: %s}", v, wine_dbgstr_longlong(V_CY(v).int64));
case VT_DATE:
return wine_dbg_sprintf("%p {VT_DATE: %lf}", v, V_DATE(v));
case VT_BSTR: case VT_BSTR:
return wine_dbg_sprintf("%p {VT_BSTR: %s}", v, debugstr_w(V_BSTR(v))); return wine_dbg_sprintf("%p {VT_BSTR: %s}", v, debugstr_w(V_BSTR(v)));
case VT_DISPATCH: case VT_DISPATCH:
@ -121,8 +132,28 @@ const char *debugstr_variant(const VARIANT *v)
return wine_dbg_sprintf("%p {VT_ERROR: %08x}", v, V_ERROR(v)); return wine_dbg_sprintf("%p {VT_ERROR: %08x}", v, V_ERROR(v));
case VT_BOOL: case VT_BOOL:
return wine_dbg_sprintf("%p {VT_BOOL: %x}", v, V_BOOL(v)); return wine_dbg_sprintf("%p {VT_BOOL: %x}", v, V_BOOL(v));
case VT_UNKNOWN:
return wine_dbg_sprintf("%p {VT_UNKNOWN: %p}", v, V_UNKNOWN(v));
case VT_I1:
return wine_dbg_sprintf("%p {VT_I1: %d}", v, V_I1(v));
case VT_UI1:
return wine_dbg_sprintf("%p {VT_UI1: %u}", v, V_UI1(v));
case VT_UI2:
return wine_dbg_sprintf("%p {VT_UI2: %d}", v, V_UI2(v));
case VT_UI4:
return wine_dbg_sprintf("%p {VT_UI4: %d}", v, V_UI4(v));
case VT_I8:
return wine_dbg_sprintf("%p {VT_I8: %s}", v, wine_dbgstr_longlong(V_I8(v)));
case VT_UI8:
return wine_dbg_sprintf("%p {VT_UI8: %s}", v, wine_dbgstr_longlong(V_UI8(v)));
case VT_INT:
return wine_dbg_sprintf("%p {VT_INT: %d}", v, V_INT(v));
case VT_UINT: case VT_UINT:
return wine_dbg_sprintf("%p {VT_UINT: %u}", v, V_UINT(v)); return wine_dbg_sprintf("%p {VT_UINT: %u}", v, V_UINT(v));
case VT_VOID:
return wine_dbg_sprintf("%p {VT_VOID}", v);
case VT_RECORD:
return wine_dbg_sprintf("%p {VT_RECORD: %p %p}", v, V_UNION(v,brecVal).pvRecord, V_UNION(v,brecVal).pRecInfo);
default: default:
return wine_dbg_sprintf("%p {vt %s}", v, debugstr_vt(V_VT(v))); return wine_dbg_sprintf("%p {vt %s}", v, debugstr_vt(V_VT(v)));
} }