From 44e442b3dfc585bf7afc67075f747471253a5a5d Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 12 Sep 2014 22:38:39 +0000 Subject: [PATCH] Make ProcessLaunchInfo copyable. llvm-svn: 217714 --- lldb/include/lldb/Target/ProcessLaunchInfo.h | 4 +-- lldb/source/Target/ProcessLaunchInfo.cpp | 32 ++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lldb/include/lldb/Target/ProcessLaunchInfo.h b/lldb/include/lldb/Target/ProcessLaunchInfo.h index 77d829a7e476..ccccc8af807b 100644 --- a/lldb/include/lldb/Target/ProcessLaunchInfo.h +++ b/lldb/include/lldb/Target/ProcessLaunchInfo.h @@ -169,7 +169,7 @@ namespace lldb_private lldb_utility::PseudoTerminal & GetPTY () { - return m_pty; + return *m_pty; } lldb::ListenerSP @@ -212,7 +212,7 @@ namespace lldb_private std::string m_shell; Flags m_flags; // Bitwise OR of bits from lldb::LaunchFlags std::vector m_file_actions; // File actions for any other files - lldb_utility::PseudoTerminal m_pty; + std::shared_ptr m_pty; uint32_t m_resume_count; // How many times do we resume after launching Host::MonitorChildProcessCallback m_monitor_callback; void *m_monitor_callback_baton; diff --git a/lldb/source/Target/ProcessLaunchInfo.cpp b/lldb/source/Target/ProcessLaunchInfo.cpp index 93f12e6f3cf3..2d1bfa4b9c6c 100644 --- a/lldb/source/Target/ProcessLaunchInfo.cpp +++ b/lldb/source/Target/ProcessLaunchInfo.cpp @@ -31,7 +31,7 @@ ProcessLaunchInfo::ProcessLaunchInfo () : m_shell (), m_flags (0), m_file_actions (), - m_pty (), + m_pty (new lldb_utility::PseudoTerminal), m_resume_count (0), m_monitor_callback (NULL), m_monitor_callback_baton (NULL), @@ -41,19 +41,19 @@ ProcessLaunchInfo::ProcessLaunchInfo () : } ProcessLaunchInfo::ProcessLaunchInfo(const char *stdin_path, const char *stdout_path, const char *stderr_path, - const char *working_directory, uint32_t launch_flags) : - ProcessInfo(), - m_working_dir(), - m_plugin_name(), - m_shell(), - m_flags(launch_flags), - m_file_actions(), - m_pty(), - m_resume_count(0), - m_monitor_callback(NULL), - m_monitor_callback_baton(NULL), - m_monitor_signals(false), - m_hijack_listener_sp() + const char *working_directory, uint32_t launch_flags) + : ProcessInfo() + , m_working_dir() + , m_plugin_name() + , m_shell() + , m_flags(launch_flags) + , m_file_actions() + , m_pty(new lldb_utility::PseudoTerminal) + , m_resume_count(0) + , m_monitor_callback(NULL) + , m_monitor_callback_baton(NULL) + , m_monitor_signals(false) + , m_hijack_listener_sp() { if (stdin_path) { @@ -304,8 +304,8 @@ ProcessLaunchInfo::FinalizeFileActions (Target *target, bool default_to_use_pty) AppendOpenFileAction(STDERR_FILENO, path, false, true); if (default_to_use_pty && (!in_path || !out_path || !err_path)) { - if (m_pty.OpenFirstAvailableMaster(O_RDWR| O_NOCTTY, NULL, 0)) { - const char *slave_path = m_pty.GetSlaveName(NULL, 0); + if (m_pty->OpenFirstAvailableMaster(O_RDWR| O_NOCTTY, NULL, 0)) { + const char *slave_path = m_pty->GetSlaveName(NULL, 0); if (!in_path) { AppendOpenFileAction(STDIN_FILENO, slave_path, true, false);