[Lldb-commits] [lldb] [lldb] print errors when the debug server is not found (PR #165157)

Odric Roux-Paris via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 27 12:53:29 PDT 2025


https://github.com/MrCirdo updated https://github.com/llvm/llvm-project/pull/165157

>From 704d83dad0a4469e883b6434249994050be4b805 Mon Sep 17 00:00:00 2001
From: Odric Roux-Paris <odric at roux-paris.fr>
Date: Sat, 25 Oct 2025 23:36:39 +0200
Subject: [PATCH] [lldb] print errors when the debug server is not found

Previously, when the debug server binary could not be located, LLDB
emitted a vague error:
`error: executable doesn't exist: '(empty)'`

This patch adds a check just right after the debug server path
resolution and produces a clearer message if it's is not found:
`error: could not find 'lldb-server'. Please ensure it is properly
installed and available in your PATH`.
---
 lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index b4422a7d58077..3c4d9a1f1ad37 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -3672,6 +3672,12 @@ Status ProcessGDBRemote::LaunchAndConnectToDebugserver(
     }
   }
 #endif
+
+  if (!FileSystem::Instance().Exists(debugserver_path))
+    return Status::FromErrorString("could not find '" DEBUGSERVER_BASENAME
+                                   "'. Please ensure it is properly installed "
+                                   "and available in your PATH");
+
   debugserver_launch_info.SetExecutableFile(debugserver_path,
                                             /*add_exe_file_as_first_arg=*/true);
 



More information about the lldb-commits mailing list