Zachary Turner | 172d37d | 2014-10-14 21:55:08 +0000 | [diff] [blame] | 1 | //===-- ProcessLauncherPosix.cpp --------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "lldb/Host/Host.h" |
| 11 | #include "lldb/Host/HostProcess.h" |
| 12 | #include "lldb/Host/posix/ProcessLauncherPosix.h" |
| 13 | |
| 14 | #include "lldb/Target/ProcessLaunchInfo.h" |
| 15 | |
| 16 | #include <limits.h> |
| 17 | |
| 18 | using namespace lldb; |
| 19 | using namespace lldb_private; |
| 20 | |
| 21 | HostProcess |
| 22 | ProcessLauncherPosix::LaunchProcess(const ProcessLaunchInfo &launch_info, Error &error) |
| 23 | { |
| 24 | lldb::pid_t pid; |
| 25 | char exe_path[PATH_MAX]; |
| 26 | |
| 27 | launch_info.GetExecutableFile().GetPath(exe_path, sizeof(exe_path)); |
| 28 | |
| 29 | // TODO(zturner): Move the code from LaunchProcessPosixSpawn to here, and make MacOSX re-use this |
| 30 | // ProcessLauncher when it wants a posix_spawn launch. |
| 31 | error = Host::LaunchProcessPosixSpawn(exe_path, launch_info, pid); |
| 32 | return HostProcess(pid); |
| 33 | } |