Skip to content

Commit

Permalink
Debugger: Fixed forbid breakpoints not working properly with "break o…
Browse files Browse the repository at this point in the history
…n" options
  • Loading branch information
SourMesen committed Oct 15, 2024
1 parent 3dee924 commit ef302de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Core/Debugger/Debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Core/Debugger/Debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class Debugger
bool IsBreakOptionEnabled(BreakSource src);
template<CpuType type> void SleepOnBreakRequest();

void ClearPendingBreakRequests();

bool IsBreakpointForbidden(BreakSource source, CpuType sourceCpu, MemoryOperationInfo* operation);

public:
Expand Down

0 comments on commit ef302de

Please sign in to comment.