diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index bd60a7d98ff4..903f50887fec 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -2679,6 +2679,10 @@ void Target::RunStopHooks() { if (!m_process_sp) return; + + // Somebody might have restarted the process: + if (m_process_sp->GetState() != eStateStopped) + return; // make sure we check that we are not stopped // because of us running a user expression @@ -2784,9 +2788,12 @@ void Target::RunStopHooks() { // running the stop hooks. if ((result.GetStatus() == eReturnStatusSuccessContinuingNoResult) || (result.GetStatus() == eReturnStatusSuccessContinuingResult)) { - result.AppendMessageWithFormat("Aborting stop hooks, hook %" PRIu64 - " set the program running.", - cur_hook_sp->GetID()); + // But only complain if there were more stop hooks to do: + StopHookCollection::iterator tmp = pos; + if (++tmp != end) + result.AppendMessageWithFormat("\nAborting stop hooks, hook %" PRIu64 + " set the program running.\n", + cur_hook_sp->GetID()); keep_going = false; } }