]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Target/ThreadPlanBase.h
Import to 0.6.1
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Target / ThreadPlanBase.h
1 //===-- ThreadPlanBase.h ----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_ThreadPlanFundamental_h_
11 #define liblldb_ThreadPlanFundamental_h_
12
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Target/Process.h"
18 #include "lldb/Target/Thread.h"
19 #include "lldb/Target/ThreadPlan.h"
20
21 namespace lldb_private {
22
23
24 //------------------------------------------------------------------
25 //  Base thread plans:
26 //  This is the generic version of the bottom most plan on the plan stack.  It should
27 //  be able to handle generic breakpoint hitting, and signals and exceptions.
28 //------------------------------------------------------------------
29
30 class ThreadPlanBase : public ThreadPlan
31 {
32 friend class Process;  // RunThreadPlan manages "stopper" base plans.
33 public:
34     ~ThreadPlanBase() override;
35
36     void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
37     bool ValidatePlan(Stream *error) override;
38     bool ShouldStop(Event *event_ptr) override;
39     Vote ShouldReportStop(Event *event_ptr) override;
40     bool StopOthers() override;
41     lldb::StateType GetPlanRunState() override;
42     bool WillStop() override;
43     bool MischiefManaged() override;
44
45     bool
46     OkayToDiscard() override
47     {
48         return false;
49     }
50
51     bool
52     IsBasePlan() override
53     {
54         return true;
55     }
56     
57 protected:
58     bool DoWillResume(lldb::StateType resume_state, bool current_plan) override;
59     bool DoPlanExplainsStop(Event *event_ptr) override;
60     ThreadPlanBase (Thread &thread);
61
62 private:
63     friend lldb::ThreadPlanSP
64     Thread::QueueFundamentalPlan(bool abort_other_plans);
65
66     DISALLOW_COPY_AND_ASSIGN (ThreadPlanBase);
67 };
68
69 } // namespace lldb_private
70
71 #endif // liblldb_ThreadPlanFundamental_h_