diff options
author | Kamil Rytarowski <n54@gmx.com> | 2017-02-27 17:52:48 +0000 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2017-02-27 17:52:48 +0000 |
commit | 47e7d7fe8562d2f509f26199b15e4ffc6f5de95e (patch) | |
tree | 4a8598f1a1665bbbdb355ff1584c250a6b4418e2 /lldb/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp | |
parent | 5309887746d7cab69da87f128671cc4809685c47 (diff) | |
download | bcm5719-llvm-47e7d7fe8562d2f509f26199b15e4ffc6f5de95e.tar.gz bcm5719-llvm-47e7d7fe8562d2f509f26199b15e4ffc6f5de95e.zip |
Support NetBSD Thread ID in lldb-server tests
Summary:
Native Thread ID is retrieved with _lwp_self() on NetBSD.
The returned value is of type int32_t, but for consistency with other Operating Systems cast it to uint64_t.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, labath, clayborg, emaste
Reviewed By: labath, clayborg
Subscribers: #lldb
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D30374
llvm-svn: 296360
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp index b524c044bcb..a574b41abf6 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp @@ -27,6 +27,8 @@ __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2) int pthread_threadid_np(pthread_t, __uint64_t *); #elif defined(__linux__) #include <sys/syscall.h> +#elif defined(__NetBSD__) +#include <lwp.h> #endif static const char *const RETVAL_PREFIX = "retval:"; @@ -71,6 +73,9 @@ static void print_thread_id() { #elif defined(__linux__) // This is a call to gettid() via syscall. printf("%" PRIx64, static_cast<uint64_t>(syscall(__NR_gettid))); +#elif defined(__NetBSD__) + // Technically lwpid_t is 32-bit signed integer + printf("%" PRIx64, static_cast<uint64_t>(_lwp_self())); #else printf("{no-tid-support}"); #endif |