Skip to content

Conversation

@emrekultursay
Copy link
Contributor

@emrekultursay emrekultursay commented Apr 25, 2025

Windows doesn't have domain sockets, so we must properly #ifdef the code that touches DomainSocket. Fixes the windows build break introduced by Commit 488eeb3

Windows doesn't have domain sockets, so we must properly #ifdef
the code that touches DomainSocket.
@llvmbot
Copy link
Member

llvmbot commented Apr 25, 2025

@llvm/pr-subscribers-lldb

Author: Emre Kultursay (emrekultursay)

Changes

Windows doesn't have domain sockets, so we must properly #ifdef the code that touches DomainSocket.


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

1 Files Affected:

  • (modified) lldb/tools/lldb-server/lldb-platform.cpp (+6)
diff --git a/lldb/tools/lldb-server/lldb-platform.cpp b/lldb/tools/lldb-server/lldb-platform.cpp
index b9a85370d649c..10d79c63af994 100644
--- a/lldb/tools/lldb-server/lldb-platform.cpp
+++ b/lldb/tools/lldb-server/lldb-platform.cpp
@@ -469,6 +469,7 @@ int main_platform(int argc, char *argv[]) {
     if (gdbserver_port) {
       socket = std::make_unique<TCPSocket>(sockfd, /*should_close=*/true);
     } else {
+#if LLDB_ENABLE_POSIX
       llvm::Expected<std::unique_ptr<DomainSocket>> domain_socket =
           DomainSocket::FromBoundNativeSocket(sockfd, /*should_close=*/true);
       if (!domain_socket) {
@@ -477,6 +478,11 @@ int main_platform(int argc, char *argv[]) {
         return socket_error;
       }
       socket = std::move(domain_socket.get());
+#else
+      WithColor::error() << "lldb-platform child: Unix domain sockets are not "
+                            "supported on this platform.";
+      return socket_error;
+#endif
     }
 
     GDBRemoteCommunicationServerPlatform platform(socket->GetSocketProtocol(),

@JDevlieghere JDevlieghere merged commit 935bc84 into llvm:main Apr 25, 2025
9 of 11 checks passed
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
Windows doesn't have domain sockets, so we must properly #ifdef the code
that touches DomainSocket. Fixes the windows build break introduced by
Commit
llvm@488eeb3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants