[Lldb-commits] [lldb] [lldb] Removed gdbserver ports map from lldb-server (PR #104238)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Sep 23 05:31:19 PDT 2024
================
@@ -195,18 +195,31 @@ void ConnectToRemote(MainLoop &mainloop,
bool reverse_connect, llvm::StringRef host_and_port,
const char *const progname, const char *const subcommand,
const char *const named_pipe_path, pipe_t unnamed_pipe,
- int connection_fd) {
+ shared_fd_t connection_fd) {
Status error;
std::unique_ptr<Connection> connection_up;
std::string url;
- if (connection_fd != -1) {
+ if (connection_fd != SharedSocket::kInvalidFD) {
+#ifdef _WIN32
+ NativeSocket sockfd;
+ error = SharedSocket::GetNativeSocket(connection_fd, sockfd);
+ if (error.Fail()) {
+ llvm::errs() << llvm::formatv("error: GetNativeSocket failed: {0}\n",
+ error.AsCString());
+ exit(-1);
+ }
+ connection_up =
+ std::unique_ptr<Connection>(new ConnectionFileDescriptor(new TCPSocket(
+ sockfd, /*should_close=*/true, /*child_processes_inherit=*/false)));
+#else
url = llvm::formatv("fd://{0}", connection_fd).str();
// Create the connection.
-#if LLDB_ENABLE_POSIX && !defined _WIN32
+#if LLDB_ENABLE_POSIX
----------------
labath wrote:
I'm not saying we should add `_WIN32`. I'm saying we should *remove* the POSIX check, as `_WIN32 == !POSIX` (right now, and for the foreseeable future).
https://github.com/llvm/llvm-project/pull/104238
More information about the lldb-commits
mailing list