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);
33 explicit operator bool() const;
39 lldb::StopReason GetStopReason();
41 /// Get the number of words associated with the stop reason.
42 /// See also GetStopReasonDataAtIndex().
43 size_t GetStopReasonDataCount();
45 /// Get information associated with a stop reason.
47 /// Breakpoint stop reasons will have data that consists of pairs of
48 /// breakpoint IDs followed by the breakpoint location IDs (they always come
51 /// Stop Reason Count Data Type
52 /// ======================== ===== =========================================
54 /// eStopReasonTrace 0
55 /// eStopReasonBreakpoint N duple: {breakpoint id, location id}
56 /// eStopReasonWatchpoint 1 watchpoint id
57 /// eStopReasonSignal 1 unix signal number
58 /// eStopReasonException N exception data
60 /// eStopReasonPlanComplete 0
61 uint64_t GetStopReasonDataAtIndex(uint32_t idx);
63 SBThread GetThread() const;
65 const lldb::SBThreadPlan &operator=(const lldb::SBThreadPlan &rhs);
67 bool GetDescription(lldb::SBStream &description) const;
69 void SetPlanComplete(bool success);
71 bool IsPlanComplete();
77 // This section allows an SBThreadPlan to push another of the common types of
79 SBThreadPlan QueueThreadPlanForStepOverRange(SBAddress &start_address,
80 lldb::addr_t range_size);
81 SBThreadPlan QueueThreadPlanForStepOverRange(SBAddress &start_address,
82 lldb::addr_t range_size,
85 SBThreadPlan QueueThreadPlanForStepInRange(SBAddress &start_address,
86 lldb::addr_t range_size);
87 SBThreadPlan QueueThreadPlanForStepInRange(SBAddress &start_address,
88 lldb::addr_t range_size,
91 SBThreadPlan QueueThreadPlanForStepOut(uint32_t frame_idx_to_step_to,
92 bool first_insn = false);
93 SBThreadPlan QueueThreadPlanForStepOut(uint32_t frame_idx_to_step_to,
94 bool first_insn, SBError &error);
96 SBThreadPlan QueueThreadPlanForRunToAddress(SBAddress address);
97 SBThreadPlan QueueThreadPlanForRunToAddress(SBAddress address,
100 SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name);
101 SBThreadPlan QueueThreadPlanForStepScripted(const char *script_class_name,
105 friend class SBBreakpoint;
106 friend class SBBreakpointLocation;
107 friend class SBFrame;
108 friend class SBProcess;
109 friend class SBDebugger;
110 friend class SBValue;
111 friend class lldb_private::QueueImpl;
112 friend class SBQueueItem;
114 lldb_private::ThreadPlan *get();
115 void SetThreadPlan(const lldb::ThreadPlanSP &lldb_object_sp);
117 lldb::ThreadPlanSP m_opaque_sp;
122 #endif // LLDB_SBThreadPlan_h_