Index: source/Commands/CommandObjectThread.cpp =================================================================== --- source/Commands/CommandObjectThread.cpp +++ source/Commands/CommandObjectThread.cpp @@ -94,7 +94,7 @@ bool all_threads = false; if (command.GetArgumentCount() == 0) { Thread *thread = m_exe_ctx.GetThreadPtr(); - if (!HandleOneThread(thread->GetID(), result)) + if (!thread || !HandleOneThread(thread->GetID(), result)) return false; return result.Succeeded(); } else if (command.GetArgumentCount() == 1) { @@ -775,6 +775,12 @@ else error = process->Resume(); + if (!error.Success()) { + result.AppendMessage(error.AsCString()); + result.SetStatus(eReturnStatusFailed); + return false; + } + // There is a race condition where this thread will return up the call // stack to the main command handler // and show an (lldb) prompt before HandlePrivateEvent (from Index: source/Plugins/Process/elf-core/ProcessElfCore.h =================================================================== --- source/Plugins/Process/elf-core/ProcessElfCore.h +++ source/Plugins/Process/elf-core/ProcessElfCore.h @@ -89,6 +89,8 @@ //------------------------------------------------------------------ bool IsAlive() override; + bool WarnBeforeDetach() const override { return false; } + //------------------------------------------------------------------ // Process Memory //------------------------------------------------------------------ Index: source/Target/Process.cpp =================================================================== --- source/Target/Process.cpp +++ source/Target/Process.cpp @@ -1621,7 +1621,12 @@ log->Printf("Process::Resume: -- TrySetRunning failed, not resuming."); return error; } - return PrivateResume(); + Status error = PrivateResume(); + if (!error.Success()) { + // Undo running state change + m_public_run_lock.SetStopped(); + } + return error; } Status Process::ResumeSynchronous(Stream *stream) { @@ -1650,6 +1655,9 @@ error.SetErrorStringWithFormat( "process not in stopped state after synchronous resume: %s", StateAsCString(state)); + } else { + // Undo running state change + m_public_run_lock.SetStopped(); } // Undo the hijacking of process events...