diff options
| author | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-04-15 23:33:53 +0000 |
|---|---|---|
| committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-04-15 23:33:53 +0000 |
| commit | a75418dbd635f5ef9b2eccb9918118e1a905cd71 (patch) | |
| tree | be0df2c4242184c682073832540bc13583735275 /lldb | |
| parent | 2d37e5a5a5196d4349b84810a7e558e06612e8fe (diff) | |
| download | bcm5719-llvm-a75418dbd635f5ef9b2eccb9918118e1a905cd71.tar.gz bcm5719-llvm-a75418dbd635f5ef9b2eccb9918118e1a905cd71.zip | |
Adding new Python API function to check for stopped threads.
llvm-svn: 179577
Diffstat (limited to 'lldb')
| -rw-r--r-- | lldb/include/lldb/API/SBThread.h | 3 | ||||
| -rw-r--r-- | lldb/scripts/Python/interface/SBThread.i | 6 | ||||
| -rw-r--r-- | lldb/source/API/SBThread.cpp | 10 |
3 files changed, 19 insertions, 0 deletions
diff --git a/lldb/include/lldb/API/SBThread.h b/lldb/include/lldb/API/SBThread.h index 20f7e1ae842..74249191b6d 100644 --- a/lldb/include/lldb/API/SBThread.h +++ b/lldb/include/lldb/API/SBThread.h @@ -151,6 +151,9 @@ public: bool IsSuspended(); + bool + IsStopped(); + uint32_t GetNumFrames (); diff --git a/lldb/scripts/Python/interface/SBThread.i b/lldb/scripts/Python/interface/SBThread.i index e597c07d2db..2f34153304f 100644 --- a/lldb/scripts/Python/interface/SBThread.i +++ b/lldb/scripts/Python/interface/SBThread.i @@ -178,6 +178,9 @@ public: bool IsSuspended(); + bool + IsStopped(); + uint32_t GetNumFrames (); @@ -258,6 +261,9 @@ public: __swig_getmethods__["is_suspended"] = IsSuspended if _newclass: is_suspended = property(IsSuspended, None, doc='''A read only property that returns a boolean value that indicates if this thread is suspended.''') + + __swig_getmethods__["is_stopped"] = IsStopped + if _newclass: is_stopped = property(IsStopped, None, doc='''A read only property that returns a boolean value that indicates if this thread is stopped but not exited.''') %} }; diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index 5ea21012709..431adba10a2 100644 --- a/lldb/source/API/SBThread.cpp +++ b/lldb/source/API/SBThread.cpp @@ -16,6 +16,7 @@ #include "lldb/API/SBStream.h" #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Core/Debugger.h" +#include "lldb/Core/State.h" #include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Interpreter/CommandInterpreter.h" @@ -991,6 +992,15 @@ SBThread::IsSuspended() return false; } +bool +SBThread::IsStopped() +{ + ExecutionContext exe_ctx (m_opaque_sp.get()); + if (exe_ctx.HasThreadScope()) + return StateIsStoppedState(exe_ctx.GetThreadPtr()->GetState(), true); + return false; +} + SBProcess SBThread::GetProcess () { |

