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