From 3887ba8d3831c7ff097fd49f109b0dc24a0b289f Mon Sep 17 00:00:00 2001 From: Adrian McCarthy Date: Tue, 19 Sep 2017 18:07:33 +0000 Subject: Re-land r313210 - Fix for bug 34532 - A few rough corners related to post-mortem debugging (core/minidump) The main change is to avoid setting the process state as running when debugging core/minidumps (details in the bug). Also included a few small, related fixes around how the errors propagate in this case. Fixed the FreeBSD/Windows break: the intention was to keep Process::WillResume() and Process::DoResume() "in-sync", but this had the unfortunate consequence of breaking Process sub-classes which don't override WillResume(). The safer approach is to keep Process::WillResume() untouched and only override it in the minidump and core implementations. patch by lemo Bug: https://bugs.llvm.org/show_bug.cgi?id=34532 Differential Revision: https://reviews.llvm.org/D37651 llvm-svn: 313655 --- lldb/source/Commands/CommandObjectThread.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lldb/source/Commands/CommandObjectThread.cpp') diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index 6a933df43e1..b68aa920b58 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -94,7 +94,7 @@ public: 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 @@ protected: 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 -- cgit v1.2.3