If the user specfies one of stdin, stdout or stderr, don't
automatically set the non-specified ones to /dev/null.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124459 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 6ec7dab..ee6e3ae 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1845,14 +1845,27 @@
             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 --"