diff --git a/core/debuggercontroller.cpp b/core/debuggercontroller.cpp index bc1ccd5a..469ab81a 100644 --- a/core/debuggercontroller.cpp +++ b/core/debuggercontroller.cpp @@ -2014,7 +2014,17 @@ void DebuggerController::DebuggerMainThread() AddRegisterValuesToExpressionParser(); AddModuleValuesToExpressionParser(); - if (uint64_t ip = m_state->IP(); m_state->GetBreakpoints()->ContainsAbsolute(ip)) + // skip conditional breakpoint evaluation for step operations - when the user explicitly + // steps onto a breakpoint, they expect to stop there regardless of the condition. + bool isStepOperation = (m_lastOperation == DebugAdapterStepInto) + || (m_lastOperation == DebugAdapterStepOver) + || (m_lastOperation == DebugAdapterStepReturn) + || (m_lastOperation == DebugAdapterStepIntoReverse) + || (m_lastOperation == DebugAdapterStepOverReverse) + || (m_lastOperation == DebugAdapterStepReturnReverse); + + if (uint64_t ip = m_state->IP(); + !isStepOperation && m_state->GetBreakpoints()->ContainsAbsolute(ip)) { if (!EvaluateBreakpointCondition(ip)) { @@ -2654,6 +2664,8 @@ DebugStopReason DebuggerController::ExecuteAdapterAndWait(const DebugAdapterOper }, "WaitForAdapterStop"); + m_lastOperation = operation; + bool resumeOK = false; bool operationRequested = false; switch (operation) diff --git a/core/debuggercontroller.h b/core/debuggercontroller.h index 6f7a2b24..7992fa86 100644 --- a/core/debuggercontroller.h +++ b/core/debuggercontroller.h @@ -114,6 +114,7 @@ namespace BinaryNinjaDebugger { uint32_t m_exitCode = 0; bool m_userRequestedBreak = false; + DebugAdapterOperation m_lastOperation = DebugAdapterGo; bool m_lastAdapterStopEventConsumed = true;