ntdll: Update the ARM64 CONTEXT struct to match Win SDK 10.0.16299.0.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Martin Storsjo 2018-03-18 21:11:18 +02:00 committed by Alexandre Julliard
parent 04ec181c6c
commit e0780c258f
5 changed files with 27 additions and 27 deletions

View File

@ -41,7 +41,7 @@ static BOOL arm64_get_addr(HANDLE hThread, const CONTEXT* ctx,
#ifdef __aarch64__ #ifdef __aarch64__
case cpu_addr_pc: addr->Offset = ctx->Pc; return TRUE; case cpu_addr_pc: addr->Offset = ctx->Pc; return TRUE;
case cpu_addr_stack: addr->Offset = ctx->Sp; return TRUE; case cpu_addr_stack: addr->Offset = ctx->Sp; return TRUE;
case cpu_addr_frame: addr->Offset = ctx->Fp; return TRUE; case cpu_addr_frame: addr->Offset = ctx->u.s.Fp; return TRUE;
#endif #endif
default: addr->Mode = -1; default: addr->Mode = -1;
return FALSE; return FALSE;
@ -69,7 +69,7 @@ static BOOL fetch_next_frame(struct cpu_stack_walk* csw,
CONTEXT* context, DWORD_PTR curr_pc) CONTEXT* context, DWORD_PTR curr_pc)
{ {
DWORD_PTR xframe; DWORD_PTR xframe;
DWORD_PTR oldReturn = context->Lr; DWORD_PTR oldReturn = context->u.s.Lr;
if (dwarf2_virtual_unwind(csw, curr_pc, context, &xframe)) if (dwarf2_virtual_unwind(csw, curr_pc, context, &xframe))
{ {
@ -78,7 +78,7 @@ static BOOL fetch_next_frame(struct cpu_stack_walk* csw,
return TRUE; return TRUE;
} }
if (context->Pc == context->Lr) return FALSE; if (context->Pc == context->u.s.Lr) return FALSE;
context->Pc = oldReturn; context->Pc = oldReturn;
return TRUE; return TRUE;
@ -123,8 +123,8 @@ static BOOL arm64_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, C
/* set frame information */ /* set frame information */
frame->AddrStack.Offset = context->Sp; frame->AddrStack.Offset = context->Sp;
frame->AddrReturn.Offset = context->Lr; frame->AddrReturn.Offset = context->u.s.Lr;
frame->AddrFrame.Offset = context->Fp; frame->AddrFrame.Offset = context->u.s.Fp;
frame->AddrPC.Offset = context->Pc; frame->AddrPC.Offset = context->Pc;
frame->Far = TRUE; frame->Far = TRUE;
@ -198,8 +198,8 @@ static void* arm64_fetch_context_reg(CONTEXT* ctx, unsigned regno, unsigned* siz
case CV_ARM64_X0 + 27: case CV_ARM64_X0 + 27:
case CV_ARM64_X0 + 28: *size = sizeof(ctx->u.X[0]); return &ctx->u.X[regno - CV_ARM64_X0]; case CV_ARM64_X0 + 28: *size = sizeof(ctx->u.X[0]); return &ctx->u.X[regno - CV_ARM64_X0];
case CV_ARM64_PSTATE: *size = sizeof(ctx->Cpsr); return &ctx->Cpsr; case CV_ARM64_PSTATE: *size = sizeof(ctx->Cpsr); return &ctx->Cpsr;
case CV_ARM64_FP: *size = sizeof(ctx->Fp); return &ctx->Fp; case CV_ARM64_FP: *size = sizeof(ctx->u.s.Fp); return &ctx->u.s.Fp;
case CV_ARM64_LR: *size = sizeof(ctx->Lr); return &ctx->Lr; case CV_ARM64_LR: *size = sizeof(ctx->u.s.Lr); return &ctx->u.s.Lr;
case CV_ARM64_SP: *size = sizeof(ctx->Sp); return &ctx->Sp; case CV_ARM64_SP: *size = sizeof(ctx->Sp); return &ctx->Sp;
case CV_ARM64_PC: *size = sizeof(ctx->Pc); return &ctx->Pc; case CV_ARM64_PC: *size = sizeof(ctx->Pc); return &ctx->Pc;
} }

View File

@ -123,8 +123,8 @@ static void save_context( CONTEXT *context, const ucontext_t *sigcontext )
DWORD i; DWORD i;
context->ContextFlags = CONTEXT_FULL; context->ContextFlags = CONTEXT_FULL;
context->Fp = FP_sig(sigcontext); /* Frame pointer */ context->u.s.Fp = FP_sig(sigcontext); /* Frame pointer */
context->Lr = LR_sig(sigcontext); /* Link register */ context->u.s.Lr = LR_sig(sigcontext); /* Link register */
context->Sp = SP_sig(sigcontext); /* Stack pointer */ context->Sp = SP_sig(sigcontext); /* Stack pointer */
context->Pc = PC_sig(sigcontext); /* Program Counter */ context->Pc = PC_sig(sigcontext); /* Program Counter */
context->Cpsr = PSTATE_sig(sigcontext); /* Current State Register */ context->Cpsr = PSTATE_sig(sigcontext); /* Current State Register */
@ -141,8 +141,8 @@ static void restore_context( const CONTEXT *context, ucontext_t *sigcontext )
{ {
DWORD i; DWORD i;
FP_sig(sigcontext) = context->Fp; /* Frame pointer */ FP_sig(sigcontext) = context->u.s.Fp; /* Frame pointer */
LR_sig(sigcontext) = context->Lr; /* Link register */ LR_sig(sigcontext) = context->u.s.Lr; /* Link register */
SP_sig(sigcontext) = context->Sp; /* Stack pointer */ SP_sig(sigcontext) = context->Sp; /* Stack pointer */
PC_sig(sigcontext) = context->Pc; /* Program Counter */ PC_sig(sigcontext) = context->Pc; /* Program Counter */
PSTATE_sig(sigcontext) = context->Cpsr; /* Current State Register */ PSTATE_sig(sigcontext) = context->Cpsr; /* Current State Register */
@ -241,8 +241,8 @@ static void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags )
flags &= ~CONTEXT_ARM64; /* get rid of CPU id */ flags &= ~CONTEXT_ARM64; /* get rid of CPU id */
if (flags & CONTEXT_CONTROL) if (flags & CONTEXT_CONTROL)
{ {
to->Fp = from->Fp; to->u.s.Fp = from->u.s.Fp;
to->Lr = from->Lr; to->u.s.Lr = from->u.s.Lr;
to->Sp = from->Sp; to->Sp = from->Sp;
to->Pc = from->Pc; to->Pc = from->Pc;
to->Cpsr = from->Cpsr; to->Cpsr = from->Cpsr;
@ -281,8 +281,8 @@ NTSTATUS context_to_server( context_t *to, const CONTEXT *from )
if (flags & CONTEXT_CONTROL) if (flags & CONTEXT_CONTROL)
{ {
to->flags |= SERVER_CTX_CONTROL; to->flags |= SERVER_CTX_CONTROL;
to->integer.arm64_regs.x[29] = from->Fp; to->integer.arm64_regs.x[29] = from->u.s.Fp;
to->integer.arm64_regs.x[30] = from->Lr; to->integer.arm64_regs.x[30] = from->u.s.Lr;
to->ctl.arm64_regs.sp = from->Sp; to->ctl.arm64_regs.sp = from->Sp;
to->ctl.arm64_regs.pc = from->Pc; to->ctl.arm64_regs.pc = from->Pc;
to->ctl.arm64_regs.pstate = from->Cpsr; to->ctl.arm64_regs.pstate = from->Cpsr;
@ -326,8 +326,8 @@ NTSTATUS context_from_server( CONTEXT *to, const context_t *from )
if (from->flags & SERVER_CTX_CONTROL) if (from->flags & SERVER_CTX_CONTROL)
{ {
to->ContextFlags |= CONTEXT_CONTROL; to->ContextFlags |= CONTEXT_CONTROL;
to->Fp = from->integer.arm64_regs.x[29]; to->u.s.Fp = from->integer.arm64_regs.x[29];
to->Lr = from->integer.arm64_regs.x[30]; to->u.s.Lr = from->integer.arm64_regs.x[30];
to->Sp = from->ctl.arm64_regs.sp; to->Sp = from->ctl.arm64_regs.sp;
to->Pc = from->ctl.arm64_regs.pc; to->Pc = from->ctl.arm64_regs.pc;
to->Cpsr = from->ctl.arm64_regs.pstate; to->Cpsr = from->ctl.arm64_regs.pstate;

View File

@ -1850,12 +1850,12 @@ typedef struct _CONTEXT
DWORD64 X26; /* 0d8 */ DWORD64 X26; /* 0d8 */
DWORD64 X27; /* 0e0 */ DWORD64 X27; /* 0e0 */
DWORD64 X28; /* 0e8 */ DWORD64 X28; /* 0e8 */
DWORD64 Fp; /* 0f0 */
DWORD64 Lr; /* 0f8 */
} DUMMYSTRUCTNAME; } DUMMYSTRUCTNAME;
DWORD64 X[29]; /* 008 */ DWORD64 X[31]; /* 008 */
} DUMMYUNIONNAME; } DUMMYUNIONNAME;
/* CONTEXT_CONTROL */ /* CONTEXT_CONTROL */
DWORD64 Fp; /* 0f0 */
DWORD64 Lr; /* 0f8 */
DWORD64 Sp; /* 100 */ DWORD64 Sp; /* 100 */
DWORD64 Pc; /* 108 */ DWORD64 Pc; /* 108 */
/* CONTEXT_FLOATING_POINT */ /* CONTEXT_FLOATING_POINT */

View File

@ -32,7 +32,7 @@ static BOOL be_arm64_get_addr(HANDLE hThread, const CONTEXT* ctx,
case be_cpu_addr_stack: case be_cpu_addr_stack:
return be_cpu_build_addr(hThread, ctx, addr, 0, ctx->Sp); return be_cpu_build_addr(hThread, ctx, addr, 0, ctx->Sp);
case be_cpu_addr_frame: case be_cpu_addr_frame:
return be_cpu_build_addr(hThread, ctx, addr, 0, ctx->Fp); return be_cpu_build_addr(hThread, ctx, addr, 0, ctx->u.s.Fp);
break; break;
} }
return FALSE; return FALSE;
@ -81,7 +81,7 @@ static void be_arm64_print_context(HANDLE hThread, const CONTEXT* ctx, int all_r
buf[i] = '-'; buf[i] = '-';
dbg_printf(" Pc:%016lx Sp:%016lx Lr:%016lx Cpsr:%08x(%s)\n", dbg_printf(" Pc:%016lx Sp:%016lx Lr:%016lx Cpsr:%08x(%s)\n",
ctx->Pc, ctx->Sp, ctx->Lr, ctx->Cpsr, buf); ctx->Pc, ctx->Sp, ctx->u.s.Lr, ctx->Cpsr, buf);
dbg_printf(" x0: %016lx x1: %016lx x2: %016lx x3: %016lx x4: %016lx\n", dbg_printf(" x0: %016lx x1: %016lx x2: %016lx x3: %016lx x4: %016lx\n",
ctx->u.s.X0, ctx->u.s.X1, ctx->u.s.X2, ctx->u.s.X3, ctx->u.s.X4); ctx->u.s.X0, ctx->u.s.X1, ctx->u.s.X2, ctx->u.s.X3, ctx->u.s.X4);
dbg_printf(" x5: %016lx x6: %016lx x7: %016lx x8: %016lx x9: %016lx\n", dbg_printf(" x5: %016lx x6: %016lx x7: %016lx x8: %016lx x9: %016lx\n",
@ -93,7 +93,7 @@ static void be_arm64_print_context(HANDLE hThread, const CONTEXT* ctx, int all_r
dbg_printf(" x20:%016lx x21:%016lx x22:%016lx x23:%016lx x24:%016lx\n", dbg_printf(" x20:%016lx x21:%016lx x22:%016lx x23:%016lx x24:%016lx\n",
ctx->u.s.X20, ctx->u.s.X21, ctx->u.s.X22, ctx->u.s.X23, ctx->u.s.X24); ctx->u.s.X20, ctx->u.s.X21, ctx->u.s.X22, ctx->u.s.X23, ctx->u.s.X24);
dbg_printf(" x25:%016lx x26:%016lx x27:%016lx x28:%016lx Fp:%016lx\n", dbg_printf(" x25:%016lx x26:%016lx x27:%016lx x28:%016lx Fp:%016lx\n",
ctx->u.s.X25, ctx->u.s.X26, ctx->u.s.X27, ctx->u.s.X28, ctx->Fp); ctx->u.s.X25, ctx->u.s.X26, ctx->u.s.X27, ctx->u.s.X28, ctx->u.s.Fp);
if (all_regs) dbg_printf( "Floating point ARM64 dump not implemented\n" ); if (all_regs) dbg_printf( "Floating point ARM64 dump not implemented\n" );
} }
@ -134,8 +134,8 @@ static struct dbg_internal_var be_arm64_ctx[] =
{CV_ARM64_X0 + 26, "x26", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, u.s.X26), 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 + 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_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, Fp), 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, Lr), 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_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}, {CV_ARM64_PC, "pc", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Pc), dbg_itype_unsigned_long_int},
{0, NULL, 0, dbg_itype_none} {0, NULL, 0, dbg_itype_none}

View File

@ -495,8 +495,8 @@ static struct cpu_register cpu_register_map[] = {
REG(u.s.X26, 8, CONTEXT_INTEGER), REG(u.s.X26, 8, CONTEXT_INTEGER),
REG(u.s.X27, 8, CONTEXT_INTEGER), REG(u.s.X27, 8, CONTEXT_INTEGER),
REG(u.s.X28, 8, CONTEXT_INTEGER), REG(u.s.X28, 8, CONTEXT_INTEGER),
REG(Fp, 8, CONTEXT_INTEGER), REG(u.s.Fp, 8, CONTEXT_INTEGER),
REG(Lr, 8, CONTEXT_INTEGER), REG(u.s.Lr, 8, CONTEXT_INTEGER),
REG(Sp, 8, CONTEXT_CONTROL), REG(Sp, 8, CONTEXT_CONTROL),
REG(Pc, 8, CONTEXT_CONTROL), REG(Pc, 8, CONTEXT_CONTROL),
}; };