From: Brendan Shanks <bshanks@codeweavers.com> --- dlls/ntdll/unix/signal_arm64.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index 536834955b3..f06fc24f1fe 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -1146,21 +1146,20 @@ static void trap_handler( int signal, siginfo_t *siginfo, void *_sigcontext ) save_context( &context, sigcontext ); - if (!esr) +#ifdef linux + /* debug exceptions have a stale/incorrect ESR on Linux, so we synthesize it. */ + switch (siginfo->si_code) { - /* debug exceptions do not update ESR on Linux, so we synthesize it. */ - switch (siginfo->si_code) - { - case TRAP_TRACE: - esr = make_esr( 0x33, 0 ); - break; - case TRAP_BRKPT: - if (!(PSTATE_sig( sigcontext ) & 0x10) && /* AArch64 (not WoW) */ - !(PC_sig( sigcontext ) & 3)) - esr = make_esr( 0x3c, *(ULONG *)PC_sig( sigcontext ) >> 5 ); - break; - } + case TRAP_TRACE: + esr = make_esr( 0x33, 0 ); + break; + case TRAP_BRKPT: + if (!(PSTATE_sig( sigcontext ) & 0x10) && /* AArch64 (not WoW) */ + !(PC_sig( sigcontext ) & 3)) + esr = make_esr( 0x3c, *(ULONG *)PC_sig( sigcontext ) >> 5 ); + break; } +#endif switch ((esr >> 26) & 0x3c) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10843