diff options
author | Greg Clayton <gclayton@apple.com> | 2012-07-30 22:05:39 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-07-30 22:05:39 +0000 |
commit | 9b5450f6c91e6a7c837238ff791dbcc88d5432da (patch) | |
tree | c5ffbd412e103ed6bbcf78d1713b83253c2a5cba /lldb/source/Target/ExecutionContext.cpp | |
parent | 711ceba5abae8b2adfced417b31c9ce018ca66c1 (diff) | |
download | bcm5719-llvm-9b5450f6c91e6a7c837238ff791dbcc88d5432da.tar.gz bcm5719-llvm-9b5450f6c91e6a7c837238ff791dbcc88d5432da.zip |
Don't set the thread when adopting selected execution context entries, and use the "lldb_private::StateIsStoppedState(StateType, bool)" function to tell if the state is stopped.
llvm-svn: 161000
Diffstat (limited to 'lldb/source/Target/ExecutionContext.cpp')
-rw-r--r-- | lldb/source/Target/ExecutionContext.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/lldb/source/Target/ExecutionContext.cpp b/lldb/source/Target/ExecutionContext.cpp index 2c0a14680b1..300e8792217 100644 --- a/lldb/source/Target/ExecutionContext.cpp +++ b/lldb/source/Target/ExecutionContext.cpp @@ -8,6 +8,8 @@ //===----------------------------------------------------------------------===// #include "lldb/Target/ExecutionContext.h" + +#include "lldb/Core/State.h" #include "lldb/Target/ExecutionContextScope.h" #include "lldb/Target/StackFrame.h" #include "lldb/Target/Process.h" @@ -639,18 +641,22 @@ ExecutionContextRef::SetTargetPtr (Target* target, bool adopt_selected) m_process_wp = process_sp; if (process_sp) { - lldb::ThreadSP thread_sp (process_sp->GetThreadList().GetSelectedThread()); - if (!thread_sp) - thread_sp = process_sp->GetThreadList().GetThreadAtIndex(0); - - if (thread_sp && process_sp->GetState() == lldb::eStateStopped) + // Only fill in the thread and frame if our process is stopped + if (StateIsStoppedState (process_sp->GetState(), true)) { - SetThreadSP (thread_sp); - lldb::StackFrameSP frame_sp (thread_sp->GetSelectedFrame()); - if (!frame_sp) - frame_sp = thread_sp->GetStackFrameAtIndex(0); - if (frame_sp) - SetFrameSP (frame_sp); + lldb::ThreadSP thread_sp (process_sp->GetThreadList().GetSelectedThread()); + if (!thread_sp) + thread_sp = process_sp->GetThreadList().GetThreadAtIndex(0); + + if (thread_sp) + { + SetThreadSP (thread_sp); + lldb::StackFrameSP frame_sp (thread_sp->GetSelectedFrame()); + if (!frame_sp) + frame_sp = thread_sp->GetStackFrameAtIndex(0); + if (frame_sp) + SetFrameSP (frame_sp); + } } } } |