1 //===-- ThreadPlanBase.h ----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ThreadPlanFundamental_h_
11 #define liblldb_ThreadPlanFundamental_h_
13 #include "lldb/Target/Process.h"
14 #include "lldb/Target/Thread.h"
15 #include "lldb/Target/ThreadPlan.h"
17 namespace lldb_private {
19 //------------------------------------------------------------------
21 // This is the generic version of the bottom most plan on the plan stack. It
23 // be able to handle generic breakpoint hitting, and signals and exceptions.
24 //------------------------------------------------------------------
26 class ThreadPlanBase : public ThreadPlan {
27 friend class Process; // RunThreadPlan manages "stopper" base plans.
29 ~ThreadPlanBase() override;
31 void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
32 bool ValidatePlan(Stream *error) override;
33 bool ShouldStop(Event *event_ptr) override;
34 Vote ShouldReportStop(Event *event_ptr) override;
35 bool StopOthers() override;
36 lldb::StateType GetPlanRunState() override;
37 bool WillStop() override;
38 bool MischiefManaged() override;
40 bool OkayToDiscard() override { return false; }
42 bool IsBasePlan() override { return true; }
45 bool DoWillResume(lldb::StateType resume_state, bool current_plan) override;
46 bool DoPlanExplainsStop(Event *event_ptr) override;
47 ThreadPlanBase(Thread &thread);
50 friend lldb::ThreadPlanSP
51 Thread::QueueFundamentalPlan(bool abort_other_plans);
53 DISALLOW_COPY_AND_ASSIGN(ThreadPlanBase);
56 } // namespace lldb_private
58 #endif // liblldb_ThreadPlanFundamental_h_