|
LLDB mainline
|
#include <ProcessLaunchInfo.h>
Public Member Functions | |
| 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) | |
| void | AppendFileAction (const FileActionImpl &info) |
| bool | AppendCloseFileAction (int fd) |
| bool | AppendDuplicateFileAction (int fd, int dup_fd) |
| bool | AppendOpenFileAction (int fd, const FileSpec &file_spec, bool read, bool write) |
| bool | AppendSuppressFileAction (int fd, bool read, bool write) |
| llvm::Error | SetUpPtyRedirection () |
| bool | HasPTY () const |
| size_t | GetNumFileActions () const |
| const FileAction * | GetFileActionAtIndex (size_t idx) const |
| const FileAction * | GetFileActionForFD (int fd) const |
| bool | IsFDRedirected (int fd) const |
| Returns true if fd has an explicit file action, or is the destination of a duplicate action. | |
| Flags & | GetFlags () |
| const Flags & | GetFlags () const |
| const FileSpec & | GetWorkingDirectory () const |
| void | SetWorkingDirectory (const FileSpec &working_dir) |
| llvm::StringRef | GetProcessPluginName () const |
| void | SetProcessPluginName (llvm::StringRef plugin) |
| const FileSpec & | GetShell () const |
| void | SetShell (const FileSpec &shell) |
| uint32_t | GetResumeCount () const |
| void | SetResumeCount (uint32_t c) |
| bool | GetLaunchInSeparateProcessGroup () const |
| void | SetLaunchInSeparateProcessGroup (bool separate) |
| bool | GetShellExpandArguments () const |
| void | SetShellExpandArguments (bool expand) |
| void | Clear () |
| bool | ConvertArgumentsForLaunchingInShell (Status &error, bool will_debug, bool first_arg_is_full_shell_command, uint32_t num_resumes) |
| void | SetMonitorProcessCallback (Host::MonitorChildProcessCallback callback) |
| const Host::MonitorChildProcessCallback & | GetMonitorProcessCallback () const |
| bool | MonitorProcess () const |
| PTY & | GetPTY () const |
| std::shared_ptr< PTY > | TakePTY () |
| bool | ShouldUsePTY () const |
| Returns whether if lldb should read information from the PTY. | |
| void | SetLaunchEventData (const char *data) |
| const char * | GetLaunchEventData () const |
| void | SetDetachOnError (bool enable) |
| bool | GetDetachOnError () const |
| Public Member Functions inherited from lldb_private::ProcessInfo | |
| ProcessInfo () | |
| ProcessInfo (const char *name, const ArchSpec &arch, lldb::pid_t pid) | |
| void | Clear () |
| const char * | GetName () const |
| llvm::StringRef | GetNameAsStringRef () const |
| FileSpec & | GetExecutableFile () |
| void | SetExecutableFile (const FileSpec &exe_file, bool add_exe_file_as_first_arg) |
| const FileSpec & | GetExecutableFile () const |
| uint32_t | GetUserID () const |
| uint32_t | GetGroupID () const |
| bool | UserIDIsValid () const |
| bool | GroupIDIsValid () const |
| void | SetUserID (uint32_t uid) |
| void | SetGroupID (uint32_t gid) |
| ArchSpec & | GetArchitecture () |
| const ArchSpec & | GetArchitecture () const |
| void | SetArchitecture (const ArchSpec &arch) |
| lldb::pid_t | GetProcessID () const |
| void | SetProcessID (lldb::pid_t pid) |
| bool | ProcessIDIsValid () const |
| void | Dump (Stream &s, Platform *platform) const |
| Args & | GetArguments () |
| const Args & | GetArguments () const |
| llvm::StringRef | GetArg0 () const |
| void | SetArg0 (llvm::StringRef arg) |
| void | SetArguments (const Args &args, bool first_arg_is_executable) |
| void | SetArguments (char const **argv, bool first_arg_is_executable) |
| Environment & | GetEnvironment () |
| const Environment & | GetEnvironment () const |
| bool | IsScriptedProcess () const |
| lldb::ScriptedMetadataSP | GetScriptedMetadata () const |
| void | SetScriptedMetadata (lldb::ScriptedMetadataSP metadata_sp) |
| lldb::ListenerSP | GetListener () const |
| void | SetListener (const lldb::ListenerSP &listener_sp) |
| lldb::ListenerSP | GetHijackListener () const |
| void | SetHijackListener (const lldb::ListenerSP &listener_sp) |
| lldb::ListenerSP | GetShadowListener () const |
| void | SetShadowListener (const lldb::ListenerSP &listener_sp) |
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 194 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 277 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 173 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(), IsFDRedirected(), 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(), IsFDRedirected(), LaunchProcessXPC(), MaybeLogLaunchInfo(), lldb_private::TargetProperties::SetProcessLaunchInfo(), and SetUpPtyRedirection().
|
inline |
Definition at line 92 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 94 of file ProcessLaunchInfo.h.
References m_flags.
|
inline |
Definition at line 169 of file ProcessLaunchInfo.h.
References m_event_data.
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::DoLaunch().
|
inline |
Definition at line 112 of file ProcessLaunchInfo.h.
References m_flags.
Referenced by GetPosixspawnFlags(), and lldb_private::process_gdb_remote::GDBRemoteCommunication::StartDebugserverProcess().
|
inline |
Definition at line 134 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(), IsFDRedirected(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::LaunchProcess(), LaunchProcessPosixSpawn(), MakeForkActions(), and ShouldUsePTY().
| llvm::StringRef ProcessLaunchInfo::GetProcessPluginName | ( | ) | const |
Definition at line 161 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 150 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 108 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 169 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 118 of file ProcessLaunchInfo.h.
References m_flags.
| const FileSpec & ProcessLaunchInfo::GetWorkingDirectory | ( | ) | const |
Definition at line 153 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::IsFDRedirected | ( | int | fd | ) | const |
Returns true if fd has an explicit file action, or is the destination of a duplicate action.
Definition at line 141 of file ProcessLaunchInfo.cpp.
References lldb_private::FileAction::eFileActionDuplicate, lldb_private::FileAction::GetAction(), lldb_private::FileAction::GetActionArgument(), GetFileActionAtIndex(), GetFileActionForFD(), and GetNumFileActions().
Referenced by lldb_private::ProcessLauncherWindows::LaunchProcess().
| bool ProcessLaunchInfo::MonitorProcess | ( | ) | const |
Definition at line 212 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 206 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 224 of file ProcessLaunchInfo.cpp.
References m_flags.
|
inline |
Definition at line 167 of file ProcessLaunchInfo.h.
References m_event_data.
| void ProcessLaunchInfo::SetLaunchInSeparateProcessGroup | ( | bool | separate | ) |
Definition at line 180 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 130 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 165 of file ProcessLaunchInfo.cpp.
References m_plugin_name.
Referenced by lldb_private::Target::SaveScriptedLaunchInfo().
|
inline |
Definition at line 110 of file ProcessLaunchInfo.h.
References m_resume_count.
Referenced by ConvertArgumentsForLaunchingInShell().
| void ProcessLaunchInfo::SetShell | ( | const FileSpec & | shell | ) |
Definition at line 171 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 187 of file ProcessLaunchInfo.cpp.
References m_flags.
| llvm::Error ProcessLaunchInfo::SetUpPtyRedirection | ( | ) |
Definition at line 231 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 157 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 156 of file ProcessLaunchInfo.h.
References GetNumFileActions(), GetPTY(), m_pty, and lldb_private::PseudoConsole::None.
Referenced by lldb_private::ProcessLauncherWindows::LaunchProcess().
|
inline |
Definition at line 152 of file ProcessLaunchInfo.h.
References m_pty.
Referenced by lldb_private::ProcessWindows::DoLaunch().
|
protected |
Definition at line 187 of file ProcessLaunchInfo.h.
Referenced by GetLaunchEventData(), and SetLaunchEventData().
|
protected |
Definition at line 183 of file ProcessLaunchInfo.h.
Referenced by AppendFileAction(), Clear(), GetFileActionAtIndex(), GetFileActionForFD(), GetNumFileActions(), ProcessLaunchInfo(), and ProcessLaunchInfo().
|
protected |
Definition at line 181 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetDetachOnError(), GetFlags(), GetFlags(), GetLaunchInSeparateProcessGroup(), GetShellExpandArguments(), ProcessLaunchInfo(), ProcessLaunchInfo(), SetDetachOnError(), SetLaunchInSeparateProcessGroup(), SetShell(), and SetShellExpandArguments().
|
protected |
Definition at line 186 of file ProcessLaunchInfo.h.
Referenced by GetMonitorProcessCallback(), MonitorProcess(), ProcessLaunchInfo(), and SetMonitorProcessCallback().
|
protected |
Definition at line 179 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetProcessPluginName(), ProcessLaunchInfo(), ProcessLaunchInfo(), and SetProcessPluginName().
|
protected |
Definition at line 184 of file ProcessLaunchInfo.h.
Referenced by GetPTY(), HasPTY(), ProcessLaunchInfo(), ProcessLaunchInfo(), SetUpPtyRedirection(), ShouldUsePTY(), and TakePTY().
|
protected |
Definition at line 185 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetResumeCount(), and SetResumeCount().
|
protected |
Definition at line 180 of file ProcessLaunchInfo.h.
Referenced by Clear(), ConvertArgumentsForLaunchingInShell(), GetShell(), and SetShell().
|
protected |
Definition at line 178 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetWorkingDirectory(), ProcessLaunchInfo(), ProcessLaunchInfo(), and SetWorkingDirectory().