[Lldb-commits] [lldb] [lldb][windows] refactor FileAction (PR #179274)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Tue Feb 3 03:52:16 PST 2026
================
@@ -242,8 +242,10 @@ llvm::ErrorOr<std::vector<HANDLE>> ProcessLauncherWindows::GetInheritedHandles(
for (size_t i = 0; i < launch_info.GetNumFileActions(); ++i) {
const FileAction *act = launch_info.GetFileActionAtIndex(i);
if (act->GetAction() == FileAction::eFileActionDuplicate &&
- act->GetFD() == act->GetActionArgument())
- inherited_handles.push_back(reinterpret_cast<HANDLE>(act->GetFD()));
+ act->GetFD() == act->GetActionArgument() &&
+ std::find(inherited_handles.begin(), inherited_handles.end(),
+ act->GetHandle()) != inherited_handles.end())
----------------
DavidSpickett wrote:
I don't know the context well so just looking at this change, the logic is suspicious to me.
It seems to say, if act->GetHandle() is already in inherited_handles, then add it again to inherited_handles. Is that correct?
Maybe it is, and this makes sense because we are looking here at eFileActionDuplicate actions and we cannot duplicate something that's not already in the list.
https://github.com/llvm/llvm-project/pull/179274
More information about the lldb-commits
mailing list