• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 SBThread and SBFrame."
22 ) SBThread;
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     eStopReasonPlanComplete  0") GetStopReasonDataAtIndex;
77     uint64_t
78     GetStopReasonDataAtIndex(uint32_t idx);
79 
80     SBThread
81     GetThread () const;
82 
83     bool
84     GetDescription (lldb::SBStream &description) const;
85 
86     void
87     SetPlanComplete (bool success);
88 
89     bool
90     IsPlanComplete();
91 
92     bool
93     IsPlanStale();
94 
95     %feature("docstring", "Return whether this plan will ask to stop other threads when it runs.") GetStopOthers;
96     bool
97     GetStopOthers();
98 
99     %feature("docstring", "Set whether this plan will ask to stop other threads when it runs.")	GetStopOthers;
100     void
101     SetStopOthers(bool stop_others);
102 
103     SBThreadPlan
104     QueueThreadPlanForStepOverRange (SBAddress &start_address,
105                                      lldb::addr_t range_size);
106 
107     SBThreadPlan
108     QueueThreadPlanForStepInRange (SBAddress &start_address,
109                                    lldb::addr_t range_size);
110 
111     SBThreadPlan
112     QueueThreadPlanForStepOut (uint32_t frame_idx_to_step_to, bool first_insn = false);
113 
114     SBThreadPlan
115     QueueThreadPlanForRunToAddress (SBAddress address);
116 
117     SBThreadPlan
118     QueueThreadPlanForStepScripted(const char *script_class_name);
119 
120     SBThreadPlan
121     QueueThreadPlanForStepScripted(const char *script_class_name,
122                                    SBError &error);
123     SBThreadPlan
124     QueueThreadPlanForStepScripted(const char *script_class_name,
125                                    SBStructuredData &args_data,
126                                    SBError &error);
127 
128 
129 protected:
130     friend class SBBreakpoint;
131     friend class SBBreakpointLocation;
132     friend class SBFrame;
133     friend class SBProcess;
134     friend class SBDebugger;
135     friend class SBValue;
136     friend class lldb_private::QueueImpl;
137     friend class SBQueueItem;
138 
139 private:
140     lldb::ThreadPlanSP m_opaque_sp;
141 };
142 
143 } // namespace lldb
144 
145 #endif  // LLDB_SBThreadPlan_h_
146