[all-commits] [llvm/llvm-project] 7c5f5f: [lldb] Inherit DuplicateFileAction(HANDLE, HANDLE)...

Pavel Labath via All-commits all-commits at lists.llvm.org
Wed May 7 06:03:07 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7c5f5f3ef83b1d1d43d63862a8431af3dded15bb
      https://github.com/llvm/llvm-project/commit/7c5f5f3ef83b1d1d43d63862a8431af3dded15bb
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2025-05-07 (Wed, 07 May 2025)

  Changed paths:
    M lldb/source/Host/windows/PipeWindows.cpp
    M lldb/source/Host/windows/ProcessLauncherWindows.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
    M lldb/tools/lldb-server/lldb-platform.cpp
    M lldb/unittests/Host/HostTest.cpp

  Log Message:
  -----------
  [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).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list