diff options
author | Pavel Labath <pavel@labath.sk> | 2025-05-07 15:02:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-07 15:02:45 +0200 |
commit | 7c5f5f3ef83b1d1d43d63862a8431af3dded15bb (patch) | |
tree | 339e5274ebd010e5961da60dd3d9daa1c281f16d /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | |
parent | 21501d1cf290a63760904fb125e77b432db49933 (diff) | |
download | llvm-7c5f5f3ef83b1d1d43d63862a8431af3dded15bb.zip llvm-7c5f5f3ef83b1d1d43d63862a8431af3dded15bb.tar.gz llvm-7c5f5f3ef83b1d1d43d63862a8431af3dded15bb.tar.bz2 |
[lldb] Inherit DuplicateFileAction(HANDLE, HANDLE) handles on windows (#137978)
This is a follow-up to https://github.com/llvm/llvm-project/pull/126935,
which enables passing handles to a child
process on windows systems. Unlike on unix-like systems, the handles
need to be created with the "inheritable" flag because there's to way to
change the flag value after it has been created. This is why I don't
respect the child_process_inherit flag but rather always set the flag to
true. (My next step is to delete the flag entirely.)
This does mean that pipe may be created as inheritable even if its not
necessary, but I think this is offset by the fact that windows (unlike
unixes, which pass all ~O_CLOEXEC descriptors through execve and *all*
descriptors through fork) has a way to specify the precise set of
handles to pass to a specific child process.
If this turns out to be insufficient, instead of a constructor flag, I'd
rather go with creating a separate api to create an inheritable copy of
a handle (as typically, you only want to inherit one end of the pipe).
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index d8c7e43..332b925 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -924,9 +924,7 @@ Status GDBRemoteCommunication::StartDebugserverProcess( debugserver_args.AppendArgument(fd_arg.GetString()); // Send "pass_comm_fd" down to the inferior so it can use it to // communicate back with this process. Ignored on Windows. -#ifndef _WIN32 launch_info.AppendDuplicateFileAction((int)pass_comm_fd, (int)pass_comm_fd); -#endif } // use native registers, not the GDB registers |