winedbg: Add support for printing floating point registers.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2017-06-26 14:48:14 -05:00 committed by Alexandre Julliard
parent ad76bbec22
commit 8314cdc45e
3 changed files with 49 additions and 6 deletions

View file

@ -287,6 +287,14 @@ static struct dbg_internal_var be_i386_ctx[] =
{CV_REG_FLAGS, "FLAGS", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, EFlags), dbg_itype_unsigned_short_int},
{CV_REG_EIP, "EIP", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Eip), dbg_itype_unsigned_int},
{CV_REG_EFLAGS, "EFLAGS", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, EFlags), dbg_itype_unsigned_int},
{CV_REG_ST0, "ST0", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, FloatSave.RegisterArea[ 0]), dbg_itype_long_real},
{CV_REG_ST0+1, "ST1", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, FloatSave.RegisterArea[10]), dbg_itype_long_real},
{CV_REG_ST0+2, "ST2", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, FloatSave.RegisterArea[20]), dbg_itype_long_real},
{CV_REG_ST0+3, "ST3", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, FloatSave.RegisterArea[30]), dbg_itype_long_real},
{CV_REG_ST0+4, "ST4", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, FloatSave.RegisterArea[40]), dbg_itype_long_real},
{CV_REG_ST0+5, "ST5", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, FloatSave.RegisterArea[50]), dbg_itype_long_real},
{CV_REG_ST0+6, "ST6", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, FloatSave.RegisterArea[60]), dbg_itype_long_real},
{CV_REG_ST0+7, "ST7", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, FloatSave.RegisterArea[70]), dbg_itype_long_real},
{0, NULL, 0, dbg_itype_none}
};
@ -767,9 +775,9 @@ static BOOL be_i386_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
if (!memory_read_value(lvalue, size, tmp)) return FALSE;
/* float & double types have to be promoted to a long double */
if (size == sizeof(float)) *ret = *(float*)tmp;
else if (size == sizeof(double)) *ret = *(double*)tmp;
else if (size == sizeof(long double)) *ret = *(long double*)tmp;
if (size == 4) *ret = *(float*)tmp;
else if (size == 8) *ret = *(double*)tmp;
else if (size == 10) *ret = *(long double*)tmp;
else return FALSE;
return TRUE;

View file

@ -237,6 +237,14 @@ static struct dbg_internal_var be_x86_64_ctx[] =
{CV_AMD64_R13, "R13", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R13), dbg_itype_unsigned_long_int},
{CV_AMD64_R14, "R14", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R14), dbg_itype_unsigned_long_int},
{CV_AMD64_R15, "R15", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R15), dbg_itype_unsigned_long_int},
{CV_AMD64_ST0, "ST0", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.FltSave.FloatRegisters[0]), dbg_itype_long_real},
{CV_AMD64_ST0+1, "ST1", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.FltSave.FloatRegisters[1]), dbg_itype_long_real},
{CV_AMD64_ST0+2, "ST2", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.FltSave.FloatRegisters[2]), dbg_itype_long_real},
{CV_AMD64_ST0+3, "ST3", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.FltSave.FloatRegisters[3]), dbg_itype_long_real},
{CV_AMD64_ST0+4, "ST4", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.FltSave.FloatRegisters[4]), dbg_itype_long_real},
{CV_AMD64_ST0+5, "ST5", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.FltSave.FloatRegisters[5]), dbg_itype_long_real},
{CV_AMD64_ST0+6, "ST6", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.FltSave.FloatRegisters[6]), dbg_itype_long_real},
{CV_AMD64_ST0+7, "ST7", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.FltSave.FloatRegisters[7]), dbg_itype_long_real},
{0, NULL, 0, dbg_itype_none}
};
@ -631,9 +639,9 @@ static BOOL be_x86_64_fetch_float(const struct dbg_lvalue* lvalue, unsigned size
if (!memory_read_value(lvalue, size, tmp)) return FALSE;
/* float & double types have to be promoted to a long double */
if (size == sizeof(float)) *ret = *(float*)tmp;
else if (size == sizeof(double)) *ret = *(double*)tmp;
else if (size == sizeof(long double)) *ret = *(long double*)tmp;
if (size == 4) *ret = *(float*)tmp;
else if (size == 8) *ret = *(double*)tmp;
else if (size == 10) *ret = *(long double*)tmp;
else return FALSE;
return TRUE;

View file

@ -894,6 +894,33 @@ BOOL types_get_info(const struct dbg_type* type, IMAGEHLP_SYMBOL_TYPE_INFO ti, v
default: WINE_FIXME("unsupported %u for seg-ptr\n", ti); return FALSE;
}
break;
case dbg_itype_short_real:
switch (ti)
{
case TI_GET_SYMTAG: X(DWORD) = SymTagBaseType; break;
case TI_GET_LENGTH: X(DWORD64) = 4; break;
case TI_GET_BASETYPE: X(DWORD) = btFloat; break;
default: WINE_FIXME("unsupported %u for short real\n", ti); return FALSE;
}
break;
case dbg_itype_real:
switch (ti)
{
case TI_GET_SYMTAG: X(DWORD) = SymTagBaseType; break;
case TI_GET_LENGTH: X(DWORD64) = 8; break;
case TI_GET_BASETYPE: X(DWORD) = btFloat; break;
default: WINE_FIXME("unsupported %u for real\n", ti); return FALSE;
}
break;
case dbg_itype_long_real:
switch (ti)
{
case TI_GET_SYMTAG: X(DWORD) = SymTagBaseType; break;
case TI_GET_LENGTH: X(DWORD64) = 10; break;
case TI_GET_BASETYPE: X(DWORD) = btFloat; break;
default: WINE_FIXME("unsupported %u for long real\n", ti); return FALSE;
}
break;
default: WINE_FIXME("unsupported type id 0x%lx\n", type->id);
}