From ef302de4618c028095aae2fdb4e92d2ba53358e7 Mon Sep 17 00:00:00 2001 From: Sour Date: Tue, 15 Oct 2024 09:29:42 +0900 Subject: [PATCH] Debugger: Fixed forbid breakpoints not working properly with "break on" options --- Core/Debugger/Debugger.cpp | 10 ++++++++++ Core/Debugger/Debugger.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/Core/Debugger/Debugger.cpp b/Core/Debugger/Debugger.cpp index 9556db47a..5aa79a880 100644 --- a/Core/Debugger/Debugger.cpp +++ b/Core/Debugger/Debugger.cpp @@ -457,6 +457,7 @@ void Debugger::SleepUntilResume(CpuType sourceCpu, BreakSource source, MemoryOpe //If SleepUntilResume was called outside of ProcessInstruction, keep running return; } else if(IsBreakpointForbidden(source, sourceCpu, operation)) { + ClearPendingBreakRequests(); return; } @@ -655,6 +656,15 @@ void Debugger::Run() _waitForBreakResume = false; } +void Debugger::ClearPendingBreakRequests() +{ + for(int i = 0; i <= (int)DebugUtilities::GetLastCpuType(); i++) { + if(_debuggers[i].Debugger) { + _debuggers[i].Debugger->Run(); + } + } +} + void Debugger::PauseOnNextFrame() { //Use BreakSource::PpuStep to prevent "Run single frame" from triggering the "bring to front on pause" feature diff --git a/Core/Debugger/Debugger.h b/Core/Debugger/Debugger.h index cff90552f..112b9dd79 100644 --- a/Core/Debugger/Debugger.h +++ b/Core/Debugger/Debugger.h @@ -99,6 +99,8 @@ class Debugger bool IsBreakOptionEnabled(BreakSource src); template void SleepOnBreakRequest(); + void ClearPendingBreakRequests(); + bool IsBreakpointForbidden(BreakSource source, CpuType sourceCpu, MemoryOperationInfo* operation); public: