From 94994d372d014ce4c8758b9605d63fae651bd8aa Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 19 Jan 2019 10:06:29 +0000 Subject: Vendor import of lldb trunk r351319 (just before the release_80 branch point): https://llvm.org/svn/llvm-project/lldb/trunk@351319 --- source/Plugins/Process/Windows/Common/DebuggerThread.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source/Plugins/Process/Windows/Common/DebuggerThread.cpp') diff --git a/source/Plugins/Process/Windows/Common/DebuggerThread.cpp b/source/Plugins/Process/Windows/Common/DebuggerThread.cpp index ad43551a4c6db..81ec25871c577 100644 --- a/source/Plugins/Process/Windows/Common/DebuggerThread.cpp +++ b/source/Plugins/Process/Windows/Common/DebuggerThread.cpp @@ -12,7 +12,6 @@ #include "IDebugDelegate.h" #include "lldb/Core/ModuleSpec.h" -#include "lldb/Host/Predicate.h" #include "lldb/Host/ThreadLauncher.h" #include "lldb/Host/windows/HostProcessWindows.h" #include "lldb/Host/windows/HostThreadWindows.h" @@ -21,6 +20,7 @@ #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/Predicate.h" #include "lldb/Utility/Status.h" #include "Plugins/Process/Windows/Common/ProcessWindowsLog.h" @@ -50,7 +50,7 @@ struct DebugAttachContext { lldb::pid_t m_pid; ProcessAttachInfo m_attach_info; }; -} +} // namespace DebuggerThread::DebuggerThread(DebugDelegateSP debug_delegate) : m_debug_delegate(debug_delegate), m_pid_to_detach(0), @@ -191,7 +191,8 @@ Status DebuggerThread::StopDebugging(bool terminate) { handle, pid, terminate_suceeded); } else { LLDB_LOG(log, - "NOT calling TerminateProcess because the inferior is not valid ({0}, 0) (inferior={1})", + "NOT calling TerminateProcess because the inferior is not valid " + "({0}, 0) (inferior={1})", handle, pid); } } @@ -267,6 +268,8 @@ void DebuggerThread::DebugLoop() { if (wait_result) { DWORD continue_status = DBG_CONTINUE; switch (dbe.dwDebugEventCode) { + default: + llvm_unreachable("Unhandle debug event code!"); case EXCEPTION_DEBUG_EVENT: { ExceptionResult status = HandleExceptionEvent(dbe.u.Exception, dbe.dwThreadId); @@ -330,7 +333,7 @@ void DebuggerThread::DebugLoop() { FreeProcessHandles(); LLDB_LOG(log, "WaitForDebugEvent loop completed, exiting."); - SetEvent(m_debugging_ended_event); + ::SetEvent(m_debugging_ended_event); } ExceptionResult @@ -381,7 +384,7 @@ DebuggerThread::HandleCreateThreadEvent(const CREATE_THREAD_DEBUG_INFO &info, DWORD thread_id) { Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_EVENT | WINDOWS_LOG_THREAD); - LLDB_LOG(log, "Thread {0:x} spawned in process {1}", thread_id, + LLDB_LOG(log, "Thread {0} spawned in process {1}", thread_id, m_process.GetProcessId()); HostThread thread(info.hThread); thread.GetNativeThread().SetOwnsHandle(false); @@ -439,7 +442,6 @@ DebuggerThread::HandleExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO &info, m_debug_delegate->OnExitProcess(info.dwExitCode); - FreeProcessHandles(); return DBG_CONTINUE; } @@ -468,7 +470,7 @@ DebuggerThread::HandleLoadDllEvent(const LOAD_DLL_DEBUG_INFO &info, if (path_str.startswith("\\\\?\\")) path += 4; - FileSpec file_spec(path, false); + FileSpec file_spec(path); ModuleSpec module_spec(file_spec); lldb::addr_t load_addr = reinterpret_cast(info.lpBaseOfDll); -- cgit v1.2.3