LLDB mainline
|
#include <ProcessLaunchInfo.h>
Static Public Member Functions | |
static void | NoOpMonitorCallback (lldb::pid_t pid, int signal, int status) |
A Monitor callback which does not take any action on process events. |
Protected Attributes | |
FileSpec | m_working_dir |
std::string | m_plugin_name |
FileSpec | m_shell |
Flags | m_flags |
std::vector< FileAction > | m_file_actions |
std::shared_ptr< PseudoTerminal > | m_pty |
uint32_t | m_resume_count = 0 |
Host::MonitorChildProcessCallback | m_monitor_callback |
std::string | m_event_data |
Protected Attributes inherited from lldb_private::ProcessInfo | |
FileSpec | m_executable |
std::string | m_arg0 |
Args | m_arguments |
Environment | m_environment |
uint32_t | m_uid = UINT32_MAX |
uint32_t | m_gid = UINT32_MAX |
ArchSpec | m_arch |
lldb::pid_t | m_pid = LLDB_INVALID_PROCESS_ID |
lldb::ScriptedMetadataSP | m_scripted_metadata_sp = nullptr |
lldb::ListenerSP | m_listener_sp = nullptr |
lldb::ListenerSP | m_hijack_listener_sp = nullptr |
lldb::ListenerSP | m_shadow_listener_sp = nullptr |
Definition at line 30 of file ProcessLaunchInfo.h.
ProcessLaunchInfo::ProcessLaunchInfo | ( | ) |
Definition at line 32 of file ProcessLaunchInfo.cpp.
References m_file_actions, m_flags, m_monitor_callback, m_plugin_name, m_pty, m_working_dir, and lldb_private::ProcessInfo::ProcessInfo().
Referenced by lldb_private::SBLaunchInfoImpl::operator=().
ProcessLaunchInfo::ProcessLaunchInfo | ( | const FileSpec & | stdin_file_spec, |
const FileSpec & | stdout_file_spec, | ||
const FileSpec & | stderr_file_spec, | ||
const FileSpec & | working_dir, | ||
uint32_t | launch_flags ) |
Definition at line 37 of file ProcessLaunchInfo.cpp.
References AppendFileAction(), m_file_actions, m_flags, m_plugin_name, m_pty, m_working_dir, lldb_private::FileAction::Open(), lldb_private::ProcessInfo::ProcessInfo(), and SetWorkingDirectory().
bool ProcessLaunchInfo::AppendCloseFileAction | ( | int | fd | ) |
Definition at line 69 of file ProcessLaunchInfo.cpp.
References AppendFileAction(), and lldb_private::FileAction::Close().
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunication::StartDebugserverProcess().
bool ProcessLaunchInfo::AppendDuplicateFileAction | ( | int | fd, |
int | dup_fd ) |
Definition at line 78 of file ProcessLaunchInfo.cpp.
References AppendFileAction(), and lldb_private::FileAction::Duplicate().
Referenced by lldb_private::Host::RunShellCommand(), and lldb_private::process_gdb_remote::GDBRemoteCommunication::StartDebugserverProcess().
|
inline |
Definition at line 39 of file ProcessLaunchInfo.h.
References m_file_actions.
Referenced by AppendCloseFileAction(), AppendDuplicateFileAction(), AppendOpenFileAction(), AppendSuppressFileAction(), and ProcessLaunchInfo().
bool ProcessLaunchInfo::AppendOpenFileAction | ( | int | fd, |
const FileSpec & | file_spec, | ||
bool | read, | ||
bool | write ) |
Definition at line 87 of file ProcessLaunchInfo.cpp.
References AppendFileAction(), and lldb_private::FileAction::Open().
Referenced by lldb_private::Target::FinalizeFileActions(), lldb_private::Host::RunShellCommand(), and SetUpPtyRedirection().
Definition at line 97 of file ProcessLaunchInfo.cpp.
References AppendFileAction(), lldb_private::FileSystem::DEV_NULL, and lldb_private::FileAction::Open().
Referenced by lldb_private::Target::FinalizeFileActions(), lldb_private::Host::RunShellCommand(), and lldb_private::process_gdb_remote::GDBRemoteCommunication::StartDebugserverProcess().
void ProcessLaunchInfo::Clear | ( | ) |
Definition at line 162 of file ProcessLaunchInfo.cpp.
References lldb_private::ProcessInfo::Clear(), m_file_actions, m_flags, lldb_private::ProcessInfo::m_hijack_listener_sp, lldb_private::ProcessInfo::m_listener_sp, m_plugin_name, m_resume_count, m_shell, and m_working_dir.
bool ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell | ( | Status & | error, |
bool | will_debug, | ||
bool | first_arg_is_full_shell_command, | ||
uint32_t | num_resumes ) |
Definition at line 234 of file ProcessLaunchInfo.cpp.
References lldb_private::Args::AppendArgument(), lldb_private::ArchSpec::eCore_x86_64_x86_64h, error(), lldb_private::Status::FromErrorString(), lldb_private::ProcessInfo::GetArchitecture(), lldb_private::ProcessInfo::GetArguments(), lldb_private::Args::GetConstArgumentVector(), GetFlags(), lldb_private::FileSpec::GetPath(), lldb_private::Args::GetShellSafeArgument(), lldb_private::StreamString::GetString(), lldb_private::ArchSpec::GetTriple(), GetWorkingDirectory(), lldb_private::FileSpec::IsRelative(), lldb_private::ProcessInfo::m_arguments, lldb_private::ProcessInfo::m_executable, m_shell, lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), and SetResumeCount().
Referenced by lldb_private::Platform::LaunchProcess(), and lldb_private::Host::RunShellCommand().
|
inline |
Definition at line 129 of file ProcessLaunchInfo.h.
References m_flags.
Referenced by lldb_private::ProcessAttachInfo::ProcessAttachInfo().
const FileAction * ProcessLaunchInfo::GetFileActionAtIndex | ( | size_t | idx | ) | const |
Definition at line 107 of file ProcessLaunchInfo.cpp.
References m_file_actions.
Referenced by PlatformPOSIX::DebugProcess(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::LaunchProcess(), lldb_private::ProcessLauncherWindows::LaunchProcess(), LaunchProcessPosixSpawn(), and MakeForkActions().
const FileAction * ProcessLaunchInfo::GetFileActionForFD | ( | int | fd | ) | const |
Definition at line 113 of file ProcessLaunchInfo.cpp.
References m_file_actions.
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::DoLaunch(), lldb_private::Target::FinalizeFileActions(), lldb_private::ProcessLauncherWindows::GetStdioHandle(), HandleFileAction(), LaunchProcessXPC(), MaybeLogLaunchInfo(), lldb_private::TargetProperties::SetProcessLaunchInfo(), and SetUpPtyRedirection().
|
inline |
Definition at line 63 of file ProcessLaunchInfo.h.
References m_flags.
Referenced by ConvertArgumentsForLaunchingInShell(), lldb_private::Platform::DebugProcess(), lldb_private::PlatformAppleSimulator::DebugProcess(), lldb_private::PlatformQemuUser::DebugProcess(), lldb_private::PlatformWindows::DebugProcess(), PlatformPOSIX::DebugProcess(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoLaunch(), lldb_private::StructuredDataDarwinLog::FilterLaunchInfo(), lldb_private::Target::FinalizeFileActions(), GetPosixspawnFlags(), lldb_private::platform_linux::PlatformLinux::GetResumeCountForLaunchInfo(), lldb_private::platform_netbsd::PlatformNetBSD::GetResumeCountForLaunchInfo(), lldb_private::Process::Launch(), lldb_private::Target::Launch(), lldb_private::MonitoringProcessLauncher::LaunchProcess(), lldb_private::Platform::LaunchProcess(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::LaunchProcess(), lldb_private::ProcessDebugger::LaunchProcess(), lldb_private::ProcessLauncherWindows::LaunchProcess(), LaunchProcessPosixSpawn(), lldb_private::TargetProperties::SetProcessLaunchInfo(), and CoreSimulatorSupport::Device::Spawn().
|
inline |
Definition at line 65 of file ProcessLaunchInfo.h.
References m_flags.
|
inline |
Definition at line 125 of file ProcessLaunchInfo.h.
References m_event_data.
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::DoLaunch().
|
inline |
Definition at line 83 of file ProcessLaunchInfo.h.
References m_flags.
Referenced by GetPosixspawnFlags(), and lldb_private::process_gdb_remote::GDBRemoteCommunication::StartDebugserverProcess().
|
inline |
Definition at line 105 of file ProcessLaunchInfo.h.
References m_monitor_callback.
Referenced by lldb_private::MonitoringProcessLauncher::LaunchProcess().
|
inline |
Definition at line 57 of file ProcessLaunchInfo.h.
References m_file_actions.
Referenced by lldb_private::platform_gdb_server::PlatformRemoteGDBServer::LaunchProcess(), lldb_private::ProcessLauncherWindows::LaunchProcess(), LaunchProcessPosixSpawn(), and MakeForkActions().
llvm::StringRef ProcessLaunchInfo::GetProcessPluginName | ( | ) | const |
Definition at line 129 of file ProcessLaunchInfo.cpp.
References m_plugin_name.
Referenced by lldb_private::PlatformWindows::DebugProcess(), lldb_private::Target::Launch(), and lldb_private::ProcessAttachInfo::ProcessAttachInfo().
|
inline |
Definition at line 121 of file ProcessLaunchInfo.h.
References m_pty.
Referenced by lldb_private::Platform::DebugProcess(), lldb_private::PlatformAppleSimulator::DebugProcess(), lldb_private::PlatformQemuUser::DebugProcess(), PlatformPOSIX::DebugProcess(), HandleFileAction(), lldb_private::process_aix::NativeProcessAIX::Manager::Launch(), lldb_private::process_freebsd::NativeProcessFreeBSD::Manager::Launch(), lldb_private::process_linux::NativeProcessLinux::Manager::Launch(), and lldb_private::process_netbsd::NativeProcessNetBSD::Manager::Launch().
|
inline |
Definition at line 79 of file ProcessLaunchInfo.h.
References m_resume_count.
Referenced by lldb_private::Platform::LaunchProcess(), and lldb_private::ProcessAttachInfo::ProcessAttachInfo().
const FileSpec & ProcessLaunchInfo::GetShell | ( | ) | const |
Definition at line 137 of file ProcessLaunchInfo.cpp.
References m_shell.
Referenced by lldb_private::platform_linux::PlatformLinux::GetResumeCountForLaunchInfo(), lldb_private::platform_netbsd::PlatformNetBSD::GetResumeCountForLaunchInfo(), lldb_private::PlatformDarwin::GetResumeCountForLaunchInfo(), lldb_private::Target::Launch(), lldb_private::Platform::LaunchProcess(), and LaunchProcessPosixSpawn().
|
inline |
Definition at line 89 of file ProcessLaunchInfo.h.
References m_flags.
const FileSpec & ProcessLaunchInfo::GetWorkingDirectory | ( | ) | const |
Definition at line 121 of file ProcessLaunchInfo.cpp.
References m_working_dir.
Referenced by ConvertArgumentsForLaunchingInShell(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoLaunch(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::LaunchProcess(), lldb_private::ProcessDebugger::LaunchProcess(), lldb_private::ProcessLauncherWindows::LaunchProcess(), and LaunchProcessPosixSpawn().
bool ProcessLaunchInfo::MonitorProcess | ( | ) | const |
Definition at line 180 of file ProcessLaunchInfo.cpp.
References lldb_private::GetLog(), lldb_private::ProcessInfo::GetProcessID(), lldb_private::Host, LLDB_LOG_ERROR, m_monitor_callback, lldb_private::ProcessInfo::ProcessIDIsValid(), and lldb_private::Host::StartMonitoringChildProcess().
|
static |
A Monitor callback which does not take any action on process events.
Use this if you don't need to take any particular action when the process terminates, but you still need to reap it.
Definition at line 174 of file ProcessLaunchInfo.cpp.
References lldb_private::GetLog(), LLDB_LOG, and lldb_private::Process.
Referenced by lldb_private::PlatformDarwin::DebugProcess(), and lldb_private::PlatformQemuUser::DebugProcess().
void ProcessLaunchInfo::SetDetachOnError | ( | bool | enable | ) |
Definition at line 192 of file ProcessLaunchInfo.cpp.
References m_flags.
|
inline |
Definition at line 123 of file ProcessLaunchInfo.h.
References m_event_data.
void ProcessLaunchInfo::SetLaunchInSeparateProcessGroup | ( | bool | separate | ) |
Definition at line 148 of file ProcessLaunchInfo.cpp.
References m_flags, and separate().
Referenced by lldb_private::Platform::DebugProcess(), lldb_private::PlatformAppleSimulator::DebugProcess(), lldb_private::PlatformQemuUser::DebugProcess(), PlatformPOSIX::DebugProcess(), lldb_private::process_gdb_remote::ProcessGDBRemote::LaunchAndConnectToDebugserver(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::LaunchGDBServer().
|
inline |
Definition at line 101 of file ProcessLaunchInfo.h.
References m_monitor_callback.
Referenced by lldb_private::PlatformDarwin::DebugProcess(), lldb_private::PlatformQemuUser::DebugProcess(), lldb_private::process_gdb_remote::ProcessGDBRemote::LaunchAndConnectToDebugserver(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::LaunchGDBServer(), and lldb_private::Host::RunShellCommand().
void ProcessLaunchInfo::SetProcessPluginName | ( | llvm::StringRef | plugin | ) |
Definition at line 133 of file ProcessLaunchInfo.cpp.
References m_plugin_name.
Referenced by lldb_private::Target::SaveScriptedLaunchInfo().
|
inline |
Definition at line 81 of file ProcessLaunchInfo.h.
References m_resume_count.
Referenced by ConvertArgumentsForLaunchingInShell().
void ProcessLaunchInfo::SetShell | ( | const FileSpec & | shell | ) |
Definition at line 139 of file ProcessLaunchInfo.cpp.
References lldb_private::FileSystem::Instance(), m_flags, m_shell, and lldb_private::FileSystem::ResolveExecutableLocation().
Referenced by lldb_private::Host::RunShellCommand().
void ProcessLaunchInfo::SetShellExpandArguments | ( | bool | expand | ) |
Definition at line 155 of file ProcessLaunchInfo.cpp.
References m_flags.
llvm::Error ProcessLaunchInfo::SetUpPtyRedirection | ( | ) |
Definition at line 199 of file ProcessLaunchInfo.cpp.
References AppendOpenFileAction(), GetFileActionForFD(), lldb_private::GetLog(), LLDB_LOG, m_pty, O_NOCTTY, and lldb_private::Process.
Referenced by lldb_private::PlatformQemuUser::DebugProcess(), and lldb_private::Target::FinalizeFileActions().
void ProcessLaunchInfo::SetWorkingDirectory | ( | const FileSpec & | working_dir | ) |
Definition at line 125 of file ProcessLaunchInfo.cpp.
References m_working_dir.
Referenced by ProcessLaunchInfo(), and lldb_private::Host::RunShellCommand().
|
protected |
Definition at line 142 of file ProcessLaunchInfo.h.
Referenced by GetLaunchEventData(), and SetLaunchEventData().
|
protected |
Definition at line 138 of file ProcessLaunchInfo.h.
Referenced by AppendFileAction(), Clear(), GetFileActionAtIndex(), GetFileActionForFD(), GetNumFileActions(), ProcessLaunchInfo(), and ProcessLaunchInfo().
|
protected |
Definition at line 137 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetDetachOnError(), GetFlags(), GetFlags(), GetLaunchInSeparateProcessGroup(), GetShellExpandArguments(), ProcessLaunchInfo(), ProcessLaunchInfo(), SetDetachOnError(), SetLaunchInSeparateProcessGroup(), SetShell(), and SetShellExpandArguments().
|
protected |
Definition at line 141 of file ProcessLaunchInfo.h.
Referenced by GetMonitorProcessCallback(), MonitorProcess(), ProcessLaunchInfo(), and SetMonitorProcessCallback().
|
protected |
Definition at line 135 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetProcessPluginName(), ProcessLaunchInfo(), ProcessLaunchInfo(), and SetProcessPluginName().
|
protected |
Definition at line 139 of file ProcessLaunchInfo.h.
Referenced by GetPTY(), ProcessLaunchInfo(), ProcessLaunchInfo(), and SetUpPtyRedirection().
|
protected |
Definition at line 140 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetResumeCount(), and SetResumeCount().
|
protected |
Definition at line 136 of file ProcessLaunchInfo.h.
Referenced by Clear(), ConvertArgumentsForLaunchingInShell(), GetShell(), and SetShell().
|
protected |
Definition at line 134 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetWorkingDirectory(), ProcessLaunchInfo(), ProcessLaunchInfo(), and SetWorkingDirectory().