|
LLDB mainline
|
#include <ProcessLauncherWindows.h>
Public Member Functions | |
| HostProcess | LaunchProcess (const ProcessLaunchInfo &launch_info, Status &error) override |
| Public Member Functions inherited from lldb_private::ProcessLauncher | |
| virtual | ~ProcessLauncher ()=default |
Static Protected Member Functions | |
| static llvm::ErrorOr< std::vector< HANDLE > > | GetInheritedHandles (STARTUPINFOEXW &startupinfoex, const ProcessLaunchInfo *launch_info=nullptr, HANDLE stdout_handle=NULL, HANDLE stderr_handle=NULL, HANDLE stdin_handle=NULL) |
| Get the list of Windows handles that should be inherited by the child process and update STARTUPINFOEXW with the handle list. | |
| static HANDLE | GetStdioHandle (const ProcessLaunchInfo &launch_info, int fd) |
| static HANDLE | GetStdioHandle (const llvm::StringRef path, int fd) |
| Creates a file handle suitable for redirecting stdin, stdout, or stderr of a child process. | |
Definition at line 79 of file ProcessLauncherWindows.h.
|
staticprotected |
Get the list of Windows handles that should be inherited by the child process and update STARTUPINFOEXW with the handle list.
If no handles need to be inherited, an empty vector is returned.
Otherwise, the function populates the PROC_THREAD_ATTRIBUTE_HANDLE_LIST attribute in startupinfoex with the collected handles using UpdateProcThreadAttribute. On success, the vector of inherited handles is returned.
| startupinfoex | The extended STARTUPINFO structure for the process being created. |
| launch_info | The process launch configuration. |
| stdout_handle | |
| stderr_handle | |
| stdin_handle | Optional explicit standard stream handles to use for the child process. |
Definition at line 237 of file ProcessLauncherWindows.cpp.
References lldb_private::FileAction::eFileActionDuplicate, lldb_private::FileAction::GetAction(), lldb_private::FileAction::GetActionArgument(), lldb_private::FileAction::GetFD(), lldb_private::ProcessLaunchInfo::GetFileActionAtIndex(), and lldb_private::ProcessLaunchInfo::GetNumFileActions().
Referenced by LaunchProcess().
|
staticprotected |
Creates a file handle suitable for redirecting stdin, stdout, or stderr of a child process.
| path | The file path to open. If empty, returns NULL (no redirection). |
| fd | The file descriptor type: STDIN_FILENO, STDOUT_FILENO, or STDERR_FILENO. |
Behavior by file descriptor:
All handles are created with:
Definition at line 289 of file ProcessLauncherWindows.cpp.
|
staticprotected |
Definition at line 279 of file ProcessLauncherWindows.cpp.
References lldb_private::ProcessLaunchInfo::GetFileActionForFD(), lldb_private::FileAction::GetFileSpec(), lldb_private::FileSpec::GetPath(), and GetStdioHandle().
Referenced by GetStdioHandle(), and LaunchProcess().
|
overridevirtual |
Implements lldb_private::ProcessLauncher.
Definition at line 125 of file ProcessLauncherWindows.cpp.
References lldb_private::ProcThreadAttributeList::Create(), CreateEnvironmentBufferW(), lldb::eErrorTypeWin32, error(), lldb_private::Status::FromError(), lldb_private::ProcessInfo::GetArguments(), lldb_private::ProcessInfo::GetEnvironment(), lldb_private::ProcessInfo::GetExecutableFile(), lldb_private::ProcessLaunchInfo::GetFlags(), lldb_private::GetFlattenedWindowsCommandStringW(), GetInheritedHandles(), lldb_private::FileSpec::GetPath(), lldb_private::ProcessLaunchInfo::GetPTY(), GetStdioHandle(), lldb_private::ProcessLaunchInfo::GetWorkingDirectory(), lldb_private::ProcThreadAttributeList::SetupPseudoConsole(), lldb_private::ProcessLaunchInfo::ShouldUsePTY(), lldb_private::Status, and lldb_private::Flags::Test().
Referenced by lldb_private::DebuggerThread::DebuggerThreadLaunchRoutine().