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

via lldb-commits lldb-commits at lists.llvm.org
Sun Oct 26 08:43:55 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Odric Roux-Paris (MrCirdo)

<details>
<summary>Changes</summary>

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`.

---
Full diff: https://github.com/llvm/llvm-project/pull/165157.diff


1 Files Affected:

- (modified) lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (+6) 


``````````diff
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index b4422a7d58077..324864a732882 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -3656,6 +3656,12 @@ Status ProcessGDBRemote::LaunchAndConnectToDebugserver(
 
   FileSpec debugserver_path = GetDebugserverPath(*GetTarget().GetPlatform());
 
+  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.");
+  }
+
 #if defined(__APPLE__)
   // On macOS 11, we need to support x86_64 applications translated to
   // arm64. We check whether a binary is translated and spawn the correct

``````````

</details>


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


More information about the lldb-commits mailing list