diff --git a/lldb/include/lldb/Target/ThreadPlan.h b/lldb/include/lldb/Target/ThreadPlan.h --- a/lldb/include/lldb/Target/ThreadPlan.h +++ b/lldb/include/lldb/Target/ThreadPlan.h @@ -281,8 +281,6 @@ class ThreadPlan : public std::enable_shared_from_this, public UserID { public: - enum ThreadScope { eAllThreads, eSomeThreads, eThisThread }; - // We use these enums so that we can cast a base thread plan to it's real // type without having to resort to dynamic casting. enum ThreadPlanKind { @@ -298,15 +296,9 @@ eKindStepInRange, eKindRunToAddress, eKindStepThrough, - eKindStepUntil, - eKindTestCondition - + eKindStepUntil }; - // Constructors and Destructors - ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread, - Vote stop_vote, Vote run_vote); - virtual ~ThreadPlan(); /// Returns the name of this thread plan. @@ -375,7 +367,7 @@ virtual Vote ShouldReportStop(Event *event_ptr); - virtual Vote ShouldReportRun(Event *event_ptr); + Vote ShouldReportRun(Event *event_ptr); virtual void SetStopOthers(bool new_value); @@ -416,15 +408,6 @@ virtual void WillPop(); - // This pushes a plan onto the plan stack of the current plan's thread. - // Also sets the plans to private and not master plans. A plan pushed by - // another thread plan is never either of the above. - void PushPlan(lldb::ThreadPlanSP &thread_plan_sp) { - GetThread().PushPlan(thread_plan_sp); - thread_plan_sp->SetPrivate(false); - thread_plan_sp->SetIsMasterPlan(false); - } - ThreadPlanKind GetKind() const { return m_kind; } bool IsPlanComplete(); @@ -488,7 +471,7 @@ virtual bool IsVirtualStep() { return false; } - virtual bool SetIterationCount(size_t count) { + bool SetIterationCount(size_t count) { if (m_takes_iteration_count) { // Don't tell me to do something 0 times... if (count == 0) @@ -498,14 +481,11 @@ return m_takes_iteration_count; } - virtual size_t GetIterationCount() { - if (!m_takes_iteration_count) - return 0; - else - return m_iteration_count; - } - protected: + // Constructors and Destructors + ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread, + Vote stop_vote, Vote run_vote); + // Classes that inherit from ThreadPlan can see and modify these virtual bool DoWillResume(lldb::StateType resume_state, bool current_plan) { @@ -514,6 +494,15 @@ virtual bool DoPlanExplainsStop(Event *event_ptr) = 0; + // This pushes a plan onto the plan stack of the current plan's thread. + // Also sets the plans to private and not master plans. A plan pushed by + // another thread plan is never either of the above. + void PushPlan(lldb::ThreadPlanSP &thread_plan_sp) { + GetThread().PushPlan(thread_plan_sp); + thread_plan_sp->SetPrivate(false); + thread_plan_sp->SetIsMasterPlan(false); + } + // This gets the previous plan to the current plan (for forwarding requests). // This is mostly a formal requirement, it allows us to make the Thread's // GetPreviousPlan protected, but only friend ThreadPlan to thread. @@ -531,14 +520,6 @@ GetThread().SetStopInfo(stop_reason_sp); } - void CachePlanExplainsStop(bool does_explain) { - m_cached_plan_explains_stop = does_explain ? eLazyBoolYes : eLazyBoolNo; - } - - LazyBool GetCachedPlanExplainsStop() const { - return m_cached_plan_explains_stop; - } - virtual lldb::StateType GetPlanRunState() = 0; bool IsUsuallyUnexplainedStopReason(lldb::StopReason); @@ -553,6 +534,10 @@ int32_t m_iteration_count = 1; private: + void CachePlanExplainsStop(bool does_explain) { + m_cached_plan_explains_stop = does_explain ? eLazyBoolYes : eLazyBoolNo; + } + // For ThreadPlan only static lldb::user_id_t GetNextID(); diff --git a/lldb/source/Target/ThreadPlan.cpp b/lldb/source/Target/ThreadPlan.cpp --- a/lldb/source/Target/ThreadPlan.cpp +++ b/lldb/source/Target/ThreadPlan.cpp @@ -50,7 +50,7 @@ bool ThreadPlan::PlanExplainsStop(Event *event_ptr) { if (m_cached_plan_explains_stop == eLazyBoolCalculate) { bool actual_value = DoPlanExplainsStop(event_ptr); - m_cached_plan_explains_stop = actual_value ? eLazyBoolYes : eLazyBoolNo; + CachePlanExplainsStop(actual_value); return actual_value; } else { return m_cached_plan_explains_stop == eLazyBoolYes;