winedbg: Added basic support for printing 64bit wide entities.
This commit is contained in:
parent
135f2e1b79
commit
7ca25148f4
|
@ -392,6 +392,7 @@ extern void print_value(const struct dbg_lvalue* addr, char format,
|
||||||
extern int types_print_type(const struct dbg_type*, BOOL details);
|
extern int types_print_type(const struct dbg_type*, BOOL details);
|
||||||
extern int print_types(void);
|
extern int print_types(void);
|
||||||
extern long int types_extract_as_integer(const struct dbg_lvalue*);
|
extern long int types_extract_as_integer(const struct dbg_lvalue*);
|
||||||
|
extern LONGLONG types_extract_as_longlong(const struct dbg_lvalue*);
|
||||||
extern void types_extract_as_address(const struct dbg_lvalue*, ADDRESS64*);
|
extern void types_extract_as_address(const struct dbg_lvalue*, ADDRESS64*);
|
||||||
extern BOOL types_deref(const struct dbg_lvalue* value, struct dbg_lvalue* result);
|
extern BOOL types_deref(const struct dbg_lvalue* value, struct dbg_lvalue* result);
|
||||||
extern BOOL types_udt_find_element(struct dbg_lvalue* value, const char* name, long int* tmpbuf);
|
extern BOOL types_udt_find_element(struct dbg_lvalue* value, const char* name, long int* tmpbuf);
|
||||||
|
|
|
@ -466,7 +466,7 @@ static void print_typed_basic(const struct dbg_lvalue* lvalue)
|
||||||
*/
|
*/
|
||||||
void print_basic(const struct dbg_lvalue* lvalue, int count, char format)
|
void print_basic(const struct dbg_lvalue* lvalue, int count, char format)
|
||||||
{
|
{
|
||||||
long int res;
|
LONGLONG res;
|
||||||
|
|
||||||
if (lvalue->type.id == dbg_itype_none)
|
if (lvalue->type.id == dbg_itype_none)
|
||||||
{
|
{
|
||||||
|
@ -474,17 +474,18 @@ void print_basic(const struct dbg_lvalue* lvalue, int count, char format)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = types_extract_as_integer(lvalue);
|
res = types_extract_as_longlong(lvalue);
|
||||||
|
|
||||||
/* FIXME: this implies i386 byte ordering */
|
/* FIXME: this implies i386 byte ordering */
|
||||||
switch (format)
|
switch (format)
|
||||||
{
|
{
|
||||||
case 'x':
|
case 'x':
|
||||||
dbg_printf("0x%lx", res);
|
dbg_printf("0x%lx", (DWORD)(ULONG64)res);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
dbg_printf("%ld\n", res);
|
dbg_print_longlong(res, TRUE);
|
||||||
|
dbg_printf("\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'c':
|
case 'c':
|
||||||
|
@ -507,7 +508,10 @@ void print_basic(const struct dbg_lvalue* lvalue, int count, char format)
|
||||||
dbg_printf("Format specifier '%c' is meaningless in 'print' command\n", format);
|
dbg_printf("Format specifier '%c' is meaningless in 'print' command\n", format);
|
||||||
case 0:
|
case 0:
|
||||||
if (lvalue->type.id == dbg_itype_segptr)
|
if (lvalue->type.id == dbg_itype_segptr)
|
||||||
dbg_printf("%ld", res);
|
{
|
||||||
|
dbg_print_longlong(res, TRUE);
|
||||||
|
dbg_printf("\n");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
print_typed_basic(lvalue);
|
print_typed_basic(lvalue);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -48,15 +48,14 @@ BOOL types_get_real_type(struct dbg_type* type, DWORD* tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* types_extract_as_integer
|
* types_extract_as_longlong
|
||||||
*
|
*
|
||||||
* Given a lvalue, try to get an integral (or pointer/address) value
|
* Given a lvalue, try to get an integral (or pointer/address) value
|
||||||
* out of it
|
* out of it
|
||||||
*/
|
*/
|
||||||
long int types_extract_as_integer(const struct dbg_lvalue* lvalue)
|
LONGLONG types_extract_as_longlong(const struct dbg_lvalue* lvalue)
|
||||||
{
|
{
|
||||||
long int rtn;
|
LONGLONG rtn;
|
||||||
LONGLONG val;
|
|
||||||
DWORD tag, bt;
|
DWORD tag, bt;
|
||||||
DWORD64 size;
|
DWORD64 size;
|
||||||
struct dbg_type type = lvalue->type;
|
struct dbg_type type = lvalue->type;
|
||||||
|
@ -87,30 +86,29 @@ long int types_extract_as_integer(const struct dbg_lvalue* lvalue)
|
||||||
{
|
{
|
||||||
case btChar:
|
case btChar:
|
||||||
case btInt:
|
case btInt:
|
||||||
if (!be_cpu->fetch_integer(lvalue, (unsigned)size, TRUE, &val))
|
if (!be_cpu->fetch_integer(lvalue, (unsigned)size, TRUE, &rtn))
|
||||||
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
|
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
|
||||||
rtn = (long)val;
|
|
||||||
break;
|
break;
|
||||||
case btUInt:
|
case btUInt:
|
||||||
if (!be_cpu->fetch_integer(lvalue, (unsigned)size, FALSE, &val))
|
if (!be_cpu->fetch_integer(lvalue, (unsigned)size, FALSE, &rtn))
|
||||||
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
|
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
|
||||||
rtn = (DWORD)(DWORD64)val;
|
|
||||||
break;
|
break;
|
||||||
case btFloat:
|
case btFloat:
|
||||||
RaiseException(DEBUG_STATUS_NOT_AN_INTEGER, 0, 0, NULL);
|
RaiseException(DEBUG_STATUS_NOT_AN_INTEGER, 0, 0, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SymTagPointerType:
|
case SymTagPointerType:
|
||||||
if (!memory_read_value(lvalue, sizeof(void*), &rtn))
|
if (!be_cpu->fetch_integer(lvalue, sizeof(void*), FALSE, &rtn))
|
||||||
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
|
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
|
||||||
break;
|
break;
|
||||||
case SymTagArrayType:
|
case SymTagArrayType:
|
||||||
case SymTagUDT:
|
case SymTagUDT:
|
||||||
if (!memory_read_value(lvalue, sizeof(rtn), &rtn))
|
if (!be_cpu->fetch_integer(lvalue, sizeof(unsigned), FALSE, &rtn))
|
||||||
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
|
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
|
||||||
break;
|
break;
|
||||||
case SymTagEnum:
|
case SymTagEnum:
|
||||||
if (!memory_read_value(lvalue, sizeof(rtn), &rtn))
|
/* FIXME: we don't handle enum size */
|
||||||
|
if (!be_cpu->fetch_integer(lvalue, sizeof(unsigned), FALSE, &rtn))
|
||||||
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
|
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
|
||||||
break;
|
break;
|
||||||
case SymTagFunctionType:
|
case SymTagFunctionType:
|
||||||
|
@ -125,6 +123,17 @@ long int types_extract_as_integer(const struct dbg_lvalue* lvalue)
|
||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************************************************************
|
||||||
|
* types_extract_as_integer
|
||||||
|
*
|
||||||
|
* Given a lvalue, try to get an integral (or pointer/address) value
|
||||||
|
* out of it
|
||||||
|
*/
|
||||||
|
long int types_extract_as_integer(const struct dbg_lvalue* lvalue)
|
||||||
|
{
|
||||||
|
return types_extract_as_longlong(lvalue);
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* types_extract_as_address
|
* types_extract_as_address
|
||||||
*
|
*
|
||||||
|
@ -139,7 +148,7 @@ void types_extract_as_address(const struct dbg_lvalue* lvalue, ADDRESS64* addr)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
addr->Mode = AddrModeFlat;
|
addr->Mode = AddrModeFlat;
|
||||||
addr->Offset = types_extract_as_integer( lvalue );
|
addr->Offset = types_extract_as_longlong( lvalue );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue