]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/include/lldb/Target/ThreadPlanBase.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / include / lldb / Target / ThreadPlanBase.h
1 //===-- ThreadPlanBase.h ----------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef liblldb_ThreadPlanFundamental_h_
10 #define liblldb_ThreadPlanFundamental_h_
11
12 #include "lldb/Target/Process.h"
13 #include "lldb/Target/Thread.h"
14 #include "lldb/Target/ThreadPlan.h"
15
16 namespace lldb_private {
17
18 //  Base thread plans:
19 //  This is the generic version of the bottom most plan on the plan stack.  It
20 //  should
21 //  be able to handle generic breakpoint hitting, and signals and exceptions.
22
23 class ThreadPlanBase : public ThreadPlan {
24   friend class Process; // RunThreadPlan manages "stopper" base plans.
25 public:
26   ~ThreadPlanBase() override;
27
28   void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
29   bool ValidatePlan(Stream *error) override;
30   bool ShouldStop(Event *event_ptr) override;
31   Vote ShouldReportStop(Event *event_ptr) override;
32   bool StopOthers() override;
33   lldb::StateType GetPlanRunState() override;
34   bool WillStop() override;
35   bool MischiefManaged() override;
36
37   bool OkayToDiscard() override { return false; }
38
39   bool IsBasePlan() override { return true; }
40
41 protected:
42   bool DoWillResume(lldb::StateType resume_state, bool current_plan) override;
43   bool DoPlanExplainsStop(Event *event_ptr) override;
44   ThreadPlanBase(Thread &thread);
45
46 private:
47   friend lldb::ThreadPlanSP
48   Thread::QueueFundamentalPlan(bool abort_other_plans);
49
50   DISALLOW_COPY_AND_ASSIGN(ThreadPlanBase);
51 };
52
53 } // namespace lldb_private
54
55 #endif // liblldb_ThreadPlanFundamental_h_