[Lldb-commits] [lldb] 9ba5b52 - [lldb][test] Implement getting thread ID on OpenBSD (#71129)

via lldb-commits lldb-commits at lists.llvm.org
Sun Nov 12 11:38:13 PST 2023


Author: Brad Smith
Date: 2023-11-12T14:38:09-05:00
New Revision: 9ba5b52c135c2fd2e6dd5f5e228d0742aa0cf3e4

URL: https://github.com/llvm/llvm-project/commit/9ba5b52c135c2fd2e6dd5f5e228d0742aa0cf3e4
DIFF: https://github.com/llvm/llvm-project/commit/9ba5b52c135c2fd2e6dd5f5e228d0742aa0cf3e4.diff

LOG: [lldb][test] Implement getting thread ID on OpenBSD (#71129)

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/make/thread.h

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/make/thread.h b/lldb/packages/Python/lldbsuite/test/make/thread.h
index 053ba86dc9062a1..ba1f381c7e40a14 100644
--- a/lldb/packages/Python/lldbsuite/test/make/thread.h
+++ b/lldb/packages/Python/lldbsuite/test/make/thread.h
@@ -13,6 +13,8 @@ int pthread_threadid_np(pthread_t, __uint64_t *);
 #include <pthread_np.h>
 #elif defined(__NetBSD__)
 #include <lwp.h>
+#elif defined(__OpenBSD__)
+#include <unistd.h>
 #elif defined(_WIN32)
 #include <windows.h>
 #endif
@@ -29,6 +31,8 @@ inline uint64_t get_thread_id() {
 #elif defined(__NetBSD__)
   // Technically lwpid_t is 32-bit signed integer
   return static_cast<uint64_t>(_lwp_self());
+#elif defined(__OpenBSD__)
+  return static_cast<uint64_t>(getthrid());
 #elif defined(_WIN32)
   return static_cast<uint64_t>(::GetCurrentThreadId());
 #else


        


More information about the lldb-commits mailing list