LLDB  mainline
ThreadPlanPython.h
Go to the documentation of this file.
1 //===-- ThreadPlanPython.h --------------------------------------------*- C++
2 //-*-===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLDB_TARGET_THREADPLANPYTHON_H
11 #define LLDB_TARGET_THREADPLANPYTHON_H
12 
13 #include <string>
14 
15 #include "lldb/lldb-forward.h"
16 
17 #include "lldb/Target/Process.h"
18 #include "lldb/Target/StopInfo.h"
19 #include "lldb/Target/Target.h"
20 #include "lldb/Target/Thread.h"
21 #include "lldb/Target/ThreadPlan.h"
24 #include "lldb/Utility/UserID.h"
25 #include "lldb/lldb-private.h"
26 
27 namespace lldb_private {
28 
29 // ThreadPlanPython:
30 //
31 
32 class ThreadPlanPython : public ThreadPlan {
33 public:
34  ThreadPlanPython(Thread &thread, const char *class_name,
35  StructuredDataImpl *args_data);
36  ~ThreadPlanPython() override;
37 
38  void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
39 
40  bool ValidatePlan(Stream *error) override;
41 
42  bool ShouldStop(Event *event_ptr) override;
43 
44  bool MischiefManaged() override;
45 
46  bool WillStop() override;
47 
48  bool StopOthers() override;
49 
50  void DidPush() override;
51 
52  bool IsPlanStale() override;
53 
54 protected:
55  bool DoPlanExplainsStop(Event *event_ptr) override;
56 
58 
60 
61 private:
62  std::string m_class_name;
63  StructuredDataImpl *m_args_data; // We own this, but the implementation
64  // has to manage the UP (since that is
65  // how it gets stored in the
66  // SBStructuredData).
67  std::string m_error_str;
69  bool m_did_push;
70 
71  ThreadPlanPython(const ThreadPlanPython &) = delete;
72  const ThreadPlanPython &operator=(const ThreadPlanPython &) = delete;
73 };
74 
75 } // namespace lldb_private
76 
77 #endif // LLDB_TARGET_THREADPLANPYTHON_H
A class that represents a running process on the host machine.
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
const ThreadPlanPython & operator=(const ThreadPlanPython &)=delete
ScriptInterpreter * GetScriptInterpreter()
StructuredData::ObjectSP m_implementation_sp
bool ShouldStop(Event *event_ptr) override
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
StructuredDataImpl * m_args_data
static llvm::raw_ostream & error(Stream &strm)
StateType
Process and Thread States.
ThreadPlanPython(Thread &thread, const char *class_name, StructuredDataImpl *args_data)
bool ValidatePlan(Stream *error) override
Returns whether this plan could be successfully created.
bool DoPlanExplainsStop(Event *event_ptr) override
std::shared_ptr< Object > ObjectSP
void GetDescription(Stream *s, lldb::DescriptionLevel level) override
Print a description of this thread to the stream s.
lldb::StateType GetPlanRunState() override