File indexing completed on 2026-05-10 08:42:42
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_API_SBTHREAD_H
0010 #define LLDB_API_SBTHREAD_H
0011
0012 #include "lldb/API/SBDefines.h"
0013
0014 #include <cstdio>
0015
0016 namespace lldb_private {
0017 namespace python {
0018 class SWIGBridge;
0019 }
0020 }
0021
0022 namespace lldb {
0023
0024 class SBFrame;
0025
0026 class LLDB_API SBThread {
0027 public:
0028 enum {
0029 eBroadcastBitStackChanged = (1 << 0),
0030 eBroadcastBitThreadSuspended = (1 << 1),
0031 eBroadcastBitThreadResumed = (1 << 2),
0032 eBroadcastBitSelectedFrameChanged = (1 << 3),
0033 eBroadcastBitThreadSelected = (1 << 4)
0034 };
0035
0036 static const char *GetBroadcasterClassName();
0037
0038 SBThread();
0039
0040 SBThread(const lldb::SBThread &thread);
0041
0042 ~SBThread();
0043
0044 lldb::SBQueue GetQueue() const;
0045
0046 explicit operator bool() const;
0047
0048 bool IsValid() const;
0049
0050 void Clear();
0051
0052 lldb::StopReason GetStopReason();
0053
0054
0055
0056 size_t GetStopReasonDataCount();
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077 uint64_t GetStopReasonDataAtIndex(uint32_t idx);
0078
0079 bool GetStopReasonExtendedInfoAsJSON(lldb::SBStream &stream);
0080
0081 SBThreadCollection
0082 GetStopReasonExtendedBacktraces(InstrumentationRuntimeType type);
0083
0084 size_t GetStopDescription(char *dst_or_null, size_t dst_len);
0085
0086 SBValue GetStopReturnValue();
0087
0088 lldb::tid_t GetThreadID() const;
0089
0090 uint32_t GetIndexID() const;
0091
0092 const char *GetName() const;
0093
0094 const char *GetQueueName() const;
0095
0096 lldb::queue_id_t GetQueueID() const;
0097
0098 bool GetInfoItemByPathAsString(const char *path, SBStream &strm);
0099
0100 void StepOver(lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
0101
0102 void StepOver(lldb::RunMode stop_other_threads, SBError &error);
0103
0104 void StepInto(lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
0105
0106 void StepInto(const char *target_name,
0107 lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
0108
0109 void StepInto(const char *target_name, uint32_t end_line, SBError &error,
0110 lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
0111
0112 void StepOut();
0113
0114 void StepOut(SBError &error);
0115
0116 void StepOutOfFrame(SBFrame &frame);
0117
0118 void StepOutOfFrame(SBFrame &frame, SBError &error);
0119
0120 void StepInstruction(bool step_over);
0121
0122 void StepInstruction(bool step_over, SBError &error);
0123
0124 SBError StepOverUntil(lldb::SBFrame &frame, lldb::SBFileSpec &file_spec,
0125 uint32_t line);
0126
0127 SBError StepUsingScriptedThreadPlan(const char *script_class_name);
0128
0129 SBError StepUsingScriptedThreadPlan(const char *script_class_name,
0130 bool resume_immediately);
0131
0132 SBError StepUsingScriptedThreadPlan(const char *script_class_name,
0133 lldb::SBStructuredData &args_data,
0134 bool resume_immediately);
0135
0136 SBError JumpToLine(lldb::SBFileSpec &file_spec, uint32_t line);
0137
0138 void RunToAddress(lldb::addr_t addr);
0139
0140 void RunToAddress(lldb::addr_t addr, SBError &error);
0141
0142 SBError ReturnFromFrame(SBFrame &frame, SBValue &return_value);
0143
0144 SBError UnwindInnermostExpression();
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165 bool Suspend();
0166
0167 bool Suspend(SBError &error);
0168
0169 bool Resume();
0170
0171 bool Resume(SBError &error);
0172
0173 bool IsSuspended();
0174
0175 bool IsStopped();
0176
0177 uint32_t GetNumFrames();
0178
0179 lldb::SBFrame GetFrameAtIndex(uint32_t idx);
0180
0181 lldb::SBFrame GetSelectedFrame();
0182
0183 lldb::SBFrame SetSelectedFrame(uint32_t frame_idx);
0184
0185 static bool EventIsThreadEvent(const SBEvent &event);
0186
0187 static SBFrame GetStackFrameFromEvent(const SBEvent &event);
0188
0189 static SBThread GetThreadFromEvent(const SBEvent &event);
0190
0191 lldb::SBProcess GetProcess();
0192
0193 const lldb::SBThread &operator=(const lldb::SBThread &rhs);
0194
0195 bool operator==(const lldb::SBThread &rhs) const;
0196
0197 bool operator!=(const lldb::SBThread &rhs) const;
0198
0199 bool GetDescription(lldb::SBStream &description) const;
0200
0201 bool GetDescription(lldb::SBStream &description, bool stop_format) const;
0202
0203
0204
0205
0206
0207
0208
0209
0210
0211
0212
0213
0214
0215
0216 SBError GetDescriptionWithFormat(const SBFormat &format, SBStream &output);
0217
0218 bool GetStatus(lldb::SBStream &status) const;
0219
0220 SBThread GetExtendedBacktraceThread(const char *type);
0221
0222 uint32_t GetExtendedBacktraceOriginatingIndexID();
0223
0224 SBValue GetCurrentException();
0225
0226 SBThread GetCurrentExceptionBacktrace();
0227
0228 bool SafeToCallFunctions();
0229
0230 SBValue GetSiginfo();
0231
0232 private:
0233 friend class SBBreakpoint;
0234 friend class SBBreakpointLocation;
0235 friend class SBBreakpointCallbackBaton;
0236 friend class SBSaveCoreOptions;
0237 friend class SBExecutionContext;
0238 friend class SBFrame;
0239 friend class SBProcess;
0240 friend class SBDebugger;
0241 friend class SBValue;
0242 friend class lldb_private::QueueImpl;
0243 friend class SBQueueItem;
0244 friend class SBThreadCollection;
0245 friend class SBThreadPlan;
0246 friend class SBTrace;
0247
0248 friend class lldb_private::python::SWIGBridge;
0249
0250 SBThread(const lldb::ThreadSP &lldb_object_sp);
0251
0252 void SetThread(const lldb::ThreadSP &lldb_object_sp);
0253
0254 SBError ResumeNewPlan(lldb_private::ExecutionContext &exe_ctx,
0255 lldb_private::ThreadPlan *new_plan);
0256
0257 lldb::ThreadSP GetSP() const;
0258
0259 lldb::ExecutionContextRefSP m_opaque_sp;
0260
0261 lldb_private::Thread *operator->();
0262
0263 lldb_private::Thread *get();
0264 };
0265
0266 }
0267
0268 #endif