Jim Ingham | 2bdbfd5 | 2014-09-29 23:17:18 +0000 | [diff] [blame] | 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 | %feature("docstring", |
| 20 | "Represents a plan for the execution control of a given thread. |
| 21 | |
| 22 | See also SBThread and SBFrame." |
| 23 | ) SBThread; |
| 24 | |
| 25 | class SBThreadPlan |
| 26 | { |
| 27 | |
| 28 | friend class lldb_private::ThreadPlan; |
| 29 | |
| 30 | public: |
| 31 | SBThreadPlan (); |
| 32 | |
| 33 | SBThreadPlan (const lldb::SBThreadPlan &threadPlan); |
| 34 | |
| 35 | SBThreadPlan (const lldb::ThreadPlanSP& lldb_object_sp); |
| 36 | |
| 37 | SBThreadPlan (lldb::SBThread &thread, const char *class_name); |
| 38 | |
| 39 | ~SBThreadPlan (); |
| 40 | |
| 41 | bool |
| 42 | IsValid() const; |
| 43 | |
| 44 | void |
| 45 | Clear (); |
| 46 | |
| 47 | lldb::StopReason |
| 48 | GetStopReason(); |
| 49 | |
| 50 | /// Get the number of words associated with the stop reason. |
| 51 | /// See also GetStopReasonDataAtIndex(). |
| 52 | size_t |
| 53 | GetStopReasonDataCount(); |
| 54 | |
| 55 | //-------------------------------------------------------------------------- |
| 56 | /// Get information associated with a stop reason. |
| 57 | /// |
| 58 | /// Breakpoint stop reasons will have data that consists of pairs of |
| 59 | /// breakpoint IDs followed by the breakpoint location IDs (they always come |
| 60 | /// in pairs). |
| 61 | /// |
| 62 | /// Stop Reason Count Data Type |
| 63 | /// ======================== ===== ========================================= |
| 64 | /// eStopReasonNone 0 |
| 65 | /// eStopReasonTrace 0 |
| 66 | /// eStopReasonBreakpoint N duple: {breakpoint id, location id} |
| 67 | /// eStopReasonWatchpoint 1 watchpoint id |
| 68 | /// eStopReasonSignal 1 unix signal number |
| 69 | /// eStopReasonException N exception data |
| 70 | /// eStopReasonExec 0 |
| 71 | /// eStopReasonPlanComplete 0 |
| 72 | //-------------------------------------------------------------------------- |
| 73 | uint64_t |
| 74 | GetStopReasonDataAtIndex(uint32_t idx); |
| 75 | |
| 76 | SBThread |
| 77 | GetThread () const; |
| 78 | |
| 79 | bool |
| 80 | GetDescription (lldb::SBStream &description) const; |
| 81 | |
| 82 | void |
| 83 | SetPlanComplete (bool success); |
| 84 | |
| 85 | bool |
| 86 | IsPlanComplete(); |
| 87 | |
| 88 | bool |
| 89 | IsValid(); |
| 90 | |
| 91 | // This section allows an SBThreadPlan to push another of the common types of plans... |
| 92 | SBThreadPlan |
| 93 | QueueThreadPlanForStepOverRange (SBAddress &start_address, |
| 94 | lldb::addr_t range_size); |
| 95 | |
| 96 | SBThreadPlan |
| 97 | QueueThreadPlanForStepInRange (SBAddress &start_address, |
| 98 | lldb::addr_t range_size); |
| 99 | |
| 100 | SBThreadPlan |
| 101 | QueueThreadPlanForStepOut (uint32_t frame_idx_to_step_to, bool first_insn = false); |
| 102 | |
| 103 | SBThreadPlan |
| 104 | QueueThreadPlanForRunToAddress (SBAddress address); |
| 105 | |
| 106 | |
| 107 | protected: |
| 108 | friend class SBBreakpoint; |
| 109 | friend class SBBreakpointLocation; |
| 110 | friend class SBFrame; |
| 111 | friend class SBProcess; |
| 112 | friend class SBDebugger; |
| 113 | friend class SBValue; |
| 114 | friend class lldb_private::QueueImpl; |
| 115 | friend class SBQueueItem; |
| 116 | |
| 117 | private: |
| 118 | lldb::ThreadPlanSP m_opaque_sp; |
| 119 | }; |
| 120 | |
| 121 | } // namespace lldb |
| 122 | |
| 123 | #endif // LLDB_SBThreadPlan_h_ |