Index: lldb/include/lldb/Target/Thread.h =================================================================== --- lldb/include/lldb/Target/Thread.h +++ lldb/include/lldb/Target/Thread.h @@ -1026,6 +1026,16 @@ bool WasThreadPlanDiscarded(ThreadPlan *plan); //------------------------------------------------------------------ + /// Checks whether trace plan is in the discarded plans for this + /// stop. + /// + /// @return + /// Returns true if the trace plan is in the discarded plan stack, + /// false otherwise. + //------------------------------------------------------------------ + bool WasThreadStepPlanDiscarded(); + + //------------------------------------------------------------------ /// Queues a generic thread plan. /// /// @param[in] plan_sp Index: lldb/source/Target/StopInfo.cpp =================================================================== --- lldb/source/Target/StopInfo.cpp +++ lldb/source/Target/StopInfo.cpp @@ -471,7 +471,10 @@ // We've already bumped it by the time we get here, so undo // the bump: bp_loc_sp->UndoBumpHitCount(); - continue; + // Stop unconditionally if we have step plan discarded by + // this breakpoint + if (!thread_sp->WasThreadStepPlanDiscarded()) + continue; } } } Index: lldb/source/Target/Thread.cpp =================================================================== --- lldb/source/Target/Thread.cpp +++ lldb/source/Target/Thread.cpp @@ -1133,6 +1133,24 @@ return false; } +bool Thread::WasThreadStepPlanDiscarded() { + if (!m_discarded_plan_stack.empty()) { + for (int i = m_discarded_plan_stack.size() - 1; i >= 0; i--) { + ThreadPlan::ThreadPlanKind kind = m_discarded_plan_stack[i].get()->GetKind(); + if (kind == ThreadPlan::eKindStepInstruction || + kind == ThreadPlan::eKindStepOut || + kind == ThreadPlan::eKindStepOverBreakpoint || + kind == ThreadPlan::eKindStepOverRange || + kind == ThreadPlan::eKindStepInRange || + kind == ThreadPlan::eKindRunToAddress || + kind == ThreadPlan::eKindStepThrough || + kind == ThreadPlan::eKindStepUntil) + return true; + } + } + return false; +} + ThreadPlan *Thread::GetPreviousPlan(ThreadPlan *current_plan) { if (current_plan == nullptr) return nullptr;