mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 10:00:16 +02:00
WOW64: Use NtRaiseException to raise guest exception
Instead of returning to the currently dispatched exception, which doesn't send a debug event.
This commit is contained in:
1 parent
064a6e96c7
commit
e4c6154be2
1 file changed
+4
-10
@@ -943,22 +943,16 @@ bool BTCpuResetToConsistentStateImpl(EXCEPTION_POINTERS* Ptrs) {
|
||||
|
||||
auto& Fault = Thread->CurrentFrame->SynchronousFaultData;
|
||||
BOOL FirstChance = TRUE;
|
||||
*Exception = FEX::Windows::HandleGuestException(Fault, *Exception, WowContext.Eip, WowContext.Eax, WowContext.Ecx, FirstChance);
|
||||
if (Exception->ExceptionCode == EXCEPTION_SINGLE_STEP) {
|
||||
EXCEPTION_RECORD GuestException =
|
||||
FEX::Windows::HandleGuestException(Fault, *Exception, WowContext.Eip, WowContext.Eax, WowContext.Ecx, FirstChance);
|
||||
if (GuestException.ExceptionCode == EXCEPTION_SINGLE_STEP) {
|
||||
WowContext.EFlags &= ~(1 << FEXCore::X86State::RFLAG_TF_RAW_LOC);
|
||||
}
|
||||
// wow64.dll will handle adjusting PC in the dispatched context after a breakpoint
|
||||
|
||||
BTCpuSetContext(GetCurrentThread(), GetCurrentProcess(), nullptr, &WowContext);
|
||||
Context::UnlockJITContext(TLS);
|
||||
|
||||
if (!FirstChance) {
|
||||
NtRaiseException(Exception, TLS.EntryContext(), FirstChance);
|
||||
}
|
||||
|
||||
// Replace the host context with one captured before JIT entry so host code can unwind
|
||||
memcpy(Context, TLS.EntryContext(), sizeof(*Context));
|
||||
|
||||
NtRaiseException(&GuestException, TLS.EntryContext(), FirstChance);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user