1254721Semaste//===-- ThreadPlanBase.h ----------------------------------------*- C++ -*-===//
2254721Semaste//
3254721Semaste//                     The LLVM Compiler Infrastructure
4254721Semaste//
5254721Semaste// This file is distributed under the University of Illinois Open Source
6254721Semaste// License. See LICENSE.TXT for details.
7254721Semaste//
8254721Semaste//===----------------------------------------------------------------------===//
9254721Semaste
10254721Semaste#ifndef liblldb_ThreadPlanFundamental_h_
11254721Semaste#define liblldb_ThreadPlanFundamental_h_
12254721Semaste
13254721Semaste// C Includes
14254721Semaste// C++ Includes
15254721Semaste// Other libraries and framework includes
16254721Semaste// Project includes
17254721Semaste#include "lldb/Target/Process.h"
18254721Semaste#include "lldb/Target/Thread.h"
19254721Semaste#include "lldb/Target/ThreadPlan.h"
20254721Semaste
21254721Semastenamespace lldb_private {
22254721Semaste
23254721Semaste
24254721Semaste//------------------------------------------------------------------
25254721Semaste//  Base thread plans:
26254721Semaste//  This is the generic version of the bottom most plan on the plan stack.  It should
27254721Semaste//  be able to handle generic breakpoint hitting, and signals and exceptions.
28254721Semaste//------------------------------------------------------------------
29254721Semaste
30254721Semasteclass ThreadPlanBase : public ThreadPlan
31254721Semaste{
32254721Semastefriend class Process;  // RunThreadPlan manages "stopper" base plans.
33254721Semastepublic:
34254721Semaste    virtual ~ThreadPlanBase ();
35254721Semaste
36254721Semaste    virtual void GetDescription (Stream *s, lldb::DescriptionLevel level);
37254721Semaste    virtual bool ValidatePlan (Stream *error);
38254721Semaste    virtual bool ShouldStop (Event *event_ptr);
39254721Semaste    virtual Vote ShouldReportStop (Event *event_ptr);
40254721Semaste    virtual bool StopOthers ();
41254721Semaste    virtual lldb::StateType GetPlanRunState ();
42254721Semaste    virtual bool WillStop ();
43254721Semaste    virtual bool MischiefManaged ();
44254721Semaste
45254721Semaste    virtual bool OkayToDiscard()
46254721Semaste    {
47254721Semaste        return false;
48254721Semaste    }
49254721Semaste
50254721Semaste    virtual bool
51254721Semaste    IsBasePlan()
52254721Semaste    {
53254721Semaste        return true;
54254721Semaste    }
55254721Semaste
56254721Semasteprotected:
57254721Semaste    virtual bool DoWillResume (lldb::StateType resume_state, bool current_plan);
58254721Semaste    virtual bool DoPlanExplainsStop (Event *event_ptr);
59254721Semaste    ThreadPlanBase (Thread &thread);
60254721Semaste
61254721Semasteprivate:
62254721Semaste    friend lldb::ThreadPlanSP
63254721Semaste    Thread::QueueFundamentalPlan(bool abort_other_plans);
64254721Semaste
65254721Semaste    DISALLOW_COPY_AND_ASSIGN (ThreadPlanBase);
66254721Semaste};
67254721Semaste
68254721Semaste
69254721Semaste} // namespace lldb_private
70254721Semaste
71254721Semaste#endif  // liblldb_ThreadPlanFundamental_h_
72