[Lldb-commits] [lldb] r147983 - in /lldb/trunk/test/python_api/process/io: TestProcessIO.py main.c

Johnny Chen johnny.chen at apple.com
Wed Jan 11 16:29:46 PST 2012


Author: johnny
Date: Wed Jan 11 18:29:46 2012
New Revision: 147983

URL: http://llvm.org/viewvc/llvm-project?rev=147983&view=rev
Log:
rdar://problem/10492827
SBProcess.GetSTDERR() not getting stderr of the launched process

Since we are launch the inferior with:

    process = target.LaunchSimple(None, None, os.getcwd())

i.e., without specifying stdin/out/err.  A pseudo terminal is used for
handling the process I/O, and we are satisfied once the expected output
appears in process.GetSTDOUT().

Modified:
    lldb/trunk/test/python_api/process/io/TestProcessIO.py
    lldb/trunk/test/python_api/process/io/main.c

Modified: lldb/trunk/test/python_api/process/io/TestProcessIO.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/process/io/TestProcessIO.py?rev=147983&r1=147982&r2=147983&view=diff
==============================================================================
--- lldb/trunk/test/python_api/process/io/TestProcessIO.py (original)
+++ lldb/trunk/test/python_api/process/io/TestProcessIO.py Wed Jan 11 18:29:46 2012
@@ -49,10 +49,10 @@
             error = process.GetSTDERR(500)
             if self.TraceOn():
                 print "output->|%s|" % output
-                print "error->|%s|" % error
-            # We are satisfied once "input line=>1" appears in stderr.
+            # Since we launched the process without specifying stdin/out/err,
+            # a pseudo terminal is used for stdout/err, and we are satisfied
+            # once "input line=>1" appears in stdout.
             # See also main.c.
-            #if "input line=>1" in error:
             if "input line=>1" in output:
                 return
             time.sleep(5)

Modified: lldb/trunk/test/python_api/process/io/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/process/io/main.c?rev=147983&r1=147982&r2=147983&view=diff
==============================================================================
--- lldb/trunk/test/python_api/process/io/main.c (original)
+++ lldb/trunk/test/python_api/process/io/main.c Wed Jan 11 18:29:46 2012
@@ -6,6 +6,8 @@
     int count = 1;
     while (fgets(line, sizeof(line), stdin)) { // Reading from stdin...
         fprintf(stderr, "input line=>%d\n", count++);
+        if (count > 3)
+            break;
     }
 
     printf("Exiting now\n");





More information about the lldb-commits mailing list