[Lldb-commits] [lldb] r134940 - in /lldb/trunk/test: expression_command/test/TestExprs.py functionalities/conditional_break/TestConditionalBreak.py lang/cpp/class_types/TestClassTypes.py lang/cpp/namespace/TestNamespace.py lang/objc/foundation/TestObjCMethods.py python_api/event/TestEvents.py python_api/lldbutil/iter/TestLLDBIterator.py python_api/lldbutil/iter/TestRegistersIterator.py python_api/lldbutil/process/TestPrintStackTraces.py python_api/process/TestProcessAPI.py source-manager/TestSourceManager.py

Johnny Chen johnny.chen at apple.com
Mon Jul 11 16:38:23 PDT 2011


Author: johnny
Date: Mon Jul 11 18:38:23 2011
New Revision: 134940

URL: http://llvm.org/viewvc/llvm-project?rev=134940&view=rev
Log:
Passing in os.ctermid() as the arg for SBTarget.Launch(...) for stdin_path, stdout_path, and stderr_path
is just wrong and resulted in the inferior's output getting mixed into the GDB remote communication's
log file.  Change all test cases to not pass os.ctermid() and either use SBTarget.LaunchSimple() or
SBTarget.Launch() and pass None as stdin_path/stdout_path/srderr_path to use a pseudo terminal.

rdar://problem/9716499 program output is getting mixed into the GDB remote communications

Modified:
    lldb/trunk/test/expression_command/test/TestExprs.py
    lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py
    lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py
    lldb/trunk/test/lang/cpp/namespace/TestNamespace.py
    lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py
    lldb/trunk/test/python_api/event/TestEvents.py
    lldb/trunk/test/python_api/lldbutil/iter/TestLLDBIterator.py
    lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py
    lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py
    lldb/trunk/test/python_api/process/TestProcessAPI.py
    lldb/trunk/test/source-manager/TestSourceManager.py

Modified: lldb/trunk/test/expression_command/test/TestExprs.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/test/TestExprs.py?rev=134940&r1=134939&r2=134940&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/test/TestExprs.py (original)
+++ lldb/trunk/test/expression_command/test/TestExprs.py Mon Jul 11 18:38:23 2011
@@ -100,10 +100,9 @@
 
         # Launch the process, and do not stop at the entry point.
         # Pass 'X Y Z' as the args, which makes argc == 4.
-        error = lldb.SBError()
-        process = target.Launch(self.dbg.GetListener(), ['X', 'Y', 'Z'], None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.LaunchSimple(['X', 'Y', 'Z'], None, os.getcwd())
 
-        if not error.Success() or not process:
+        if not process:
             self.fail("SBTarget.LaunchProcess() failed")
 
         if process.GetState() != lldb.eStateStopped:

Modified: lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py?rev=134940&r1=134939&r2=134940&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py (original)
+++ lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py Mon Jul 11 18:38:23 2011
@@ -52,10 +52,9 @@
         self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
-        error = lldb.SBError()
-        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.LaunchSimple(None, None, os.getcwd())
 
-        self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
+        self.assertTrue(process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
         self.assertTrue(process.GetState() == lldb.eStateStopped,

Modified: lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py?rev=134940&r1=134939&r2=134940&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py (original)
+++ lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py Mon Jul 11 18:38:23 2011
@@ -119,10 +119,9 @@
                        str(self.line)])
 
         # Now launch the process, and do not stop at entry point.
-        error = lldb.SBError()
-        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.LaunchSimple(None, None, os.getcwd())
 
-        if not error.Success() or not process:
+        if not process:
             self.fail("SBTarget.Launch() failed")
 
         if process.GetState() != lldb.eStateStopped:

Modified: lldb/trunk/test/lang/cpp/namespace/TestNamespace.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/namespace/TestNamespace.py?rev=134940&r1=134939&r2=134940&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/namespace/TestNamespace.py (original)
+++ lldb/trunk/test/lang/cpp/namespace/TestNamespace.py Mon Jul 11 18:38:23 2011
@@ -68,12 +68,12 @@
             substrs = slist)
 
         # 'frame variable' with basename 'i' should work.
