]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/lldb/API/SBThreadPlan.h
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / 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   friend class lldb_private::ThreadPlan;
22
23 public:
24   SBThreadPlan();
25
26   SBThreadPlan(const lldb::SBThreadPlan &threadPlan);
27
28   SBThreadPlan(const lldb::ThreadPlanSP &lldb_object_sp);
29
30   SBThreadPlan(lldb::SBThread &thread, const char *class_name);
31
32   ~SBThreadPlan();
33
34   bool IsValid() const;
35
36   void Clear();
37
38   lldb::StopReason GetStopReason();
39
40   /// Get the number of words associated with the stop reason.
41   /// See also GetStopReasonDataAtIndex().
42   size_t GetStopReasonDataCount();
43
44   //--------------------------------------------------------------------------
45   /// Get information associated with a stop reason.
46   ///
47   /// Breakpoint stop reasons will have data that consists of pairs of
48   /// breakpoint IDs followed by the breakpoint location IDs (they always come
49   /// in pairs).
50   ///
51   /// Stop Reason              Count Data Type
52   /// ======================== ===== =========================================
53   /// eStopReasonNone          0
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
59   /// eStopReasonExec          0
60   /// eStopReasonPlanComplete  0
61   //--------------------------------------------------------------------------
62   uint64_t GetStopReasonDataAtIndex(uint32_t idx);
63
64   SBThread GetThread() const;
65
66   const lldb::SBThreadPlan &operator=(const lldb::SBThreadPlan &rhs);
67
68   bool GetDescription(lldb::SBStream &description) const;
69
70   void SetPlanComplete(bool success);
71
72   bool IsPlanComplete();
73
74   bool IsPlanStale();
75
76   bool IsValid();
77
78   // This section allows an SBThreadPlan to push another of the common types of
79   // plans...
80   SBThreadPlan QueueThreadPlanForStepOverRange(SBAddress &start_address,
81                                                lldb::addr_t range_size);
82
83   SBThreadPlan QueueThreadPlanForStepInRange(SBAddress &start_address,
84                                              lldb::addr_t range_size);
85
86   SBThreadPlan QueueThreadPlanForStepOut(uint32_t frame_idx_to_step_to,
87                                          bool first_insn = false);
88
89   SBThreadPlan QueueThreadPlanForRunToAddress(SBAddress address);
90
91 #ifndef SWIG
92   lldb_private::ThreadPlan *get();
93 #endif
94
95 protected:
96   friend class SBBreakpoint;
97   friend class SBBreakpointLocation;
98   friend class SBFrame;
99   friend class SBProcess;
100   friend class SBDebugger;
101   friend class SBValue;
102   friend class lldb_private::QueueImpl;
103   friend class SBQueueItem;
104
105 #ifndef SWIG
106   void SetThreadPlan(const lldb::ThreadPlanSP &lldb_object_sp);
107 #endif
108
109 private:
110   lldb::ThreadPlanSP m_opaque_sp;
111 };
112
113 } // namespace lldb
114
115 #endif // LLDB_SBThreadPlan_h_