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
45
46 /// Get the number of words associated with the stop reason.
47 /// See also GetStopReasonDataAtIndex().
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
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...
92 lldb::addr_t range_size);
94 lldb::addr_t range_size,
95 SBError &error);
96
98 lldb::addr_t range_size);
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
109 SBError &error);
110
113 SBError &error);
114
115 SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name);
116 SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name,
117 SBError &error);
118 SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name,
119 lldb::SBStructuredData &args_data,
120 SBError &error);
121
122protected:
123 friend class lldb_private::python::SWIGBridge;
124
125 SBThreadPlan(const lldb::ThreadPlanSP &lldb_object_sp);
126
127private:
128 friend class SBBreakpoint;
130 friend class SBFrame;
131 friend class SBProcess;
132 friend class SBDebugger;
133 friend class SBValue;
135 friend class SBQueueItem;
136
137 lldb::ThreadPlanSP GetSP() const { return m_opaque_wp.lock(); }
138 lldb_private::ThreadPlan *get() const { return GetSP().get(); }
139 void SetThreadPlan(const lldb::ThreadPlanSP &lldb_object_sp);
140
142};
143
144} // namespace lldb
145
146#endif // LLDB_API_SBTHREADPLAN_H
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_API
Definition SBDefines.h:28
lldb::StopReason GetStopReason()
SBThreadPlan QueueThreadPlanForStepInRange(SBAddress &start_address, lldb::addr_t range_size)
bool IsValid() const
bool GetDescription(lldb::SBStream &description) const
lldb::ThreadPlanSP GetSP() const
friend class SBProcess
friend class SBQueueItem
lldb_private::ThreadPlan * get() const
void SetPlanComplete(bool success)
friend class SBDebugger
SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name)
friend class SBBreakpoint
void SetStopOthers(bool stop_others)
friend class SBValue
SBThreadPlan QueueThreadPlanForStepSingleInstruction(bool step_over, SBError &error)
SBThread GetThread() const
const lldb::SBThreadPlan & operator=(const lldb::SBThreadPlan &rhs)
size_t GetStopReasonDataCount()
Get the number of words associated with the stop reason.
SBThreadPlan QueueThreadPlanForStepOverRange(SBAddress &start_address, lldb::addr_t range_size)
uint64_t GetStopReasonDataAtIndex(uint32_t idx)
Get information associated with a stop reason.
SBThreadPlan QueueThreadPlanForRunToAddress(SBAddress address)
lldb::ThreadPlanWP m_opaque_wp
SBThreadPlan QueueThreadPlanForStepOut(uint32_t frame_idx_to_step_to, bool first_insn=false)
friend class SBFrame
friend class SBBreakpointLocation
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
std::weak_ptr< lldb_private::ThreadPlan > ThreadPlanWP
uint64_t addr_t
Definition lldb-types.h:80
StopReason
Thread stop reasons.