From 12bd4897ff0678fa663e09d78ebc22dd255ceb86 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Mon, 9 Feb 2015 01:44:09 +0000 Subject: Import LLDB as of upstream SVN 228549 (git 39760838) --- source/Target/ExecutionContext.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/Target/ExecutionContext.cpp') diff --git a/source/Target/ExecutionContext.cpp b/source/Target/ExecutionContext.cpp index db4025f40c05..e03a560bd063 100644 --- a/source/Target/ExecutionContext.cpp +++ b/source/Target/ExecutionContext.cpp @@ -705,7 +705,11 @@ ExecutionContextRef::SetTargetPtr (Target* target, bool adopt_selected) if (process_sp) { // Only fill in the thread and frame if our process is stopped - if (StateIsStoppedState (process_sp->GetState(), true)) + // Don't just check the state, since we might be in the middle of + // resuming. + Process::StopLocker stop_locker; + + if (stop_locker.TryLock(&process_sp->GetRunLock()) && StateIsStoppedState (process_sp->GetState(), true)) { lldb::ThreadSP thread_sp (process_sp->GetThreadList().GetSelectedThread()); if (!thread_sp) -- cgit v1.3