[Lldb-commits] [lldb] [lldb][windows] refactor FileAction (PR #179274)

Dmitry Vasilyev via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 2 17:54:53 PST 2026


================
@@ -326,8 +326,12 @@ static Status spawn_process(const char *progname, const FileSpec &prog,
   self_args.AppendArgument(llvm::StringRef("platform"));
   self_args.AppendArgument(llvm::StringRef("--child-platform-fd"));
   self_args.AppendArgument(llvm::to_string(shared_socket.GetSendableFD()));
-  launch_info.AppendDuplicateFileAction((int64_t)shared_socket.GetSendableFD(),
-                                        (int64_t)shared_socket.GetSendableFD());
+#ifdef _WIN32
+  int fd = _open_osfhandle((intptr_t)shared_socket.GetSendableFD(), NULL);
----------------
slydiman wrote:

BTW, ProcessLauncherWindows::LaunchProcess() has no fork() and cannot execute any code in the child process. It just collecting HANDLEs and pass them to UpdateProcThreadAttribute(). The socket handle duplicating is executed in SharedSocket::CompleteSending().

https://github.com/llvm/llvm-project/pull/179274


More information about the lldb-commits mailing list