[Lldb-commits] [PATCH] D126982: [lldb] [test] Implement getting thread ID on FreeBSD

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 3 11:20:58 PDT 2022

mgorny created this revision.
mgorny added reviewers: labath, krytarowski, emaste.
Herald added a subscriber: arichardson.
Herald added a project: All.
mgorny requested review of this revision.

Sponsored by: The FreeBSD Foundation



Index: lldb/packages/Python/lldbsuite/test/make/thread.h
--- lldb/packages/Python/lldbsuite/test/make/thread.h
+++ lldb/packages/Python/lldbsuite/test/make/thread.h
@@ -9,6 +9,8 @@
 #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 @@
   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());

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126982.434077.patch
Type: text/x-patch
Size: 745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220603/138da2e1/attachment.bin>

More information about the lldb-commits mailing list