[Lldb-commits] [lldb] df94877 - [lldb] [test] Implement getting thread ID on FreeBSD

Michał Górny via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 10 01:27:27 PDT 2022


Author: Michał Górny
Date: 2022-06-10T10:26:58+02:00
New Revision: df948771124953df9e69e44e3bc70ea7948e51f1

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

LOG: [lldb] [test] Implement getting thread ID on FreeBSD

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D126982

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 3cfa16b847614..053ba86dc9062 100644
--- a/lldb/packages/Python/lldbsuite/test/make/thread.h
+++ b/lldb/packages/Python/lldbsuite/test/make/thread.h
@@ -9,6 +9,8 @@ int pthread_threadid_np(pthread_t, __uint64_t *);
 #elif defined(__linux__)
 #include <sys/syscall.h>
 #include <unistd.h>
+#elif defined(__FreeBSD__)
+#include <pthread_np.h>
 #elif defined(__NetBSD__)
 #include <lwp.h>
 #elif defined(_WIN32)
@@ -22,6 +24,8 @@ inline uint64_t get_thread_id() {
   return tid;
 #elif defined(__linux__)
   return syscall(__NR_gettid);
+#elif defined(__FreeBSD__)
+  return static_cast<uint64_t>(pthread_getthreadid_np());
 #elif defined(__NetBSD__)
   // Technically lwpid_t is 32-bit signed integer
   return static_cast<uint64_t>(_lwp_self());


        


More information about the lldb-commits mailing list