]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/API/SBThreadPlan.h
MFV r289310:
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / API / SBThreadPlan.h
1 //===-- SBThread.h ----------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLDB_SBThreadPlan_h_
11 #define LLDB_SBThreadPlan_h_
12
13 #include "lldb/API/SBDefines.h"
14
15 #include <stdio.h>
16
17 namespace lldb {
18
19 class LLDB_API SBThreadPlan
20 {
21
22 friend class lldb_private::ThreadPlan;
23
24 public:
25     SBThreadPlan ();
26
27     SBThreadPlan (const lldb::SBThreadPlan &threadPlan);
28     
29     SBThreadPlan (const lldb::ThreadPlanSP& lldb_object_sp);
30
31     SBThreadPlan (lldb::SBThread &thread, const char *class_name);
32
33    ~SBThreadPlan ();
34
35     bool
36     IsValid() const;
37
38     void
39     Clear ();
40
41     lldb::StopReason
42     GetStopReason();
43
44     /// Get the number of words associated with the stop reason.
45     /// See also GetStopReasonDataAtIndex().
46     size_t
47     GetStopReasonDataCount();
48
49     //--------------------------------------------------------------------------
50     /// Get information associated with a stop reason.
51     ///
52     /// Breakpoint stop reasons will have data that consists of pairs of 
53     /// breakpoint IDs followed by the breakpoint location IDs (they always come
54     /// in pairs).
55     ///
56     /// Stop Reason              Count Data Type
57     /// ======================== ===== =========================================
58     /// eStopReasonNone          0
59     /// eStopReasonTrace         0
60     /// eStopReasonBreakpoint    N     duple: {breakpoint id, location id}
61     /// eStopReasonWatchpoint    1     watchpoint id
62     /// eStopReasonSignal        1     unix signal number
63     /// eStopReasonException     N     exception data
64     /// eStopReasonExec          0
65     /// eStopReasonPlanComplete  0
66     //--------------------------------------------------------------------------
67     uint64_t
68     GetStopReasonDataAtIndex(uint32_t idx);
69
70     SBThread
71     GetThread () const;
72
73     const lldb::SBThreadPlan &
74     operator = (const lldb::SBThreadPlan &rhs);
75
76     bool
77     GetDescription (lldb::SBStream &description) const;
78
79     void
80     SetPlanComplete (bool success);
81
82     bool
83     IsPlanComplete();
84
85     bool
86     IsValid();
87
88     // This section allows an SBThreadPlan to push another of the common types of plans...
89     SBThreadPlan
90     QueueThreadPlanForStepOverRange (SBAddress &start_address,
91                                      lldb::addr_t range_size);
92
93     SBThreadPlan
94     QueueThreadPlanForStepInRange (SBAddress &start_address,
95                                    lldb::addr_t range_size);
96
97     SBThreadPlan
98     QueueThreadPlanForStepOut (uint32_t frame_idx_to_step_to, bool first_insn = false);
99
100     SBThreadPlan
101     QueueThreadPlanForRunToAddress (SBAddress address);
102
103 #ifndef SWIG
104     lldb_private::ThreadPlan *
105     get();
106 #endif
107
108 protected:
109     friend class SBBreakpoint;
110     friend class SBBreakpointLocation;
111     friend class SBFrame;
112     friend class SBProcess;
113     friend class SBDebugger;
114     friend class SBValue;
115     friend class lldb_private::QueueImpl;
116     friend class SBQueueItem;
117
118 #ifndef SWIG
119     void
120     SetThreadPlan (const lldb::ThreadPlanSP& lldb_object_sp);
121 #endif
122
123 private:
124     lldb::ThreadPlanSP m_opaque_sp;
125 };
126
127 } // namespace lldb
128
129 #endif  // LLDB_SBThreadPlan_h_