Commit 77f84fd4 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winedbg: Don't pretend that all dbg_internal_var instances will hold DWORD_PTR.

parent 0e7d1a60
......@@ -1722,23 +1722,23 @@ static void be_arm_print_segment_info(HANDLE hThread, const dbg_ctx_t *ctx)
static struct dbg_internal_var be_arm_ctx[] =
{
{CV_ARM_R0 + 0, "r0", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R0), dbg_itype_unsigned_int},
{CV_ARM_R0 + 1, "r1", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R1), dbg_itype_unsigned_int},
{CV_ARM_R0 + 2, "r2", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R2), dbg_itype_unsigned_int},
{CV_ARM_R0 + 3, "r3", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R3), dbg_itype_unsigned_int},
{CV_ARM_R0 + 4, "r4", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R4), dbg_itype_unsigned_int},
{CV_ARM_R0 + 5, "r5", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R5), dbg_itype_unsigned_int},
{CV_ARM_R0 + 6, "r6", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R6), dbg_itype_unsigned_int},
{CV_ARM_R0 + 7, "r7", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R7), dbg_itype_unsigned_int},
{CV_ARM_R0 + 8, "r8", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R8), dbg_itype_unsigned_int},
{CV_ARM_R0 + 9, "r9", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R9), dbg_itype_unsigned_int},
{CV_ARM_R0 + 10, "r10", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R10), dbg_itype_unsigned_int},
{CV_ARM_R0 + 11, "r11", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R11), dbg_itype_unsigned_int},
{CV_ARM_R0 + 12, "r12", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, R12), dbg_itype_unsigned_int},
{CV_ARM_SP, "sp", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Sp), dbg_itype_unsigned_int},
{CV_ARM_LR, "lr", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Lr), dbg_itype_unsigned_int},
{CV_ARM_PC, "pc", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Pc), dbg_itype_unsigned_int},
{CV_ARM_CPSR, "cpsr", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Cpsr), dbg_itype_unsigned_int},
{CV_ARM_R0 + 0, "r0", (void*)FIELD_OFFSET(CONTEXT, R0), dbg_itype_unsigned_int},
{CV_ARM_R0 + 1, "r1", (void*)FIELD_OFFSET(CONTEXT, R1), dbg_itype_unsigned_int},
{CV_ARM_R0 + 2, "r2", (void*)FIELD_OFFSET(CONTEXT, R2), dbg_itype_unsigned_int},
{CV_ARM_R0 + 3, "r3", (void*)FIELD_OFFSET(CONTEXT, R3), dbg_itype_unsigned_int},
{CV_ARM_R0 + 4, "r4", (void*)FIELD_OFFSET(CONTEXT, R4), dbg_itype_unsigned_int},
{CV_ARM_R0 + 5, "r5", (void*)FIELD_OFFSET(CONTEXT, R5), dbg_itype_unsigned_int},
{CV_ARM_R0 + 6, "r6", (void*)FIELD_OFFSET(CONTEXT, R6), dbg_itype_unsigned_int},
{CV_ARM_R0 + 7, "r7", (void*)FIELD_OFFSET(CONTEXT, R7), dbg_itype_unsigned_int},
{CV_ARM_R0 + 8, "r8", (void*)FIELD_OFFSET(CONTEXT, R8), dbg_itype_unsigned_int},
{CV_ARM_R0 + 9, "r9", (void*)FIELD_OFFSET(CONTEXT, R9), dbg_itype_unsigned_int},
{CV_ARM_R0 + 10, "r10", (void*)FIELD_OFFSET(CONTEXT, R10), dbg_itype_unsigned_int},
{CV_ARM_R0 + 11, "r11", (void*)FIELD_OFFSET(CONTEXT, R11), dbg_itype_unsigned_int},
{CV_ARM_R0 + 12, "r12", (void*)FIELD_OFFSET(CONTEXT, R12), dbg_itype_unsigned_int},
{CV_ARM_SP, "sp", (void*)FIELD_OFFSET(CONTEXT, Sp), dbg_itype_unsigned_int},
{CV_ARM_LR, "lr", (void*)FIELD_OFFSET(CONTEXT, Lr), dbg_itype_unsigned_int},
{CV_ARM_PC, "pc", (void*)FIELD_OFFSET(CONTEXT, Pc), dbg_itype_unsigned_int},
{CV_ARM_CPSR, "cpsr", (void*)FIELD_OFFSET(CONTEXT, Cpsr), dbg_itype_unsigned_int},
{0, NULL, 0, dbg_itype_none}
};
......
......@@ -104,41 +104,41 @@ static void be_arm64_print_segment_info(HANDLE hThread, const dbg_ctx_t *ctx)
static struct dbg_internal_var be_arm64_ctx[] =
{
{CV_ARM64_PSTATE, "cpsr", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Cpsr), dbg_itype_unsigned_int},
{CV_ARM64_X0 + 0, "x0", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X0), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 1, "x1", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X1), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 2, "x2", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X2), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 3, "x3", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X3), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 4, "x4", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X4), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 5, "x5", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X5), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 6, "x6", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X6), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 7, "x7", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X7), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 8, "x8", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X8), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 9, "x9", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X9), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 10, "x10", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X10), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 11, "x11", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X11), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 12, "x12", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X12), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 13, "x13", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X13), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 14, "x14", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X14), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 15, "x15", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X15), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 16, "x16", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X16), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 17, "x17", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X17), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 18, "x18", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X18), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 19, "x19", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X19), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 20, "x20", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X20), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 21, "x21", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X21), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 22, "x22", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X22), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 23, "x23", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X23), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 24, "x24", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X24), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 25, "x25", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X25), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 26, "x26", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X26), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 27, "x27", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X27), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 28, "x28", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X28), dbg_itype_unsigned_long_int},
{CV_ARM64_FP, "fp", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.Fp), dbg_itype_unsigned_long_int},
{CV_ARM64_LR, "lr", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.Lr), dbg_itype_unsigned_long_int},
{CV_ARM64_SP, "sp", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Sp), dbg_itype_unsigned_long_int},
{CV_ARM64_PC, "pc", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Pc), dbg_itype_unsigned_long_int},
{0, NULL, 0, dbg_itype_none}
{CV_ARM64_PSTATE, "cpsr", (void*)FIELD_OFFSET(CONTEXT, Cpsr), dbg_itype_unsigned_int},
{CV_ARM64_X0 + 0, "x0", (void*)FIELD_OFFSET(CONTEXT, u.s.X0), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 1, "x1", (void*)FIELD_OFFSET(CONTEXT, u.s.X1), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 2, "x2", (void*)FIELD_OFFSET(CONTEXT, u.s.X2), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 3, "x3", (void*)FIELD_OFFSET(CONTEXT, u.s.X3), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 4, "x4", (void*)FIELD_OFFSET(CONTEXT, u.s.X4), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 5, "x5", (void*)FIELD_OFFSET(CONTEXT, u.s.X5), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 6, "x6", (void*)FIELD_OFFSET(CONTEXT, u.s.X6), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 7, "x7", (void*)FIELD_OFFSET(CONTEXT, u.s.X7), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 8, "x8", (void*)FIELD_OFFSET(CONTEXT, u.s.X8), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 9, "x9", (void*)FIELD_OFFSET(CONTEXT, u.s.X9), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 10, "x10", (void*)FIELD_OFFSET(CONTEXT, u.s.X10), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 11, "x11", (void*)FIELD_OFFSET(CONTEXT, u.s.X11), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 12, "x12", (void*)FIELD_OFFSET(CONTEXT, u.s.X12), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 13, "x13", (void*)FIELD_OFFSET(CONTEXT, u.s.X13), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 14, "x14", (void*)FIELD_OFFSET(CONTEXT, u.s.X14), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 15, "x15", (void*)FIELD_OFFSET(CONTEXT, u.s.X15), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 16, "x16", (void*)FIELD_OFFSET(CONTEXT, u.s.X16), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 17, "x17", (void*)FIELD_OFFSET(CONTEXT, u.s.X17), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 18, "x18", (void*)FIELD_OFFSET(CONTEXT, u.s.X18), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 19, "x19", (void*)FIELD_OFFSET(CONTEXT, u.s.X19), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 20, "x20", (void*)FIELD_OFFSET(CONTEXT, u.s.X20), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 21, "x21", (void*)FIELD_OFFSET(CONTEXT, u.s.X21), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 22, "x22", (void*)FIELD_OFFSET(CONTEXT, u.s.X22), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 23, "x23", (void*)FIELD_OFFSET(CONTEXT, u.s.X23), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 24, "x24", (void*)FIELD_OFFSET(CONTEXT, u.s.X24), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 25, "x25", (void*)FIELD_OFFSET(CONTEXT, u.s.X25), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 26, "x26", (void*)FIELD_OFFSET(CONTEXT, u.s.X26), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 27, "x27", (void*)FIELD_OFFSET(CONTEXT, u.s.X27), dbg_itype_unsigned_long_int},
{CV_ARM64_X0 + 28, "x28", (void*)FIELD_OFFSET(CONTEXT, u.s.X28), dbg_itype_unsigned_long_int},
{CV_ARM64_FP, "fp", (void*)FIELD_OFFSET(CONTEXT, u.s.Fp), dbg_itype_unsigned_long_int},
{CV_ARM64_LR, "lr", (void*)FIELD_OFFSET(CONTEXT, u.s.Lr), dbg_itype_unsigned_long_int},
{CV_ARM64_SP, "sp", (void*)FIELD_OFFSET(CONTEXT, Sp), dbg_itype_unsigned_long_int},
{CV_ARM64_PC, "pc", (void*)FIELD_OFFSET(CONTEXT, Pc), dbg_itype_unsigned_long_int},
{0, NULL, 0, dbg_itype_none}
};
static BOOL be_arm64_is_step_over_insn(const void* insn)
......
......@@ -255,8 +255,8 @@ extern HANDLE dbg_houtput;
struct dbg_internal_var
{
DWORD_PTR val;
const char* name;
DWORD_PTR *pval;
const char* name;
void* pval;
ULONG typeid; /* always internal type */
};
......@@ -509,7 +509,7 @@ extern struct dbg_internal_var dbg_internal_vars[];
#define DBG_IVARNAME(_var) dbg_internal_var_##_var
#define DBG_IVARSTRUCT(_var) dbg_internal_vars[DBG_IVARNAME(_var)]
#define DBG_IVAR(_var) (*(DBG_IVARSTRUCT(_var).pval))
#define DBG_IVAR(_var) (DBG_IVARSTRUCT(_var).val)
#define INTERNAL_VAR(_var,_val,_ref,itype) DBG_IVARNAME(_var),
enum debug_int_var
{
......
......@@ -240,7 +240,7 @@ const struct dbg_internal_var* dbg_get_internal_var(const char* name)
struct dbg_internal_var* ret = (void*)lexeme_alloc_size(sizeof(*ret));
/* relocate register's field against current context */
*ret = *div;
ret->pval = (DWORD_PTR*)((char*)&dbg_context + (DWORD_PTR)div->pval);
ret->pval = (char*)&dbg_context + (DWORD_PTR)div->pval;
return ret;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment