[Lldb-commits] [lldb] 5b13f48 - [lldb][windows] Fix HostThreadWindows::Cancel inverted error reporting (#199013)

via lldb-commits lldb-commits at lists.llvm.org
Thu May 21 06:11:32 PDT 2026


Author: Charles Zablit
Date: 2026-05-21T14:11:27+01:00
New Revision: 5b13f482c1d89fbf6449d75add61bfd6b4fd0f55

URL: https://github.com/llvm/llvm-project/commit/5b13f482c1d89fbf6449d75add61bfd6b4fd0f55
DIFF: https://github.com/llvm/llvm-project/commit/5b13f482c1d89fbf6449d75add61bfd6b4fd0f55.diff

LOG: [lldb][windows] Fix HostThreadWindows::Cancel inverted error reporting (#199013)

Added: 
    

Modified: 
    lldb/source/Host/windows/HostThreadWindows.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Host/windows/HostThreadWindows.cpp b/lldb/source/Host/windows/HostThreadWindows.cpp
index 4a8843ffdd783..26f47823b86c2 100644
--- a/lldb/source/Host/windows/HostThreadWindows.cpp
+++ b/lldb/source/Host/windows/HostThreadWindows.cpp
@@ -49,11 +49,9 @@ Status HostThreadWindows::Join(lldb::thread_result_t *result) {
 }
 
 Status HostThreadWindows::Cancel() {
-  Status error;
-
-  DWORD result = ::QueueUserAPC(::ExitThreadProxy, m_thread, 0);
-  error = Status(result, eErrorTypeWin32);
-  return error;
+  if (!::QueueUserAPC(&ExitThreadProxy, m_thread, 0))
+    return Status(::GetLastError(), eErrorTypeWin32);
+  return Status();
 }
 
 lldb::tid_t HostThreadWindows::GetThreadId() const {


        


More information about the lldb-commits mailing list