From 1fd194141a5643e3d274108a4a886ba8173270bd Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 20 Jun 2022 20:39:16 -0400 Subject: dynarmic: Stop ReadCode callbacks to unmapped addresses --- src/core/arm/arm_interface.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/core/arm/arm_interface.cpp') diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp index 6425e131f..56d7d7b3c 100644 --- a/src/core/arm/arm_interface.cpp +++ b/src/core/arm/arm_interface.cpp @@ -119,16 +119,23 @@ void ARM_Interface::Run() { } system.ExitDynarmicProfile(); - // Notify the debugger and go to sleep if a breakpoint was hit. - if (Has(hr, breakpoint)) { + // Notify the debugger and go to sleep if a breakpoint was hit, + // or if the thread is unable to continue for any reason. + if (Has(hr, breakpoint) || Has(hr, no_execute)) { RewindBreakpointInstruction(); - system.GetDebugger().NotifyThreadStopped(current_thread); - current_thread->RequestSuspend(SuspendType::Debug); + if (system.DebuggerEnabled()) { + system.GetDebugger().NotifyThreadStopped(current_thread); + } + current_thread->RequestSuspend(Kernel::SuspendType::Debug); break; } + + // Notify the debugger and go to sleep if a watchpoint was hit. if (Has(hr, watchpoint)) { RewindBreakpointInstruction(); - system.GetDebugger().NotifyThreadWatchpoint(current_thread, *HaltedWatchpoint()); + if (system.DebuggerEnabled()) { + system.GetDebugger().NotifyThreadWatchpoint(current_thread, *HaltedWatchpoint()); + } current_thread->RequestSuspend(SuspendType::Debug); break; } -- cgit v1.2.3