Don't have ExecutionContextRef::SetTargetPtr fill in the frame
information if we're not stopped. This could try to read registers
etc when the process is still running and debug builds of lldb would
assert down in GDBRemoteRegisterContext.cpp ReadRegisterBytes because
we couldn't get the sequence mutex for talking to the remote system.
Non-debug builds would just silently fail when doing this.
<rdar://problem/11941758>
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160829 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/ExecutionContext.cpp b/source/Target/ExecutionContext.cpp
index 9bddb61..2c0a146 100644
--- a/source/Target/ExecutionContext.cpp
+++ b/source/Target/ExecutionContext.cpp
@@ -643,7 +643,7 @@
if (!thread_sp)
thread_sp = process_sp->GetThreadList().GetThreadAtIndex(0);
- if (thread_sp)
+ if (thread_sp && process_sp->GetState() == lldb::eStateStopped)
{
SetThreadSP (thread_sp);
lldb::StackFrameSP frame_sp (thread_sp->GetSelectedFrame());