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); //------------------------------------------------------------------ + /// Check if we have step plan to override breakpoint's + /// should_stop=false decision + /// + /// @return + /// Returns true if the trace plan is in the discarded plan stack, + /// false otherwise. + //------------------------------------------------------------------ + bool StepPlanOverridesBreakpoint(); + + //------------------------------------------------------------------ /// 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 @@ -512,6 +512,10 @@ } } } + // Override breakpoint should_stop decision when we have + // step plan discarded by this breakpoint + if (thread_sp->StepPlanOverridesBreakpoint()) + m_should_stop = true; // We've figured out what this stop wants to do, so mark it as valid so // we don't compute it again. m_should_stop_is_valid = true; Index: lldb/source/Target/Thread.cpp =================================================================== --- lldb/source/Target/Thread.cpp +++ lldb/source/Target/Thread.cpp @@ -1133,6 +1133,24 @@ return false; } +bool Thread::StepPlanOverridesBreakpoint() { + 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; Index: lldb/source/Target/ThreadPlanBase.cpp =================================================================== --- lldb/source/Target/ThreadPlanBase.cpp +++ lldb/source/Target/ThreadPlanBase.cpp @@ -101,8 +101,7 @@ if (stop_info_sp->ShouldStopSynchronous(event_ptr)) { // If we are going to stop for a breakpoint, then unship the other plans // at this point. Don't force the discard, however, so Master plans can - // stay - // in place if they want to. + // stay in place if they want to. if (log) log->Printf( "Base plan discarding thread plans for thread tid = 0x%4.4" PRIx64