-        self.expect("frame variable -c -G i",
+        self.expect("frame variable -c -g i",
             startstr = "main.cpp:%d: (int) (anonymous namespace)::i = 3" % self.line_var_i)
         # main.cpp:12: (int) (anonymous namespace)::i = 3
 
         # 'frame variable' with basename 'j' should work, too.
-        self.expect("frame variable -c -G j",
+        self.expect("frame variable -c -g j",
             startstr = "main.cpp:%d: (int) A::B::j = 4" % self.line_var_j)
         # main.cpp:19: (int) A::B::j = 4
 

Modified: lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py?rev=134940&r1=134939&r2=134940&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py (original)
+++ lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py Mon Jul 11 18:38:23 2011
@@ -211,8 +211,7 @@
         self.assertTrue(break1, VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
-        error = lldb.SBError()
-        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.LaunchSimple(None, None, os.getcwd())
 
         self.assertTrue(process, PROCESS_IS_VALID)
 

Modified: lldb/trunk/test/python_api/event/TestEvents.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/event/TestEvents.py?rev=134940&r1=134939&r2=134940&view=diff
==============================================================================
--- lldb/trunk/test/python_api/event/TestEvents.py (original)
+++ lldb/trunk/test/python_api/event/TestEvents.py Mon Jul 11 18:38:23 2011
@@ -149,7 +149,7 @@
 
         # Now launch the process, and do not stop at entry point.
         error = lldb.SBError()
-        process = target.Launch (listener, None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.Launch (listener, None, None, None, None, None, None, 0, False, error)
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Get a handle on the process's broadcaster.

Modified: lldb/trunk/test/python_api/lldbutil/iter/TestLLDBIterator.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/lldbutil/iter/TestLLDBIterator.py?rev=134940&r1=134939&r2=134940&view=diff
==============================================================================
--- lldb/trunk/test/python_api/lldbutil/iter/TestLLDBIterator.py (original)
+++ lldb/trunk/test/python_api/lldbutil/iter/TestLLDBIterator.py Mon Jul 11 18:38:23 2011
@@ -44,10 +44,9 @@
         self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
-        rc = lldb.SBError()
-        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
+        process = target.LaunchSimple(None, None, os.getcwd())
 
-        if not rc.Success() or not process:
+        if not process:
             self.fail("SBTarget.LaunchProcess() failed")
 
         from lldbutil import get_description
@@ -105,10 +104,9 @@
         self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
-        rc = lldb.SBError()
-        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
+        process = target.LaunchSimple(None, None, os.getcwd())
 
-        if not rc.Success() or not process:
+        if not process:
             self.fail("SBTarget.LaunchProcess() failed")
 
         from lldbutil import print_stacktrace

Modified: lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py?rev=134940&r1=134939&r2=134940&view=diff
==============================================================================
--- lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py (original)
+++ lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py Mon Jul 11 18:38:23 2011
@@ -33,10 +33,9 @@
         self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
-        rc = lldb.SBError()
-        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
+        process = target.LaunchSimple(None, None, os.getcwd())
 
-        if not rc.Success() or not process:
+        if not process:
             self.fail("SBTarget.LaunchProcess() failed")
 
         import lldbutil

Modified: lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py?rev=134940&r1=134939&r2=134940&view=diff
==============================================================================
--- lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py (original)
+++ lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py Mon Jul 11 18:38:23 2011
@@ -34,10 +34,9 @@
         self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
-        rc = lldb.SBError()
-        process = target.Launch (self.dbg.GetListener(), ["abc", "xyz"], None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
+        process = target.LaunchSimple(["abc", "xyz"], None, os.getcwd())
 
-        if not rc.Success() or not process:
+        if not process:
             self.fail("SBTarget.LaunchProcess() failed")
 
         import lldbutil

Modified: lldb/trunk/test/python_api/process/TestProcessAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/process/TestProcessAPI.py?rev=134940&r1=134939&r2=134940&view=diff
==============================================================================
--- lldb/trunk/test/python_api/process/TestProcessAPI.py (original)
+++ lldb/trunk/test/python_api/process/TestProcessAPI.py Mon Jul 11 18:38:23 2011
@@ -75,8 +75,7 @@
         self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Launch the process, and do not stop at the entry point.
-        error = lldb.SBError()
-        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.LaunchSimple(None, None, os.getcwd())
 
         thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
@@ -95,6 +94,7 @@
 
         # Due to the typemap magic (see lldb.swig), we pass in 1 to ReadMemory and
         # expect to get a Python string as the result object!
+        error = lldb.SBError()
         content = process.ReadMemory(location, 1, error)
         if not error.Success():
             self.fail("SBProcess.ReadMemory() failed")
@@ -117,8 +117,7 @@
         self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Launch the process, and do not stop at the entry point.
-        error = lldb.SBError()
-        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.LaunchSimple(None, None, os.getcwd())
 
         thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
@@ -139,6 +138,7 @@
         # But we want to use the WriteMemory() API to assign 'a' to the variable.
 
         # Now use WriteMemory() API to write 'a' into the global variable.
+        error = lldb.SBError()
         result = process.WriteMemory(location, 'a', error)
         if not error.Success() or result != 1:
             self.fail("SBProcess.WriteMemory() failed")
@@ -168,8 +168,7 @@
         self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Launch the process, and do not stop at the entry point.
-        error = lldb.SBError()
-        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.LaunchSimple(None, None, os.getcwd())
 
         thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
@@ -207,6 +206,7 @@
 
         # Now use WriteMemory() API to write 256 into the global variable.
         new_value = str(bytes)
+        error = lldb.SBError()
         result = process.WriteMemory(location, new_value, error)
         if not error.Success() or result != byteSize:
             self.fail("SBProcess.WriteMemory() failed")
@@ -254,13 +254,13 @@
         self.assertTrue(target, VALID_TARGET)
 
         # Launch the process, and do not stop at the entry point.
-        error = lldb.SBError()
-        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.LaunchSimple(None, None, os.getcwd())
 
         if self.TraceOn():
             print "process state:", state_type_to_str(process.GetState())
         self.assertTrue(process.GetState() != lldb.eStateConnected)
 
+        error = lldb.SBError()
         success = process.RemoteLaunch(None, None, None, None, None, None, 0, False, error)
         self.assertTrue(not success, "RemoteLaunch() should fail for process state != eStateConnected")
 

Modified: lldb/trunk/test/source-manager/TestSourceManager.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/source-manager/TestSourceManager.py?rev=134940&r1=134939&r2=134940&view=diff
==============================================================================
--- lldb/trunk/test/source-manager/TestSourceManager.py (original)
+++ lldb/trunk/test/source-manager/TestSourceManager.py Mon Jul 11 18:38:23 2011
@@ -43,8 +43,7 @@
         self.assertTrue(target, VALID_TARGET)
 
         # Launch the process, and do not stop at the entry point.
-        error = lldb.SBError()
-        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.LaunchSimple(None, None, os.getcwd())
 
         #
         # Exercise Python APIs to display source lines.





More information about the lldb-commits mailing list