diff options
-rw-r--r-- | lldb/include/lldb/Host/macosx/HostInfoMacOSX.h | 1 | ||||
-rw-r--r-- | lldb/source/Host/macosx/HostInfoMacOSX.mm | 6 | ||||
-rw-r--r-- | lldb/source/Host/macosx/ThisThread.cpp | 18 |
3 files changed, 11 insertions, 14 deletions
diff --git a/lldb/include/lldb/Host/macosx/HostInfoMacOSX.h b/lldb/include/lldb/Host/macosx/HostInfoMacOSX.h index 3b62c7fb906..4a8ee4fd850 100644 --- a/lldb/include/lldb/Host/macosx/HostInfoMacOSX.h +++ b/lldb/include/lldb/Host/macosx/HostInfoMacOSX.h @@ -32,6 +32,7 @@ class HostInfoMacOSX : public HostInfoPosix static bool GetOSBuildString(std::string &s); static bool GetOSKernelDescription(std::string &s); static FileSpec GetProgramFileSpec(); + static uint32_t GetMaxThreadNameLength(); protected: static bool ComputeSupportExeDirectory(FileSpec &file_spec); diff --git a/lldb/source/Host/macosx/HostInfoMacOSX.mm b/lldb/source/Host/macosx/HostInfoMacOSX.mm index f5a0540e877..8b664f0a44b 100644 --- a/lldb/source/Host/macosx/HostInfoMacOSX.mm +++ b/lldb/source/Host/macosx/HostInfoMacOSX.mm @@ -370,3 +370,9 @@ HostInfoMacOSX::ComputeHostArchitectureSupport(ArchSpec &arch_32, ArchSpec &arch } } } + +uint32_t +HostInfoMacOSX::GetMaxThreadNameLength() +{ + return 64; +} diff --git a/lldb/source/Host/macosx/ThisThread.cpp b/lldb/source/Host/macosx/ThisThread.cpp index 95c7f2bf1e3..6f1c88f6730 100644 --- a/lldb/source/Host/macosx/ThisThread.cpp +++ b/lldb/source/Host/macosx/ThisThread.cpp @@ -10,30 +10,20 @@ #include "lldb/Host/ThisThread.h" #include <pthread.h> +#include "llvm/ADT/SmallVector.h" using namespace lldb_private; void ThisThread::SetName(llvm::StringRef name) { -#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 - ::pthread_setname_np(name); +#if defined (__APPLE__) + ::pthread_setname_np(name.str().c_str()); #endif } void ThisThread::GetName(llvm::SmallVectorImpl<char> &name) { -#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 - char pthread_name[1024]; - dispatch_queue_t current_queue = ::dispatch_get_current_queue(); - if (current_queue != NULL) - { - const char *queue_name = dispatch_queue_get_label(current_queue); - if (queue_name && queue_name[0]) - { - name = queue_name; - } - } -#endif + // FIXME - implement this. } |