[Lldb-commits] [lldb] r365390 - [Windows] Convert GetLastError to std::error_code
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Mon Jul 8 14:19:03 PDT 2019
Author: jdevlieghere
Date: Mon Jul 8 14:19:02 2019
New Revision: 365390
URL: http://llvm.org/viewvc/llvm-project?rev=365390&view=rev
Log:
[Windows] Convert GetLastError to std::error_code
Create a std::error_code from the result of GetLastError, which in turn
we can use to return an llvm::Error.
Modified:
lldb/trunk/source/Host/common/ThreadLauncher.cpp
Modified: lldb/trunk/source/Host/common/ThreadLauncher.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/ThreadLauncher.cpp?rev=365390&r1=365389&r2=365390&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/ThreadLauncher.cpp (original)
+++ lldb/trunk/source/Host/common/ThreadLauncher.cpp Mon Jul 8 14:19:02 2019
@@ -31,8 +31,10 @@ llvm::Expected<HostThread> ThreadLaunche
thread = (lldb::thread_t)::_beginthreadex(
0, (unsigned)min_stack_byte_size,
HostNativeThread::ThreadCreateTrampoline, info_ptr, 0, NULL);
- if (thread == (lldb::thread_t)(-1L))
- return llvm::errorCodeToError(::GetLastError());
+ if (thread == (lldb::thread_t)(-1L)) {
+ DWORD err = GetLastError();
+ return llvm::errorCodeToError(std::error_code(err, std::system_category()));
+ }
#else
// ASAN instrumentation adds a lot of bookkeeping overhead on stack frames.
More information about the lldb-commits
mailing list