This seems to have been left inconsistent by accident in 21c12ddc64e88b67167267455bc5e68dc576cfa4.
Signed-off-by: Martin Storsjo martin@martin.st --- In case the difference was intentional, then this can obviously be ignored. --- dlls/dbghelp/cpu_arm64.c | 14 +++++++------- dlls/ntdll/signal_arm64.c | 20 ++++++++++---------- include/winnt.h | 6 +++--- programs/winedbg/be_arm64.c | 10 +++++----- programs/winedbg/gdbproxy.c | 4 ++-- 5 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/dlls/dbghelp/cpu_arm64.c b/dlls/dbghelp/cpu_arm64.c index dd2ccfb..dea19f8 100644 --- a/dlls/dbghelp/cpu_arm64.c +++ b/dlls/dbghelp/cpu_arm64.c @@ -41,7 +41,7 @@ static BOOL arm64_get_addr(HANDLE hThread, const CONTEXT* ctx, #ifdef __aarch64__ case cpu_addr_pc: addr->Offset = ctx->Pc; 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 default: addr->Mode = -1; return FALSE; @@ -69,7 +69,7 @@ static BOOL fetch_next_frame(struct cpu_stack_walk* csw, CONTEXT* context, DWORD_PTR curr_pc) { DWORD_PTR xframe; - DWORD_PTR oldReturn = context->Lr; + DWORD_PTR oldReturn = context->u.s.Lr;
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; }
- if (context->Pc == context->Lr) return FALSE; + if (context->Pc == context->u.s.Lr) return FALSE; context->Pc = oldReturn;
return TRUE; @@ -123,8 +123,8 @@ static BOOL arm64_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, C
/* set frame information */ frame->AddrStack.Offset = context->Sp; - frame->AddrReturn.Offset = context->Lr; - frame->AddrFrame.Offset = context->Fp; + frame->AddrReturn.Offset = context->u.s.Lr; + frame->AddrFrame.Offset = context->u.s.Fp; frame->AddrPC.Offset = context->Pc;
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 + 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_FP: *size = sizeof(ctx->Fp); return &ctx->Fp; - case CV_ARM64_LR: *size = sizeof(ctx->Lr); return &ctx->Lr; + case CV_ARM64_FP: *size = sizeof(ctx->u.s.Fp); return &ctx->u.s.Fp; + 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_PC: *size = sizeof(ctx->Pc); return &ctx->Pc; } diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index c461e88..def1071 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -123,8 +123,8 @@ static void save_context( CONTEXT *context, const ucontext_t *sigcontext ) DWORD i;
context->ContextFlags = CONTEXT_FULL; - context->Fp = FP_sig(sigcontext); /* Frame pointer */ - context->Lr = LR_sig(sigcontext); /* Link register */ + context->u.s.Fp = FP_sig(sigcontext); /* Frame pointer */ + context->u.s.Lr = LR_sig(sigcontext); /* Link register */ context->Sp = SP_sig(sigcontext); /* Stack pointer */ context->Pc = PC_sig(sigcontext); /* Program Counter */ context->Cpsr = PSTATE_sig(sigcontext); /* Current State Register */ @@ -141,8 +141,8 @@ static void restore_context( const CONTEXT *context, ucontext_t *sigcontext ) { DWORD i;
- FP_sig(sigcontext) = context->Fp; /* Frame pointer */ - LR_sig(sigcontext) = context->Lr; /* Link register */ + FP_sig(sigcontext) = context->u.s.Fp; /* Frame pointer */ + LR_sig(sigcontext) = context->u.s.Lr; /* Link register */ SP_sig(sigcontext) = context->Sp; /* Stack pointer */ PC_sig(sigcontext) = context->Pc; /* Program Counter */ 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 */ if (flags & CONTEXT_CONTROL) { - to->Fp = from->Fp; - to->Lr = from->Lr; + to->u.s.Fp = from->u.s.Fp; + to->u.s.Lr = from->u.s.Lr; to->Sp = from->Sp; to->Pc = from->Pc; to->Cpsr = from->Cpsr; @@ -281,8 +281,8 @@ NTSTATUS context_to_server( context_t *to, const CONTEXT *from ) if (flags & CONTEXT_CONTROL) { to->flags |= SERVER_CTX_CONTROL; - to->integer.arm64_regs.x[29] = from->Fp; - to->integer.arm64_regs.x[30] = from->Lr; + to->integer.arm64_regs.x[29] = from->u.s.Fp; + to->integer.arm64_regs.x[30] = from->u.s.Lr; to->ctl.arm64_regs.sp = from->Sp; to->ctl.arm64_regs.pc = from->Pc; 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) { to->ContextFlags |= CONTEXT_CONTROL; - to->Fp = from->integer.arm64_regs.x[29]; - to->Lr = from->integer.arm64_regs.x[30]; + to->u.s.Fp = from->integer.arm64_regs.x[29]; + to->u.s.Lr = from->integer.arm64_regs.x[30]; to->Sp = from->ctl.arm64_regs.sp; to->Pc = from->ctl.arm64_regs.pc; to->Cpsr = from->ctl.arm64_regs.pstate; diff --git a/include/winnt.h b/include/winnt.h index e602c1f..3c19af9 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -1850,12 +1850,12 @@ typedef struct _CONTEXT DWORD64 X26; /* 0d8 */ DWORD64 X27; /* 0e0 */ DWORD64 X28; /* 0e8 */ + DWORD64 Fp; /* 0f0 */ + DWORD64 Lr; /* 0f8 */ } DUMMYSTRUCTNAME; - DWORD64 X[29]; /* 008 */ + DWORD64 X[31]; /* 008 */ } DUMMYUNIONNAME; /* CONTEXT_CONTROL */ - DWORD64 Fp; /* 0f0 */ - DWORD64 Lr; /* 0f8 */ DWORD64 Sp; /* 100 */ DWORD64 Pc; /* 108 */ /* CONTEXT_FLOATING_POINT */ diff --git a/programs/winedbg/be_arm64.c b/programs/winedbg/be_arm64.c index b1952f6..dfeb552 100644 --- a/programs/winedbg/be_arm64.c +++ b/programs/winedbg/be_arm64.c @@ -32,7 +32,7 @@ static BOOL be_arm64_get_addr(HANDLE hThread, const CONTEXT* ctx, case be_cpu_addr_stack: return be_cpu_build_addr(hThread, ctx, addr, 0, ctx->Sp); 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; } return FALSE; @@ -81,7 +81,7 @@ static void be_arm64_print_context(HANDLE hThread, const CONTEXT* ctx, int all_r buf[i] = '-';
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", 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", @@ -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", 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", - 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" ); } @@ -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 + 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, Fp), dbg_itype_unsigned_long_int}, - {CV_ARM64_LR, "lr", (DWORD_PTR*)FIELD_OFFSET(CONTEXT, Lr), 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} diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c index 618c5df..376bf37 100644 --- a/programs/winedbg/gdbproxy.c +++ b/programs/winedbg/gdbproxy.c @@ -495,8 +495,8 @@ static struct cpu_register cpu_register_map[] = { REG(u.s.X26, 8, CONTEXT_INTEGER), REG(u.s.X27, 8, CONTEXT_INTEGER), REG(u.s.X28, 8, CONTEXT_INTEGER), - REG(Fp, 8, CONTEXT_INTEGER), - REG(Lr, 8, CONTEXT_INTEGER), + REG(u.s.Fp, 8, CONTEXT_INTEGER), + REG(u.s.Lr, 8, CONTEXT_INTEGER), REG(Sp, 8, CONTEXT_CONTROL), REG(Pc, 8, CONTEXT_CONTROL), };
Martin Storsjo martin@martin.st writes:
This seems to have been left inconsistent by accident in 21c12ddc64e88b67167267455bc5e68dc576cfa4.
Signed-off-by: Martin Storsjo martin@martin.st
In case the difference was intentional, then this can obviously be ignored.
It's intentional, that's how it is in the Microsoft headers.
On Mon, 19 Mar 2018, Alexandre Julliard wrote:
Martin Storsjo martin@martin.st writes:
This seems to have been left inconsistent by accident in 21c12ddc64e88b67167267455bc5e68dc576cfa4.
Signed-off-by: Martin Storsjo martin@martin.st
In case the difference was intentional, then this can obviously be ignored.
It's intentional, that's how it is in the Microsoft headers.
Oh, it seems like this actually is something that has changed between different revisions of the Windows SDK.
In version 10.0.16299.0 (the one I checked), it's like the way my patch changes it, while e.g. in version 10.0.10586.0 it's like it is right now in wine.
// Martin
On Mon, 19 Mar 2018, Martin Storsjö wrote:
On Mon, 19 Mar 2018, Alexandre Julliard wrote:
Martin Storsjo martin@martin.st writes:
This seems to have been left inconsistent by accident in 21c12ddc64e88b67167267455bc5e68dc576cfa4.
Signed-off-by: Martin Storsjo martin@martin.st
In case the difference was intentional, then this can obviously be ignored.
It's intentional, that's how it is in the Microsoft headers.
Oh, it seems like this actually is something that has changed between different revisions of the Windows SDK.
In version 10.0.16299.0 (the one I checked), it's like the way my patch changes it, while e.g. in version 10.0.10586.0 it's like it is right now in wine.
... so I guess the patch should be updated with this commit message instead:
ntdll: Update the ARM64 CONTEXT struct to match Win SDK 10.0.16299.0
// Martin