LLDB mainline
SBThreadPlan.h
Go to the documentation of this file.
1//===-- SBThreadPlan.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_API_SBTHREADPLAN_H
10#define LLDB_API_SBTHREADPLAN_H
11
12#include "lldb/API/SBDefines.h"
13
14#include <cstdio>
15
16namespace lldb_private {
17namespace python {
18class SWIGBridge;
19}
20} // namespace lldb_private
21
22namespace lldb {
23
25
26public:
28
29 SBThreadPlan(const lldb::SBThreadPlan &threadPlan);
30
31 SBThreadPlan(lldb::SBThread &thread, const char *class_name);
32
33 SBThreadPlan(lldb::SBThread &thread, const char *class_name,
34 lldb::SBStructuredData &args_data);
35
37
38 explicit operator bool() const;
39
40 bool IsValid() const;
41
42 void Clear();
43
44 lldb::StopReason GetStopReason();
45
46 /// Get the number of words associated with the stop reason.
47 /// See also GetStopReasonDataAtIndex().
48 size_t GetStopReasonDataCount();
49
50 /// Get information associated with a stop reason.
51 ///
52 /// Breakpoint stop reasons will have data that consists of pairs of
53 /// breakpoint IDs followed by the breakpoint location IDs (they always come
54 /// in pairs).
55 ///
56 /// Stop Reason Count Data Type
57 /// ======================== ===== =========================================
58 /// eStopReasonNone 0
59 /// eStopReasonTrace 0
60 /// eStopReasonBreakpoint N duple: {breakpoint id, location id}
61 /// eStopReasonWatchpoint 1 watchpoint id
62 /// eStopReasonSignal 1 unix signal number
63 /// eStopReasonException N exception data
64 /// eStopReasonExec 0
65 /// eStopReasonFork 1 pid of the child process
66 /// eStopReasonVFork 1 pid of the child process
67 /// eStopReasonVForkDone 0
68 /// eStopReasonPlanComplete 0
69 uint64_t GetStopReasonDataAtIndex(uint32_t idx);
70
71 SBThread GetThread() const;
72
73 const lldb::SBThreadPlan &operator=(const lldb::SBThreadPlan &rhs);
74
75 bool GetDescription(lldb::SBStream &description) const;
76
77 void SetPlanComplete(bool success);
78
79 bool IsPlanComplete();
80
81 bool IsPlanStale();
82
83 bool IsValid();
84
85 bool GetStopOthers();
86
87 void SetStopOthers(bool stop_others);
88
89 // This section allows an SBThreadPlan to push another of the common types of
90 // plans...
91 SBThreadPlan QueueThreadPlanForStepOverRange(SBAddress &start_address,
92 lldb::addr_t range_size);
93 SBThreadPlan QueueThreadPlanForStepOverRange(SBAddress &start_address,
94 lldb::addr_t range_size,
95 SBError &error);
96
97 SBThreadPlan QueueThreadPlanForStepInRange(SBAddress &start_address,
98 lldb::addr_t range_size);
99 SBThreadPlan QueueThreadPlanForStepInRange(SBAddress &start_address,
100 lldb::addr_t range_size,
101 SBError &error);
102
103 SBThreadPlan QueueThreadPlanForStepOut(uint32_t frame_idx_to_step_to,
104 bool first_insn = false);
105 SBThreadPlan QueueThreadPlanForStepOut(uint32_t frame_idx_to_step_to,
106 bool first_insn, SBError &error);
107
108 SBThreadPlan QueueThreadPlanForRunToAddress(SBAddress address);
109 SBThreadPlan QueueThreadPlanForRunToAddress(SBAddress address,
110 SBError &error);
111
112 SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name);
113 SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name,
114 SBError &error);
115 SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name,
116 lldb::SBStructuredData &args_data,
117 SBError &error);
118
119protected:
120 friend class lldb_private::python::SWIGBridge;
121
122 SBThreadPlan(const lldb::ThreadPlanSP &lldb_object_sp);
123
124private:
125 friend class SBBreakpoint;
127 friend class SBFrame;
128 friend class SBProcess;
129 friend class SBDebugger;
130 friend class SBValue;
132 friend class SBQueueItem;
133
134 lldb::ThreadPlanSP GetSP() const { return m_opaque_wp.lock(); }
135 lldb_private::ThreadPlan *get() const { return GetSP().get(); }
136 void SetThreadPlan(const lldb::ThreadPlanSP &lldb_object_sp);
137
139};
140
141} // namespace lldb
142
143#endif // LLDB_API_SBTHREADPLAN_H
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_API
Definition: SBDefines.h:28
lldb::ThreadPlanSP GetSP() const
Definition: SBThreadPlan.h:134
lldb_private::ThreadPlan * get() const
Definition: SBThreadPlan.h:135
lldb::ThreadPlanWP m_opaque_wp
Definition: SBThreadPlan.h:138
A class that represents a running process on the host machine.
Definition: SBAddress.h:15
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
Definition: lldb-forward.h:453
std::weak_ptr< lldb_private::ThreadPlan > ThreadPlanWP
Definition: lldb-forward.h:456
uint64_t addr_t
Definition: lldb-types.h:80
StopReason
Thread stop reasons.