tatyana-krasnukha created this revision. tatyana-krasnukha added a reviewer: asmith. tatyana-krasnukha added a project: LLDB. Herald added subscribers: lldb-commits, JDevlieghere. tatyana-krasnukha requested review of this revision.
Don't report an error, just log this happened. This fixes a lot of "CLEANUP ERROR"s for the test-suite on Windows and makes ProcessWindows consistent with the other processes. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D84957 Files: lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp Index: lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp =================================================================== --- lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp +++ lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp @@ -227,22 +227,21 @@ debugger_thread = m_session_data->m_debugger; } - Status error; - if (state != eStateExited && state != eStateDetached) { - LLDB_LOG( - log, "Shutting down process {0}.", - debugger_thread->GetProcess().GetNativeProcess().GetSystemHandle()); - error = debugger_thread->StopDebugging(true); - - // By the time StopDebugging returns, there is no more debugger thread, so - // we can be assured that no other thread will race for the session data. - m_session_data.reset(); - } else { - error.SetErrorStringWithFormat("cannot destroy process %" PRIx64 - " while state = %d", - GetDebuggedProcessId(), state); - LLDB_LOG(log, "error: {0}", error); + if (state == eStateExited || state == eStateDetached) { + LLDB_LOG(log, "warning: cannot destroy process {0} while state = {1}", + GetDebuggedProcessId(), state); + return Status(); } + + LLDB_LOG( + log, "Shutting down process {0}.", + debugger_thread->GetProcess().GetNativeProcess().GetSystemHandle()); + auto error = debugger_thread->StopDebugging(true); + + // By the time StopDebugging returns, there is no more debugger thread, so + // we can be assured that no other thread will race for the session data. + m_session_data.reset(); + return error; }
Index: lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp =================================================================== --- lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp +++ lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp @@ -227,22 +227,21 @@ debugger_thread = m_session_data->m_debugger; } - Status error; - if (state != eStateExited && state != eStateDetached) { - LLDB_LOG( - log, "Shutting down process {0}.", - debugger_thread->GetProcess().GetNativeProcess().GetSystemHandle()); - error = debugger_thread->StopDebugging(true); - - // By the time StopDebugging returns, there is no more debugger thread, so - // we can be assured that no other thread will race for the session data. - m_session_data.reset(); - } else { - error.SetErrorStringWithFormat("cannot destroy process %" PRIx64 - " while state = %d", - GetDebuggedProcessId(), state); - LLDB_LOG(log, "error: {0}", error); + if (state == eStateExited || state == eStateDetached) { + LLDB_LOG(log, "warning: cannot destroy process {0} while state = {1}", + GetDebuggedProcessId(), state); + return Status(); } + + LLDB_LOG( + log, "Shutting down process {0}.", + debugger_thread->GetProcess().GetNativeProcess().GetSystemHandle()); + auto error = debugger_thread->StopDebugging(true); + + // By the time StopDebugging returns, there is no more debugger thread, so + // we can be assured that no other thread will race for the session data. + m_session_data.reset(); + return error; }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits