Author: gclayton
Date: Thu Apr 17 12:27:28 2014
New Revision: 206476

URL: http://llvm.org/viewvc/llvm-project?rev=206476&view=rev
Log:
After updating to Xcode.5.1.1 LLDB framework stopped to support partial (only 
for STDIN) pseudo terminal usage in the debugging process.
Here is the fix resolving this issue.

Patch from Alexey Ushakov.


Modified:
    lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/source/Target/Process.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=206476&r1=206475&r2=206476&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Thu Apr 17 12:27:28 2014
@@ -437,9 +437,10 @@ ProcessInfo::SetArguments (const Args& a
 void
 ProcessLaunchInfo::FinalizeFileActions (Target *target, bool 
default_to_use_pty)
 {
-    // If notthing was specified, then check the process for any default 
+    // If nothing for stdin or stdout or stderr was specified, then check the 
process for any default 
     // settings that were set with "settings set"
-    if (m_file_actions.empty())
+    if (GetFileActionForFD(STDIN_FILENO) == NULL || 
GetFileActionForFD(STDOUT_FILENO) == NULL || 
+        GetFileActionForFD(STDERR_FILENO) == NULL)
     {
         if (m_flags.Test(eLaunchFlagDisableSTDIO))
         {
@@ -462,27 +463,32 @@ ProcessLaunchInfo::FinalizeFileActions (
                 out_path = target->GetStandardOutputPath();
                 err_path = target->GetStandardErrorPath();
             }
-            
-            if (in_path || out_path || err_path)
-            {
-                char path[PATH_MAX];
-                if (in_path && in_path.GetPath(path, sizeof(path)))
-                    AppendOpenFileAction(STDIN_FILENO, path, true, false);
-                
-                if (out_path && out_path.GetPath(path, sizeof(path)))
-                    AppendOpenFileAction(STDOUT_FILENO, path, false, true);
-                
-                if (err_path && err_path.GetPath(path, sizeof(path)))
-                    AppendOpenFileAction(STDERR_FILENO, path, false, true);
-            }
-            else if (default_to_use_pty)
-            {
-                if (m_pty.OpenFirstAvailableMaster (O_RDWR|O_NOCTTY, NULL, 0))
-                {
-                    const char *slave_path = m_pty.GetSlaveName (NULL, 0);
-                    AppendOpenFileAction(STDIN_FILENO, slave_path, true, 
false);
-                    AppendOpenFileAction(STDOUT_FILENO, slave_path, false, 
true);
-                    AppendOpenFileAction(STDERR_FILENO, slave_path, false, 
true);
+
+            char path[PATH_MAX];
+            if (in_path && in_path.GetPath(path, sizeof(path)))
+                AppendOpenFileAction(STDIN_FILENO, path, true, false);
+
+            if (out_path && out_path.GetPath(path, sizeof(path)))
+                AppendOpenFileAction(STDOUT_FILENO, path, false, true);
+
+            if (err_path && err_path.GetPath(path, sizeof(path)))
+                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 (!in_path) {
+                        AppendOpenFileAction(STDIN_FILENO, slave_path, true, 
false);
+                    }
+
+                    if (!out_path) {
+                        AppendOpenFileAction(STDOUT_FILENO, slave_path, false, 
true);
+                    }
+
+                    if (!err_path) {
+                        AppendOpenFileAction(STDERR_FILENO, slave_path, false, 
true);
+                    }
                 }
             }
         }


_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to