class ThreadPlan : public std::enable_shared_from_this<ThreadPlan>,
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 {
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.
virtual Vote ShouldReportStop(Event *event_ptr);
- virtual Vote ShouldReportRun(Event *event_ptr);
+ Vote ShouldReportRun(Event *event_ptr);
virtual void SetStopOthers(bool new_value);
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();
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)
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) {
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.
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);
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();