[Lldb-commits] [lldb] [lldb][lldb-server][Darwin] Error when gdbserver mode is requested (PR #199654)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Tue May 26 03:50:54 PDT 2026
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/199654
Fixes #199035
lldb-server's platform mode works on Apple platforms but the gdbserver mode does not. Users should use debugserver instead, and platform mode knows to spawn debugserver instead of lldb-server.
I'm adding an error to state this, because until now it would maybe appear to work, or crash in strange ways. None of which can be fixed by a user and are a waste of our time dealing with the bug reports.
>From 87b7cc7f48089d97da2940600d80d8fb5732819f Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at arm.com>
Date: Tue, 26 May 2026 10:43:07 +0000
Subject: [PATCH] [lldb][lldb-server][Darwin] Error when gdbserver mode is
requested
Fixes #199035
lldb-server's platform mode works on Apple platforms but the gdbserver
mode does not. Users should use debugserver instead, and platform
mode knows to spawn debugserver instead of lldb-server.
I'm adding an error to state this, because until now it would maybe
appear to work, or crash in strange ways. None of which can be fixed
by a user and are a waste of our time dealing with the bug reports.
---
lldb/tools/lldb-server/lldb-server.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lldb/tools/lldb-server/lldb-server.cpp b/lldb/tools/lldb-server/lldb-server.cpp
index 62255c708eac0..747f44f16ce29 100644
--- a/lldb/tools/lldb-server/lldb-server.cpp
+++ b/lldb/tools/lldb-server/lldb-server.cpp
@@ -61,9 +61,15 @@ int main(int argc, char *argv[]) {
switch (argv[1][0]) {
case 'g': {
+#if defined(__APPLE__)
+ fprintf(stderr, "gdbserver mode is not supported on Apple platforms. "
+ "Use debugserver instead.");
+ return EXIT_FAILURE;
+#else
llgs::Initialize();
auto terminate = llvm::scope_exit([]() { llgs::Terminate(); });
return main_gdbserver(argc, argv);
+#endif
}
case 'p': {
llgs::Initialize();
More information about the lldb-commits
mailing list