From ba8df270e6bcf07c098927aa955ac05bcba64a6e Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Fri, 28 Jan 2011 00:19:58 +0000 Subject: [PATCH] If the user specfies one of stdin, stdout or stderr, don't automatically set the non-specified ones to /dev/null. llvm-svn: 124459 --- .../Process/gdb-remote/ProcessGDBRemote.cpp | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 6ec7dab1af1d..ee6e3aed14b3 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1845,14 +1845,27 @@ ProcessGDBRemote::StartDebugserverProcess lldb_utility::PseudoTerminal pty; const char *stdio_path = NULL; if (launch_process && - stdin_path == NULL && - stdout_path == NULL && - stderr_path == NULL && + (stdin_path == NULL || stdout_path == NULL || stderr_path == NULL) && m_local_debugserver && no_stdio == false) { if (pty.OpenFirstAvailableMaster(O_RDWR|O_NOCTTY, NULL, 0)) - stdio_path = pty.GetSlaveName (NULL, 0); + { + const char *slave_name = pty.GetSlaveName (NULL, 0); + if (stdin_path == NULL + && stdout_path == NULL + && stderr_path == NULL) + stdio_path = slave_name; + else + { + if (stdin_path == NULL) + stdin_path = slave_name; + if (stdout_path == NULL) + stdout_path = slave_name; + if (stderr_path == NULL) + stderr_path = slave_name; + } + } } // Start args with "debugserver /file/path -r --"