ThreadPlanBase.h revision 8b73c976083265c4085c57ded28f70629ab8d5f8
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
21namespace 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
30class ThreadPlanBase : public ThreadPlan
31{
32friend class Process;  // RunThreadPlan manages "stopper" base plans.
33public:
34    virtual ~ThreadPlanBase ();
35
36    virtual void GetDescription (Stream *s, lldb::DescriptionLevel level);
37    virtual bool ValidatePlan (Stream *error);
38    virtual bool PlanExplainsStop (Event *event_ptr);
39    virtual bool ShouldStop (Event *event_ptr);
40    virtual Vote ShouldReportStop (Event *event_ptr);
41    virtual bool StopOthers ();
42    virtual lldb::StateType GetPlanRunState ();
43    virtual bool WillStop ();
44    virtual bool MischiefManaged ();
45    virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
46
47    virtual bool OkayToDiscard()
48    {
49        return false;
50    }
51
52    virtual bool
53    IsBasePlan()
54    {
55        return true;
56    }
57
58protected:
59    ThreadPlanBase (Thread &thread);
60
61private:
62    friend ThreadPlan *
63    Thread::QueueFundamentalPlan(bool abort_other_plans);
64
65    DISALLOW_COPY_AND_ASSIGN (ThreadPlanBase);
66};
67
68
69} // namespace lldb_private
70
71#endif  // liblldb_ThreadPlanFundamental_h_
72