forked from OSchip/llvm-project
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
This commit is contained in:
parent
b87899b567
commit
3967764b98
|
@ -25,7 +25,7 @@ class HostThreadFreeBSD : public HostThreadPosix
|
|||
HostThreadFreeBSD(lldb::thread_t thread);
|
||||
|
||||
static void SetName(lldb::thread_t thread, llvm::StringRef name);
|
||||
static void GetName(lldb::thread_t thread, llvm::SmallVectorImpl<char> &name);
|
||||
static void GetName(lldb::tid_t tid, llvm::SmallVectorImpl<char> &name);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ HostThreadFreeBSD::SetName(lldb::thread_t thread, llvm::StringRef name)
|
|||
}
|
||||
|
||||
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 @@ HostThreadFreeBSD::GetName(lldb::thread_t thread, llvm::SmallVectorImpl<char> &n
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "llvm/ADT/SmallVector.h"
|
||||
|
||||
#include <pthread.h>
|
||||
#include <pthread_np.h>
|
||||
|
||||
using namespace lldb_private;
|
||||
|
||||
|
@ -25,5 +26,5 @@ ThisThread::SetName(llvm::StringRef name)
|
|||
void
|
||||
ThisThread::GetName(llvm::SmallVectorImpl<char> &name)
|
||||
{
|
||||
HostNativeThread::GetName(::pthread_self(), name);
|
||||
HostNativeThread::GetName(::pthread_getthreadid_np(), name);
|
||||
}
|
||||
|
|
|
@ -213,8 +213,8 @@ public:
|
|||
private:
|
||||
ProcessFreeBSD *m_process;
|
||||
|
||||
HostThread m_operation_thread;
|
||||
HostThread m_monitor_thread;
|
||||
lldb_private::HostThread m_operation_thread;
|
||||
lldb_private::HostThread m_monitor_thread;
|
||||
lldb::pid_t m_pid;
|
||||
|
||||
int m_terminal_fd;
|
||||
|
|
Loading…
Reference in New Issue