|
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< FileActionImpl > | m_file_actions |
| std::shared_ptr< PTY > | 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 43 of file ProcessLaunchInfo.h.
| ProcessLaunchInfo::ProcessLaunchInfo | ( | ) |
Definition at line 35 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 43 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 78 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 87 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 52 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 107 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 117 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 182 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 265 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 169 of file ProcessLaunchInfo.h.
References m_flags.
Referenced by lldb_private::ProcessAttachInfo::ProcessAttachInfo().
| const FileAction * ProcessLaunchInfo::GetFileActionAtIndex | ( | size_t | idx | ) | const |
Definition at line 127 of file ProcessLaunchInfo.cpp.
References m_file_actions.
Referenced by PlatformPOSIX::DebugProcess(), lldb_private::ProcessLauncherWindows::GetInheritedHandles(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::LaunchProcess(), LaunchProcessPosixSpawn(), and MakeForkActions().
| const FileAction * ProcessLaunchInfo::GetFileActionForFD | ( | int | fd | ) | const |
Definition at line 133 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 88 of file ProcessLaunchInfo.h.
References m_flags.
Referenced by ConvertArgumentsForLaunchingInShell(), lldb_private::Platform::DebugProcess(), lldb_private::PlatformAppleSimulator::DebugProcess(), lldb_private::PlatformQemuUser::DebugProcess(), lldb_private::PlatformWasm::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::PlatformWebInspectorWasm::LaunchPlatformServer(), 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 90 of file ProcessLaunchInfo.h.
References m_flags.
|
inline |
Definition at line 165 of file ProcessLaunchInfo.h.
References m_event_data.
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::DoLaunch().
|
inline |
Definition at line 108 of file ProcessLaunchInfo.h.
References m_flags.
Referenced by GetPosixspawnFlags(), and lldb_private::process_gdb_remote::GDBRemoteCommunication::StartDebugserverProcess().
|
inline |
Definition at line 130 of file ProcessLaunchInfo.h.
References m_monitor_callback.
Referenced by lldb_private::MonitoringProcessLauncher::LaunchProcess().
|
inline |
Definition at line 82 of file ProcessLaunchInfo.h.
References m_file_actions.
Referenced by lldb_private::ProcessLauncherWindows::GetInheritedHandles(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::LaunchProcess(), LaunchProcessPosixSpawn(), MakeForkActions(), and ShouldUsePTY().
| llvm::StringRef ProcessLaunchInfo::GetProcessPluginName | ( | ) | const |
Definition at line 149 of file ProcessLaunchInfo.cpp.
References m_plugin_name.
Referenced by lldb_private::platform_gdb_server::PlatformRemoteGDBServer::DebugProcess(), lldb_private::PlatformWindows::DebugProcess(), lldb_private::Target::Launch(), and lldb_private::ProcessAttachInfo::ProcessAttachInfo().
|
inline |
Definition at line 146 of file ProcessLaunchInfo.h.
References m_pty.
Referenced by lldb_private::Platform::DebugProcess(), lldb_private::PlatformAppleSimulator::DebugProcess(), lldb_private::PlatformQemuUser::DebugProcess(), lldb_private::PlatformWasm::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(), lldb_private::process_netbsd::NativeProcessNetBSD::Manager::Launch(), lldb_private::ProcessLauncherWindows::LaunchProcess(), and ShouldUsePTY().
|
inline |
Definition at line 104 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 157 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 114 of file ProcessLaunchInfo.h.
References m_flags.
| const FileSpec & ProcessLaunchInfo::GetWorkingDirectory | ( | ) | const |
Definition at line 141 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().
|
inline |
Definition at line 80 of file ProcessLaunchInfo.h.
References m_pty.
| bool ProcessLaunchInfo::MonitorProcess | ( | ) | const |
Definition at line 200 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 194 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 212 of file ProcessLaunchInfo.cpp.
References m_flags.
|
inline |
Definition at line 163 of file ProcessLaunchInfo.h.
References m_event_data.
| void ProcessLaunchInfo::SetLaunchInSeparateProcessGroup | ( | bool | separate | ) |
Definition at line 168 of file ProcessLaunchInfo.cpp.
References m_flags, and separate().
Referenced by lldb_private::Platform::DebugProcess(), lldb_private::PlatformAppleSimulator::DebugProcess(), lldb_private::PlatformQemuUser::DebugProcess(), lldb_private::PlatformWasm::DebugProcess(), PlatformPOSIX::DebugProcess(), lldb_private::process_gdb_remote::ProcessGDBRemote::LaunchAndConnectToDebugserver(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::LaunchGDBServer(), and lldb_private::PlatformWebInspectorWasm::LaunchPlatformServer().
|
inline |
Definition at line 126 of file ProcessLaunchInfo.h.
References m_monitor_callback.
Referenced by lldb_private::PlatformDarwin::DebugProcess(), lldb_private::PlatformQemuUser::DebugProcess(), lldb_private::PlatformWasm::DebugProcess(), lldb_private::process_gdb_remote::ProcessGDBRemote::LaunchAndConnectToDebugserver(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::LaunchGDBServer(), lldb_private::PlatformWebInspectorWasm::LaunchPlatformServer(), and lldb_private::Host::RunShellCommand().
| void ProcessLaunchInfo::SetProcessPluginName | ( | llvm::StringRef | plugin | ) |
Definition at line 153 of file ProcessLaunchInfo.cpp.
References m_plugin_name.
Referenced by lldb_private::Target::SaveScriptedLaunchInfo().
|
inline |
Definition at line 106 of file ProcessLaunchInfo.h.
References m_resume_count.
Referenced by ConvertArgumentsForLaunchingInShell().
| void ProcessLaunchInfo::SetShell | ( | const FileSpec & | shell | ) |
Definition at line 159 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 175 of file ProcessLaunchInfo.cpp.
References m_flags.
| llvm::Error ProcessLaunchInfo::SetUpPtyRedirection | ( | ) |
Definition at line 219 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(), lldb_private::PlatformWasm::DebugProcess(), and lldb_private::Target::FinalizeFileActions().
| void ProcessLaunchInfo::SetWorkingDirectory | ( | const FileSpec & | working_dir | ) |
Definition at line 145 of file ProcessLaunchInfo.cpp.
References m_working_dir.
Referenced by ProcessLaunchInfo(), and lldb_private::Host::RunShellCommand().
|
inline |
Returns whether if lldb should read information from the PTY.
This is always true on non Windows.
Definition at line 152 of file ProcessLaunchInfo.h.
References GetNumFileActions(), GetPTY(), m_pty, and lldb_private::PseudoConsole::None.
Referenced by lldb_private::ProcessLauncherWindows::LaunchProcess().
|
inline |
Definition at line 148 of file ProcessLaunchInfo.h.
References m_pty.
Referenced by lldb_private::ProcessWindows::DoLaunch().
|
protected |
Definition at line 183 of file ProcessLaunchInfo.h.
Referenced by GetLaunchEventData(), and SetLaunchEventData().
|
protected |
Definition at line 179 of file ProcessLaunchInfo.h.
Referenced by AppendFileAction(), Clear(), GetFileActionAtIndex(), GetFileActionForFD(), GetNumFileActions(), ProcessLaunchInfo(), and ProcessLaunchInfo().
|
protected |
Definition at line 177 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetDetachOnError(), GetFlags(), GetFlags(), GetLaunchInSeparateProcessGroup(), GetShellExpandArguments(), ProcessLaunchInfo(), ProcessLaunchInfo(), SetDetachOnError(), SetLaunchInSeparateProcessGroup(), SetShell(), and SetShellExpandArguments().
|
protected |
Definition at line 182 of file ProcessLaunchInfo.h.
Referenced by GetMonitorProcessCallback(), MonitorProcess(), ProcessLaunchInfo(), and SetMonitorProcessCallback().
|
protected |
Definition at line 175 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetProcessPluginName(), ProcessLaunchInfo(), ProcessLaunchInfo(), and SetProcessPluginName().
|
protected |
Definition at line 180 of file ProcessLaunchInfo.h.
Referenced by GetPTY(), HasPTY(), ProcessLaunchInfo(), ProcessLaunchInfo(), SetUpPtyRedirection(), ShouldUsePTY(), and TakePTY().
|
protected |
Definition at line 181 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetResumeCount(), and SetResumeCount().
|
protected |
Definition at line 176 of file ProcessLaunchInfo.h.
Referenced by Clear(), ConvertArgumentsForLaunchingInShell(), GetShell(), and SetShell().
|
protected |
Definition at line 174 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetWorkingDirectory(), ProcessLaunchInfo(), ProcessLaunchInfo(), and SetWorkingDirectory().