SBThread.h revision e49ec18f1868168c8927ae30a379db176ca8cce3
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_SBThread_h_
11#define LLDB_SBThread_h_
12
13#include "lldb/API/SBDefines.h"
14
15#include <stdio.h>
16
17namespace lldb {
18
19class SBFrame;
20
21class SBThread
22{
23public:
24    SBThread ();
25
26    SBThread (const lldb::SBThread &thread);
27
28   ~SBThread();
29
30    bool
31    IsValid() const;
32
33    void
34    Clear ();
35
36    lldb::StopReason
37    GetStopReason();
38
39    size_t
40    GetStopDescription (char *dst, size_t dst_len);
41
42    lldb::tid_t
43    GetThreadID () const;
44
45    uint32_t
46    GetIndexID () const;
47
48    const char *
49    GetName () const;
50
51    const char *
52    GetQueueName() const;
53
54    void
55    StepOver (lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
56
57    void
58    StepInto (lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
59
60    void
61    StepOut ();
62
63    void
64    StepInstruction(bool step_over);
65
66    void
67    RunToAddress (lldb::addr_t addr);
68
69    uint32_t
70    GetNumFrames ();
71
72    lldb::SBFrame
73    GetFrameAtIndex (uint32_t idx);
74
75    lldb::SBProcess
76    GetProcess ();
77
78#ifndef SWIG
79
80    const lldb::SBThread &
81    operator = (const lldb::SBThread &rhs);
82
83    bool
84    operator == (const lldb::SBThread &rhs) const;
85
86    bool
87    operator != (const lldb::SBThread &rhs) const;
88
89#endif
90
91    bool
92    GetDescription (lldb::SBStream &description);
93
94protected:
95    friend class SBBreakpoint;
96    friend class SBBreakpointLocation;
97    friend class SBFrame;
98    friend class SBProcess;
99    friend class SBDebugger;
100    friend class SBValue;
101
102    lldb_private::Thread *
103    GetLLDBObjectPtr ();
104
105#ifndef SWIG
106
107    const lldb_private::Thread *
108    operator->() const;
109
110    const lldb_private::Thread &
111    operator*() const;
112
113
114    lldb_private::Thread *
115    operator->();
116
117    lldb_private::Thread &
118    operator*();
119
120#endif
121
122    SBThread (const lldb::ThreadSP& lldb_object_sp);
123
124    void
125    SetThread (const lldb::ThreadSP& lldb_object_sp);
126
127private:
128    //------------------------------------------------------------------
129    // Classes that inherit from Thread can see and modify these
130    //------------------------------------------------------------------
131
132    lldb::ThreadSP m_opaque_sp;
133};
134
135} // namespace lldb
136
137#endif  // LLDB_SBThread_h_
138