================
@@ -666,7 +756,23 @@ ConnectionStatus
 ConnectionFileDescriptor::ConnectFD(llvm::StringRef s,
                                     socket_id_callback_type socket_id_callback,
                                     Status *error_ptr) {
-#if LLDB_ENABLE_POSIX
+#ifdef _WIN32
+  int64_t fd = -1;
+  if (!s.getAsInteger(0, fd)) {
+    // Assume we own fd.
+    std::unique_ptr<TCPSocket> tcp_socket =
+        std::make_unique<TCPSocket>((NativeSocket)fd, true, false);
+    m_io_sp = std::move(tcp_socket);
+    m_uri = s.str();
+    return eConnectionStatusSuccess;
+  }
----------------
slydiman wrote:

ConnectionFileDescriptorPosix.cpp is unchanged now.
I have moved the SharedSocket using to lldb-gdbserver.cpp.
I don't like the idea about SharedSocket::GetSocket() because of ambiguity 
Socket/TCPSocket/UDPSocket and additional parameters should_close, 
child_processes_inherit, etc. It may reduce using of NativeSocket, but will not 
reduce the code in general.

https://github.com/llvm/llvm-project/pull/104238
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to