[Lldb-commits] [lldb] r336991 - Add abbreviated name for Debugger::EventHandlerThread.

Tatyana Krasnukha via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 13 04:21:06 PDT 2018


Author: tkrasnukha
Date: Fri Jul 13 04:21:06 2018
New Revision: 336991

URL: http://llvm.org/viewvc/llvm-project?rev=336991&view=rev
Log:
Add abbreviated name for Debugger::EventHandlerThread.

On OS's where thread names are limited to 16 bytes, the full name was truncated to not very meaningful "r.event-handler".

Modified:
    lldb/trunk/source/Core/Debugger.cpp

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=336991&r1=336990&r2=336991&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Fri Jul 13 04:21:06 2018
@@ -1586,15 +1586,18 @@ bool Debugger::StartEventHandlerThread()
     // is up and running and listening to events before we return from this
     // function. We do this by listening to events for the
     // eBroadcastBitEventThreadIsListening from the m_sync_broadcaster
-    ListenerSP listener_sp(
-        Listener::MakeListener("lldb.debugger.event-handler"));
+    ConstString full_name("lldb.debugger.event-handler");
+    ListenerSP listener_sp(Listener::MakeListener(full_name.AsCString()));
     listener_sp->StartListeningForEvents(&m_sync_broadcaster,
                                          eBroadcastBitEventThreadIsListening);
 
+    auto thread_name =
+        full_name.GetLength() < llvm::get_max_thread_name_length() ?
+        full_name.AsCString() : "dbg.evt-handler";
+
     // Use larger 8MB stack for this thread
-    m_event_handler_thread = ThreadLauncher::LaunchThread(
-        "lldb.debugger.event-handler", EventHandlerThread, this, nullptr,
-        g_debugger_event_thread_stack_bytes);
+    m_event_handler_thread = ThreadLauncher::LaunchThread(thread_name,
+        EventHandlerThread, this, nullptr, g_debugger_event_thread_stack_bytes);
 
     // Make sure DefaultEventHandler() is running and listening to events
     // before we return from this function. We are only listening for events of




More information about the lldb-commits mailing list