[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
Sun Oct 26 08:42:50 PDT 2025
https://github.com/MrCirdo created https://github.com/llvm/llvm-project/pull/165157
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`.
>From 3e8f9f90030638cfea2544acc389ff58dc7e30cc 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..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
More information about the lldb-commits
mailing list