diff --git a/Core/Debugger/Breakpoints.cpp b/Core/Debugger/Breakpoints.cpp index a27711bdaa..5f2683df83 100644 --- a/Core/Debugger/Breakpoints.cpp +++ b/Core/Debugger/Breakpoints.cpp @@ -102,13 +102,21 @@ void MemCheck::JitCleanup() size_t CBreakPoints::FindBreakpoint(u32 addr, bool matchTemp, bool temp) { + size_t found = INVALID_BREAKPOINT; for (size_t i = 0; i < breakPoints_.size(); ++i) { - if (breakPoints_[i].addr == addr && (!matchTemp || breakPoints_[i].temporary == temp)) - return i; + const auto &bp = breakPoints_[i]; + if (bp.addr == addr && (!matchTemp || bp.temporary == temp)) + { + if (bp.enabled) + return i; + // Hold out until the first enabled one. + if (found == INVALID_BREAKPOINT) + found = i; + } } - return INVALID_BREAKPOINT; + return found; } size_t CBreakPoints::FindMemCheck(u32 start, u32 end)