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 FileAction &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 () |
size_t | GetNumFileActions () const |
const FileAction * | GetFileActionAtIndex (size_t idx) const |
const FileAction * | GetFileActionForFD (int fd) const |
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 |
PseudoTerminal & | GetPTY () |
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< 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.
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(), lldb_private::FileAction::Open(), 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(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QSetSTDERR(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QSetSTDIN(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QSetSTDOUT(), ProcessLaunchInfo(), and lldb_private::CommandOptionsProcessLaunch::SetOptionValue().
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::TargetProperties::ErrorPathValueChangedCallback(), lldb_private::Target::FinalizeFileActions(), lldb_private::TargetProperties::InputPathValueChangedCallback(), lldb_private::TargetProperties::OutputPathValueChangedCallback(), lldb_private::Host::RunShellCommand(), and SetUpPtyRedirection().
bool ProcessLaunchInfo::AppendSuppressFileAction | ( | int | fd, |
bool | read, | ||
bool | write | ||
) |
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::FileSpec::Clear(), lldb_private::ProcessInfo::Clear(), lldb_private::Flags::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.
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qC(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::Handle_qProcessInfo(), and lldb_private::CommandOptionsProcessLaunch::OptionParsingStarting().
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::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, and lldb_private::Flags::Test().
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(), 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(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::LaunchProcess(), LaunchProcessXPC(), MaybeLogLaunchInfo(), lldb_private::TargetProperties::SetProcessLaunchInfo(), and SetUpPtyRedirection().
|
inline |
Definition at line 63 of file ProcessLaunchInfo.h.
References m_flags.
Referenced by ConvertArgumentsForLaunchingInShell(), PlatformPOSIX::DebugProcess(), lldb_private::PlatformWindows::DebugProcess(), lldb_private::Platform::DebugProcess(), lldb_private::PlatformAppleSimulator::DebugProcess(), lldb_private::PlatformQemuUser::DebugProcess(), lldb_private::TargetProperties::DetachOnErrorValueChangedCallback(), lldb_private::TargetProperties::DisableASLRValueChangedCallback(), lldb_private::TargetProperties::DisableSTDIOValueChangedCallback(), CommandObjectPlatformProcessLaunch::DoExecute(), CommandObjectProcessLaunch::DoExecute(), 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_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QSetDetachOnError(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QSetDisableASLR(), lldb_private::TargetProperties::InheritTCCValueChangedCallback(), lldb_private::Process::Launch(), lldb_private::Target::Launch(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::LaunchProcess(), lldb_private::MonitoringProcessLauncher::LaunchProcess(), lldb_private::ProcessLauncherWindows::LaunchProcess(), lldb_private::Platform::LaunchProcess(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::LaunchProcess(), lldb_private::ProcessDebugger::LaunchProcess(), LaunchProcessPosixSpawn(), lldb_private::CommandOptionsProcessLaunch::SetOptionValue(), 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, and lldb_private::Flags::Test().
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::process_gdb_remote::GDBRemoteCommunicationServerPlatform::LaunchProcess(), and 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(), 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 PlatformPOSIX::DebugProcess(), lldb_private::Platform::DebugProcess(), lldb_private::PlatformAppleSimulator::DebugProcess(), lldb_private::PlatformQemuUser::DebugProcess(), HandleFileAction(), 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::PlatformDarwin::GetResumeCountForLaunchInfo(), lldb_private::platform_netbsd::PlatformNetBSD::GetResumeCountForLaunchInfo(), lldb_private::Target::Launch(), lldb_private::Platform::LaunchProcess(), and LaunchProcessPosixSpawn().
|
inline |
Definition at line 89 of file ProcessLaunchInfo.h.
References m_flags, and lldb_private::Flags::Test().
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::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_qGetWorkingDir(), lldb_private::ProcessLauncherWindows::LaunchProcess(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::LaunchProcess(), lldb_private::ProcessDebugger::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 lldb_private::Flags::Clear(), m_flags, and lldb_private::Flags::Set().
|
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 lldb_private::Flags::Clear(), m_flags, separate(), and lldb_private::Flags::Set().
Referenced by PlatformPOSIX::DebugProcess(), lldb_private::Platform::DebugProcess(), lldb_private::PlatformAppleSimulator::DebugProcess(), lldb_private::PlatformQemuUser::DebugProcess(), lldb_private::process_gdb_remote::ProcessGDBRemote::LaunchAndConnectToDebugserver(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::LaunchGDBServer(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::LaunchProcess().
|
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(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerPlatform::LaunchProcess(), 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 CommandObjectPlatformProcessLaunch::DoExecute(), CommandObjectProcessLaunch::DoExecute(), lldb_private::Target::SaveScriptedLaunchInfo(), and lldb_private::CommandOptionsProcessLaunch::SetOptionValue().
|
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::Flags::Clear(), lldb_private::FileSystem::Instance(), m_flags, m_shell, lldb_private::FileSystem::ResolveExecutableLocation(), and lldb_private::Flags::Set().
Referenced by lldb_private::Host::RunShellCommand(), and lldb_private::CommandOptionsProcessLaunch::SetOptionValue().
void ProcessLaunchInfo::SetShellExpandArguments | ( | bool | expand | ) |
Definition at line 155 of file ProcessLaunchInfo.cpp.
References lldb_private::Flags::Clear(), m_flags, and lldb_private::Flags::Set().
Referenced by lldb_private::CommandOptionsProcessLaunch::SetOptionValue().
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(), lldb_private::Target::FinalizeFileActions(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::LaunchProcess().
void ProcessLaunchInfo::SetWorkingDirectory | ( | const FileSpec & | working_dir | ) |
Definition at line 125 of file ProcessLaunchInfo.cpp.
References m_working_dir.
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QSetWorkingDir(), ProcessLaunchInfo(), lldb_private::Host::RunShellCommand(), and lldb_private::CommandOptionsProcessLaunch::SetOptionValue().
|
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(), and GetNumFileActions().
|
protected |
Definition at line 137 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetDetachOnError(), GetFlags(), GetLaunchInSeparateProcessGroup(), GetShellExpandArguments(), SetDetachOnError(), SetLaunchInSeparateProcessGroup(), SetShell(), and SetShellExpandArguments().
|
protected |
Definition at line 141 of file ProcessLaunchInfo.h.
Referenced by GetMonitorProcessCallback(), MonitorProcess(), and SetMonitorProcessCallback().
|
protected |
Definition at line 135 of file ProcessLaunchInfo.h.
Referenced by Clear(), GetProcessPluginName(), and SetProcessPluginName().
|
protected |
Definition at line 139 of file ProcessLaunchInfo.h.
Referenced by GetPTY(), 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(), and SetWorkingDirectory().