[Lldb-commits] [lldb] r296972 - Truncate thread names if they're too long.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Sat Mar 4 08:42:26 PST 2017


Author: zturner
Date: Sat Mar  4 10:42:25 2017
New Revision: 296972

URL: http://llvm.org/viewvc/llvm-project?rev=296972&view=rev
Log:
Truncate thread names if they're too long.

Modified:
    lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=296972&r1=296971&r2=296972&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Sat Mar  4 10:42:25 2017
@@ -14,6 +14,8 @@
 
 // Other libraries and framework includes
 #include "llvm/Support/ScopedPrinter.h"
+#include "llvm/Support/Threading.h"
+
 // Project includes
 #include "Plugins/Process/Utility/InferiorCallPOSIX.h"
 #include "lldb/Breakpoint/BreakpointLocation.h"
@@ -3733,8 +3735,8 @@ bool Process::StartPrivateStateThread(bo
   // Create a thread that watches our internal state and controls which
   // events make it to clients (into the DCProcess event queue).
   char thread_name[1024];
-
-  if (HostInfo::GetMaxThreadNameLength() <= 30) {
+  uint32_t max_len = llvm::get_max_thread_name_length();
+  if (max_len > 0 && max_len <= 30) {
     // On platforms with abbreviated thread name lengths, choose thread names
     // that fit within the limit.
     if (already_running)




More information about the lldb-commits mailing list