diff options
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 21 |
1 files 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 6ec7dab1af1..ee6e3aed14b 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 --" |