16#include "llvm/Support/FileSystem.h"
22 std::unique_ptr<ProcessLauncher> delegate_launcher)
23 : m_delegate_launcher(std::move(delegate_launcher)) {}
41 if (!fs.
Exists(exe_spec)) {
42 error.SetErrorStringWithFormatv(
"executable doesn't exist: '{0}'",
48 assert(!resolved_info.
GetFlags().
Test(eLaunchFlagLaunchInTTY));
57 llvm::Expected<HostThread> maybe_thread =
60 error.SetErrorStringWithFormatv(
"failed to launch host thread: {}",
61 llvm::toString(maybe_thread.takeError()));
63 log->
PutCString(
"started monitoring child process.");
67 error.SetErrorString(
"process launch failed for unknown reasons");
static llvm::raw_ostream & error(Stream &strm)
void Resolve(llvm::SmallVectorImpl< char > &path)
Resolve path to make it canonical.
bool ResolveExecutableLocation(FileSpec &file_spec)
Call into the Host to see if it can help find the file.
bool Exists(const FileSpec &file_spec) const
Returns whether the given file exists.
static FileSystem & Instance()
bool Test(ValueType bit) const
Test a single flag bit.
lldb::pid_t GetProcessId() const
llvm::Expected< HostThread > StartMonitoring(const Host::MonitorChildProcessCallback &callback)
void PutCString(const char *cstr)
std::unique_ptr< ProcessLauncher > m_delegate_launcher
HostProcess LaunchProcess(const ProcessLaunchInfo &launch_info, Status &error) override
Launch the process specified in launch_info.
MonitoringProcessLauncher(std::unique_ptr< ProcessLauncher > delegate_launcher)
void SetExecutableFile(const FileSpec &exe_file, bool add_exe_file_as_first_arg)
FileSpec & GetExecutableFile()
const Host::MonitorChildProcessCallback & GetMonitorProcessCallback() const
#define LLDB_INVALID_PROCESS_ID
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.