[Lldb-commits] [lldb] r293625 - Add NetBSD support in Host::GetCurrentThreadID

Kamil Rytarowski via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 31 05:38:42 PST 2017


Author: kamil
Date: Tue Jan 31 07:38:42 2017
New Revision: 293625

URL: http://llvm.org/viewvc/llvm-project?rev=293625&view=rev
Log:
Add NetBSD support in Host::GetCurrentThreadID

Summary:
To retrieve the native thread ID there must be called _lwp_self().

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, clayborg, emaste, labath

Reviewed By: joerg, clayborg, labath

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29264

Modified:
    lldb/trunk/source/Host/common/Host.cpp

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=293625&r1=293624&r2=293625&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Tue Jan 31 07:38:42 2017
@@ -40,6 +40,10 @@
 #include <pthread_np.h>
 #endif
 
+#if defined(__NetBSD__)
+#include <lwp.h>
+#endif
+
 // C++ Includes
 
 // Other libraries and framework includes
@@ -320,6 +324,8 @@ lldb::tid_t Host::GetCurrentThreadID() {
   return thread_self;
 #elif defined(__FreeBSD__)
   return lldb::tid_t(pthread_getthreadid_np());
+#elif defined(__NetBSD__)
+  return lldb::tid_t(_lwp_self());
 #elif defined(__ANDROID__)
   return lldb::tid_t(gettid());
 #elif defined(__linux__)




More information about the lldb-commits mailing list