Fix FreeBSD build after thread changes
More work on the GetName/SetName arguments (thread_t vs tid_t) is needed
but this change should restore the build and basic operation.
llvm-svn: 217502
diff --git a/lldb/source/Host/freebsd/HostThreadFreeBSD.cpp b/lldb/source/Host/freebsd/HostThreadFreeBSD.cpp
index f195487..4f3fd31 100644
--- a/lldb/source/Host/freebsd/HostThreadFreeBSD.cpp
+++ b/lldb/source/Host/freebsd/HostThreadFreeBSD.cpp
@@ -40,7 +40,7 @@
}
void
-HostThreadFreeBSD::GetName(lldb::thread_t thread, llvm::SmallVectorImpl<char> &name)
+HostThreadFreeBSD::GetName(lldb::tid_t tid, llvm::SmallVectorImpl<char> &name)
{
name.clear();
int pid = Host::GetCurrentProcessID();
@@ -73,9 +73,9 @@
for (size_t i = 0; i < len / sizeof(*kp); i++)
{
- if (kp[i].ki_tid == (int)thread)
+ if (kp[i].ki_tid == (lwpid_t)tid)
{
- name.append(kp[i].ki_tdname, strlen(kp[i].ki_tdname));
+ name.append(kp[i].ki_tdname, kp[i].ki_tdname + strlen(kp[i].ki_tdname));
break;
}
}
diff --git a/lldb/source/Host/freebsd/ThisThread.cpp b/lldb/source/Host/freebsd/ThisThread.cpp
index 1c68c8b..a9f8058 100644
--- a/lldb/source/Host/freebsd/ThisThread.cpp
+++ b/lldb/source/Host/freebsd/ThisThread.cpp
@@ -13,6 +13,7 @@
#include "llvm/ADT/SmallVector.h"
#include <pthread.h>
+#include <pthread_np.h>
using namespace lldb_private;
@@ -25,5 +26,5 @@
void
ThisThread::GetName(llvm::SmallVectorImpl<char> &name)
{
- HostNativeThread::GetName(::pthread_self(), name);
+ HostNativeThread::GetName(::pthread_getthreadid_np(), name);
}