[Lldb-commits] [lldb] [lldb-dap][NFC] Shorten the event thread name (PR #174837)
Ebuka Ezike via lldb-commits
lldb-commits at lists.llvm.org
Wed Jan 7 11:06:27 PST 2026
https://github.com/da-viper created https://github.com/llvm/llvm-project/pull/174837
On linux thread names are limited to 15 characters, shorten the name of the event thread if necessary
>From 99ce67f1da842cb47d4bad771748faff166da6b3 Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <yerimyah1 at gmail.com>
Date: Wed, 7 Jan 2026 18:57:25 +0000
Subject: [PATCH] [lldb-dap][NFC] Shorten the event thread name
on linux thread names are limited to 15 characters
shorten the name of the event thread if necessary
---
lldb/tools/lldb-dap/EventHelper.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lldb/tools/lldb-dap/EventHelper.cpp b/lldb/tools/lldb-dap/EventHelper.cpp
index 01d4547e2d228..97ea96045ea4e 100644
--- a/lldb/tools/lldb-dap/EventHelper.cpp
+++ b/lldb/tools/lldb-dap/EventHelper.cpp
@@ -589,7 +589,12 @@ static void HandleDiagnosticEvent(const lldb::SBEvent &event, Log &log) {
// is required.
void EventThread(lldb::SBDebugger debugger, lldb::SBBroadcaster broadcaster,
llvm::StringRef client_name, Log &log) {
- llvm::set_thread_name("lldb.DAP.client." + client_name + ".event_handler");
+ std::string thread_name =
+ llvm::formatv("lldb.DAP.client.{}.event_handler", client_name);
+ if (thread_name.length() > llvm::get_max_thread_name_length())
+ thread_name = llvm::formatv("DAP.{}.evnt", client_name);
+ llvm::set_thread_name(thread_name);
+
lldb::SBListener listener = debugger.GetListener();
broadcaster.AddListener(listener, eBroadcastBitStopEventThread);
debugger.GetBroadcaster().AddListener(
More information about the lldb-commits
mailing list