1 //===-- SBThreadPlan.h ------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SBThreadPlan_h_
10 #define LLDB_SBThreadPlan_h_
12 #include "lldb/API/SBDefines.h"
18 class LLDB_API SBThreadPlan {
20 friend class lldb_private::ThreadPlan;
25 SBThreadPlan(const lldb::SBThreadPlan &threadPlan);
27 SBThreadPlan(const lldb::ThreadPlanSP &lldb_object_sp);
29 SBThreadPlan(lldb::SBThread &thread, const char *class_name);
31 SBThreadPlan(lldb::SBThread &thread, const char *class_name,
32 lldb::SBStructuredData &args_data);
36 explicit operator bool() const;
42 lldb::StopReason GetStopReason();
44 /// Get the number of words associated with the stop reason.
45 /// See also GetStopReasonDataAtIndex().
46 size_t GetStopReasonDataCount();
48 /// Get information associated with a stop reason.
50 /// Breakpoint stop reasons will have data that consists of pairs of
51 /// breakpoint IDs followed by the breakpoint location IDs (they always come
54 /// Stop Reason Count Data Type
55 /// ======================== ===== =========================================
57 /// eStopReasonTrace 0
58 /// eStopReasonBreakpoint N duple: {breakpoint id, location id}
59 /// eStopReasonWatchpoint 1 watchpoint id
60 /// eStopReasonSignal 1 unix signal number
61 /// eStopReasonException N exception data
63 /// eStopReasonPlanComplete 0
64 uint64_t GetStopReasonDataAtIndex(uint32_t idx);
66 SBThread GetThread() const;
68 const lldb::SBThreadPlan &operator=(const lldb::SBThreadPlan &rhs);
70 bool GetDescription(lldb::SBStream &description) const;
72 void SetPlanComplete(bool success);
74 bool IsPlanComplete();
80 // This section allows an SBThreadPlan to push another of the common types of
82 SBThreadPlan QueueThreadPlanForStepOverRange(SBAddress &start_address,
83 lldb::addr_t range_size);
84 SBThreadPlan QueueThreadPlanForStepOverRange(SBAddress &start_address,
85 lldb::addr_t range_size,
88 SBThreadPlan QueueThreadPlanForStepInRange(SBAddress &start_address,
89 lldb::addr_t range_size);
90 SBThreadPlan QueueThreadPlanForStepInRange(SBAddress &start_address,
91 lldb::addr_t range_size,
94 SBThreadPlan QueueThreadPlanForStepOut(uint32_t frame_idx_to_step_to,
95 bool first_insn = false);
96 SBThreadPlan QueueThreadPlanForStepOut(uint32_t frame_idx_to_step_to,
97 bool first_insn, SBError &error);
99 SBThreadPlan QueueThreadPlanForRunToAddress(SBAddress address);
100 SBThreadPlan QueueThreadPlanForRunToAddress(SBAddress address,
103 SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name);
104 SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name,
106 SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name,
107 lldb::SBStructuredData &args_data,
111 friend class SBBreakpoint;
112 friend class SBBreakpointLocation;
113 friend class SBFrame;
114 friend class SBProcess;
115 friend class SBDebugger;
116 friend class SBValue;
117 friend class lldb_private::QueueImpl;
118 friend class SBQueueItem;
120 lldb_private::ThreadPlan *get();
121 void SetThreadPlan(const lldb::ThreadPlanSP &lldb_object_sp);
123 lldb::ThreadPlanSP m_opaque_sp;
128 #endif // LLDB_SBThreadPlan_h_