LLDB mainline
ThreadPlanBase.h
Go to the documentation of this file.
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 LLDB_TARGET_THREADPLANBASE_H
10#define LLDB_TARGET_THREADPLANBASE_H
11
12#include "lldb/Target/Process.h"
13#include "lldb/Target/Thread.h"
15
16namespace 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
23class ThreadPlanBase : public ThreadPlan {
24 friend class Process; // RunThreadPlan manages "stopper" base plans.
25public:
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;
34 bool WillStop() override;
35 bool MischiefManaged() override;
36
37 bool OkayToDiscard() override { return false; }
38
39 bool IsBasePlan() override { return true; }
40
41 lldb::RunDirection GetDirection() const override;
42
43protected:
44 bool DoWillResume(lldb::StateType resume_state, bool current_plan) override;
45 bool DoPlanExplainsStop(Event *event_ptr) override;
46 ThreadPlanBase(Thread &thread);
47
48private:
49 friend lldb::ThreadPlanSP Thread::QueueBasePlan(bool abort_other_plans);
50
51 ThreadPlanBase(const ThreadPlanBase &) = delete;
52 const ThreadPlanBase &operator=(const ThreadPlanBase &) = delete;
53};
54
55} // namespace lldb_private
56
57#endif // LLDB_TARGET_THREADPLANBASE_H
static llvm::raw_ostream & error(Stream &strm)
A stream class that can stream formatted output to a file.
Definition Stream.h:28
bool DoWillResume(lldb::StateType resume_state, bool current_plan) override
bool ValidatePlan(Stream *error) override
Returns whether this plan could be successfully created.
const ThreadPlanBase & operator=(const ThreadPlanBase &)=delete
ThreadPlanBase(const ThreadPlanBase &)=delete
bool ShouldStop(Event *event_ptr) override
bool DoPlanExplainsStop(Event *event_ptr) override
lldb::StateType GetPlanRunState() override
Vote ShouldReportStop(Event *event_ptr) override
lldb::RunDirection GetDirection() const override
void GetDescription(Stream *s, lldb::DescriptionLevel level) override
Print a description of this thread to the stream s.
ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread, Vote report_stop_vote, Vote report_run_vote)
lldb::ThreadPlanSP QueueBasePlan(bool abort_other_plans)
Queues the base plan for a thread.
Definition Thread.cpp:1270
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
RunDirection
Execution directions.
StateType
Process and Thread States.