diff --git a/Core/Core.cpp b/Core/Core.cpp index 26a54992e7..7afeff0232 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -191,7 +191,9 @@ void Core_StateProcessed() { void Core_WaitInactive() { while (Core_IsActive() && !GPUStepping::IsStepping()) { std::unique_lock guard(m_hInactiveMutex); - m_InactiveCond.wait(guard); + if (coreStatePending) { + m_InactiveCond.wait(guard); + } } } diff --git a/Core/Debugger/WebSocket/MemorySubscriber.cpp b/Core/Debugger/WebSocket/MemorySubscriber.cpp index 7ceaa31374..e5930aab44 100644 --- a/Core/Debugger/WebSocket/MemorySubscriber.cpp +++ b/Core/Debugger/WebSocket/MemorySubscriber.cpp @@ -61,9 +61,13 @@ struct AutoDisabledReplacements { // Important: Only use keepReplacements when reading, not writing. static AutoDisabledReplacements LockMemoryAndCPU(uint32_t addr, bool keepReplacements) { AutoDisabledReplacements result; + CoreState state = coreState; if (Core_IsStepping()) { result.wasStepping = true; } else { + while (state != CoreState::CORE_RUNNING_CPU) { + state = coreState; + } Core_Break(BreakReason::MemoryAccess, addr); Core_WaitInactive(); }