mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-14 18:55:37 +00:00
winedbg: Improve the register conversion to support over 64-bit registers.
This commit is contained in:
parent
b2de0880ec
commit
e06fd8d003
|
@ -447,6 +447,10 @@ static inline DWORD64 cpu_register(CONTEXT* ctx, unsigned idx)
|
|||
|
||||
static inline void cpu_register_hex_from(CONTEXT* ctx, unsigned idx, const char** phex)
|
||||
{
|
||||
if (cpu_register_map[idx].gdb_length == cpu_register_map[idx].ctx_length)
|
||||
hex_from(cpu_register_ptr(ctx, idx), *phex, cpu_register_map[idx].gdb_length);
|
||||
else
|
||||
{
|
||||
DWORD64 val = 0;
|
||||
unsigned i;
|
||||
BYTE b;
|
||||
|
@ -464,6 +468,7 @@ static inline void cpu_register_hex_from(CONTEXT* ctx, unsigned idx, const
|
|||
case 8: *(DWORD64*)cpu_register_ptr(ctx, idx) = val; break;
|
||||
default: assert(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* =============================================== *
|
||||
|
@ -1010,6 +1015,10 @@ static enum packet_return packet_reply_error(struct gdb_context* gdbctx, int err
|
|||
|
||||
static inline void packet_reply_register_hex_to(struct gdb_context* gdbctx, unsigned idx)
|
||||
{
|
||||
if (cpu_register_map[idx].gdb_length == cpu_register_map[idx].ctx_length)
|
||||
packet_reply_hex_to(gdbctx, cpu_register_ptr(&gdbctx->context, idx), cpu_register_map[idx].gdb_length);
|
||||
else
|
||||
{
|
||||
DWORD64 val = cpu_register(&gdbctx->context, idx);
|
||||
unsigned i;
|
||||
|
||||
|
@ -1019,6 +1028,7 @@ static inline void packet_reply_register_hex_to(struct gdb_context* gdbctx, unsi
|
|||
packet_reply_hex_to(gdbctx, &b, 1);
|
||||
val >>= 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* =============================================== *
|
||||
|
@ -1573,8 +1583,13 @@ static enum packet_return packet_read_register(struct gdb_context* gdbctx)
|
|||
return packet_error;
|
||||
}
|
||||
if (gdbctx->trace & GDBPXY_TRC_COMMAND)
|
||||
{
|
||||
if (cpu_register_map[reg].ctx_length <= sizeof(DWORD64))
|
||||
fprintf(stderr, "Read register %x => %08x%08x\n", reg,
|
||||
(unsigned)(cpu_register(pctx, reg) >> 32), (unsigned)cpu_register(pctx, reg));
|
||||
else
|
||||
fprintf(stderr, "Read register %x\n", reg);
|
||||
}
|
||||
packet_reply_open(gdbctx);
|
||||
packet_reply_register_hex_to(gdbctx, reg);
|
||||
packet_reply_close(gdbctx);
|
||||
|
|
Loading…
Reference in a new issue