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

Brad Smith via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 2 18:17:23 PDT 2023


https://github.com/brad0 created https://github.com/llvm/llvm-project/pull/71129

None

>From 7b39da3783ad02ccf59283b8a180ec5c04cb5fd6 Mon Sep 17 00:00:00 2001
From: Brad Smith <brad at comstyle.com>
Date: Thu, 2 Nov 2023 21:15:15 -0400
Subject: [PATCH] [lldb][test] Implement getting thread ID on OpenBSD

---
 lldb/packages/Python/lldbsuite/test/make/thread.h | 4 ++++
 1 file changed, 4 insertions(+)

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