summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/process/TestProcessAPI.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-07-11 23:38:23 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-07-11 23:38:23 +0000
commit1d3e880c2cd462ac3e9c4f547043636503af14cd (patch)
tree1e2989d30961cd24bbe09ff1bf9cd14da4f86da6 /lldb/test/python_api/process/TestProcessAPI.py
parent3472838c7a4de30bb8d03ebad0522a3422e5faee (diff)
downloadbcm5719-llvm-1d3e880c2cd462ac3e9c4f547043636503af14cd.tar.gz
bcm5719-llvm-1d3e880c2cd462ac3e9c4f547043636503af14cd.zip
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 llvm-svn: 134940
Diffstat (limited to 'lldb/test/python_api/process/TestProcessAPI.py')
-rw-r--r--lldb/test/python_api/process/TestProcessAPI.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/lldb/test/python_api/process/TestProcessAPI.py b/lldb/test/python_api/process/TestProcessAPI.py
index 00934990901..a423bfeb4ba 100644
--- a/lldb/test/python_api/process/TestProcessAPI.py
+++ b/lldb/test/python_api/process/TestProcessAPI.py
@@ -75,8 +75,7 @@ class ProcessAPITestCase(TestBase):
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 @@ class ProcessAPITestCase(TestBase):
# 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 @@ class ProcessAPITestCase(TestBase):
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 @@ class ProcessAPITestCase(TestBase):
# 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 @@ class ProcessAPITestCase(TestBase):
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 @@ class ProcessAPITestCase(TestBase):
# 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 @@ class ProcessAPITestCase(TestBase):
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")
OpenPOWER on IntegriCloud