xref: /openbsd-src/gnu/llvm/lldb/bindings/interface/SBThreadPlan.i (revision be691f3bb6417f04a68938fadbcaee2d5795e764)
1 //===-- SBThread.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_SBThreadPlan_h_
10 #define LLDB_SBThreadPlan_h_
11 
12 #include "lldb/API/SBDefines.h"
13 
14 #include <stdio.h>
15 
16 namespace lldb {
17 
18 %feature("docstring",
19 "Represents a plan for the execution control of a given thread.
20 
21 See also :py:class:`SBThread` and :py:class:`SBFrame`."
22 ) SBThreadPlan;
23 
24 class SBThreadPlan
25 {
26 
27 friend class lldb_private::ThreadPlan;
28 
29 public:
30     SBThreadPlan ();
31 
32     SBThreadPlan (const lldb::SBThreadPlan &threadPlan);
33 
34     SBThreadPlan (const lldb::ThreadPlanSP& lldb_object_sp);
35 
36     SBThreadPlan (lldb::SBThread &thread, const char *class_name);
37 
38    ~SBThreadPlan ();
39 
40     bool
41     IsValid();
42 
43     bool
44     IsValid() const;
45 
46     explicit operator bool() const;
47 
48     void
49     Clear ();
50 
51     lldb::StopReason
52     GetStopReason();
53 
54     %feature("docstring", "
55     Get the number of words associated with the stop reason.
56     See also GetStopReasonDataAtIndex().") GetStopReasonDataCount;
57     size_t
58     GetStopReasonDataCount();
59 
60     %feature("docstring", "
61     Get information associated with a stop reason.
62 
63     Breakpoint stop reasons will have data that consists of pairs of
64     breakpoint IDs followed by the breakpoint location IDs (they always come
65     in pairs).
66 
67     Stop Reason              Count Data Type
68     ======================== ===== =========================================
69     eStopReasonNone          0
70     eStopReasonTrace         0
71     eStopReasonBreakpoint    N     duple: {breakpoint id, location id}
72     eStopReasonWatchpoint    1     watchpoint id
73     eStopReasonSignal        1     unix signal number
74     eStopReasonException     N     exception data
75     eStopReasonExec          0
76     eStopReasonFork          1     pid of the child process
77     eStopReasonVFork         1     pid of the child process
78     eStopReasonVForkDone     0
79     eStopReasonPlanComplete  0") GetStopReasonDataAtIndex;
80     uint64_t
81     GetStopReasonDataAtIndex(uint32_t idx);
82 
83     SBThread
84     GetThread () const;
85 
86     bool
87     GetDescription (lldb::SBStream &description) const;
88 
89     void
90     SetPlanComplete (bool success);
91 
92     bool
93     IsPlanComplete();
94 
95     bool
96     IsPlanStale();
97 
98     %feature("docstring", "Return whether this plan will ask to stop other threads when it runs.") GetStopOthers;
99     bool
100     GetStopOthers();
101 
102     %feature("docstring", "Set whether this plan will ask to stop other threads when it runs.")	GetStopOthers;
103     void
104     SetStopOthers(bool stop_others);
105 
106     SBThreadPlan
107     QueueThreadPlanForStepOverRange (SBAddress &start_address,
108                                      lldb::addr_t range_size);
109 
110     SBThreadPlan
111     QueueThreadPlanForStepInRange (SBAddress &start_address,
112                                    lldb::addr_t range_size);
113 
114     SBThreadPlan
115     QueueThreadPlanForStepOut (uint32_t frame_idx_to_step_to, bool first_insn = false);
116 
117     SBThreadPlan
118     QueueThreadPlanForRunToAddress (SBAddress address);
119 
120     SBThreadPlan
121     QueueThreadPlanForStepScripted(const char *script_class_name);
122 
123     SBThreadPlan
124     QueueThreadPlanForStepScripted(const char *script_class_name,
125                                    SBError &error);
126     SBThreadPlan
127     QueueThreadPlanForStepScripted(const char *script_class_name,
128                                    SBStructuredData &args_data,
129                                    SBError &error);
130 
131 
132 protected:
133     friend class SBBreakpoint;
134     friend class SBBreakpointLocation;
135     friend class SBFrame;
136     friend class SBProcess;
137     friend class SBDebugger;
138     friend class SBValue;
139     friend class lldb_private::QueueImpl;
140     friend class SBQueueItem;
141 
142 private:
143     lldb::ThreadPlanSP m_opaque_sp;
144 };
145 
146 } // namespace lldb
147 
148 #endif  // LLDB_SBThreadPlan_h_
149