The extra burden for the Python API test case to assign its process object to self.process
in order to have its process cleaned up (terminated) upon tearDown is gone for good.
Let's simplify a bunch of Python API test cases.

llvm-svn: 133097
diff --git a/lldb/test/python_api/event/TestEvents.py b/lldb/test/python_api/event/TestEvents.py
index 7b21df1..6454203 100644
--- a/lldb/test/python_api/event/TestEvents.py
+++ b/lldb/test/python_api/event/TestEvents.py
@@ -64,13 +64,11 @@
 
         # Now launch the process, and do not stop at entry point.
         error = lldb.SBError()
-        self.process = target.Launch (listener, None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
-
-        self.process = target.GetProcess()
-        self.assertTrue(self.process, PROCESS_IS_VALID)
+        process = target.Launch (listener, None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        self.assertTrue(process, PROCESS_IS_VALID)
 
         # Get a handle on the process's broadcaster.
-        broadcaster = self.process.GetBroadcaster()
+        broadcaster = process.GetBroadcaster()
         self.assertTrue(broadcaster, "Process with valid broadcaster")
 
         # Create an empty event object.
@@ -94,7 +92,7 @@
 
         # Use Python API to kill the process.  The listening thread should be
         # able to receive a state changed event.
-        self.process.Kill()
+        process.Kill()
 
         # Let's start the listening thread to retrieve the event.
         my_thread = MyListeningThread()
@@ -122,14 +120,12 @@
                         VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at the entry point.
-        self.process = target.LaunchSimple(None, None, os.getcwd())
-
-        self.process = target.GetProcess()
-        self.assertTrue(self.process.GetState() == lldb.eStateStopped,
+        process = target.LaunchSimple(None, None, os.getcwd())
+        self.assertTrue(process.GetState() == lldb.eStateStopped,
                         PROCESS_STOPPED)
 
         # Get a handle on the process's broadcaster.
-        broadcaster = self.process.GetBroadcaster()
+        broadcaster = process.GetBroadcaster()
         self.assertTrue(broadcaster, "Process with valid broadcaster")
 
         # Create an empty event object.
@@ -188,7 +184,7 @@
 
         # Use Python API to continue the process.  The listening thread should be
         # able to receive the state changed events.
-        self.process.Continue()
+        process.Continue()
 
         # Start the listening thread to receive the "running" followed by the
         # "stopped" events.
diff --git a/lldb/test/python_api/frame/TestFrames.py b/lldb/test/python_api/frame/TestFrames.py
index 053da24..e9b1ed1 100644
--- a/lldb/test/python_api/frame/TestFrames.py
+++ b/lldb/test/python_api/frame/TestFrames.py
@@ -41,9 +41,6 @@
                         VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at the entry point.
-        # Note that we don't assign the process to self.process as in other test
-        # cases.  We want the inferior to run till it exits and there's no need
-        # for the testing framework to kill the inferior upon tearDown().
         process = target.LaunchSimple(None, None, os.getcwd())
 
         process = target.GetProcess()
diff --git a/lldb/test/python_api/function_symbol/TestDisasmAPI.py b/lldb/test/python_api/function_symbol/TestDisasmAPI.py
index 37a98d3..b3a8bbb 100644
--- a/lldb/test/python_api/function_symbol/TestDisasmAPI.py
+++ b/lldb/test/python_api/function_symbol/TestDisasmAPI.py
@@ -53,14 +53,12 @@
                         VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
-        self.process = target.LaunchSimple(None, None, os.getcwd())
-
-        self.process = target.GetProcess()
-        self.assertTrue(self.process, PROCESS_IS_VALID)
+        process = target.LaunchSimple(None, None, os.getcwd())
+        self.assertTrue(process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line1.
-        self.assertTrue(self.process.GetState() == lldb.eStateStopped)
-        thread = lldbutil.get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        self.assertTrue(process.GetState() == lldb.eStateStopped)
+        thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
         frame0 = thread.GetFrameAtIndex(0)
         lineEntry = frame0.GetLineEntry()
@@ -77,9 +75,9 @@
             print "context1:", context1
 
         # Continue the inferior, the breakpoint 2 should be hit.
-        self.process.Continue()
-        self.assertTrue(self.process.GetState() == lldb.eStateStopped)
-        thread = lldbutil.get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        process.Continue()
+        self.assertTrue(process.GetState() == lldb.eStateStopped)
+        thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
         frame0 = thread.GetFrameAtIndex(0)
         lineEntry = frame0.GetLineEntry()
diff --git a/lldb/test/python_api/function_symbol/TestSymbolAPI.py b/lldb/test/python_api/function_symbol/TestSymbolAPI.py
index 9135437..f983ed6 100644
--- a/lldb/test/python_api/function_symbol/TestSymbolAPI.py
+++ b/lldb/test/python_api/function_symbol/TestSymbolAPI.py
@@ -53,14 +53,12 @@
                         VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
-        self.process = target.LaunchSimple(None, None, os.getcwd())
-
-        self.process = target.GetProcess()
-        self.assertTrue(self.process, PROCESS_IS_VALID)
+        process = target.LaunchSimple(None, None, os.getcwd())
+        self.assertTrue(process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line1.
-        self.assertTrue(self.process.GetState() == lldb.eStateStopped)
-        thread = lldbutil.get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        self.assertTrue(process.GetState() == lldb.eStateStopped)
+        thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
         frame0 = thread.GetFrameAtIndex(0)
         symbol_line1 = frame0.GetSymbol()
@@ -71,9 +69,9 @@
         self.assertTrue(addr_line1.GetSectionType() == lldb.eSectionTypeCode)
 
         # Continue the inferior, the breakpoint 2 should be hit.
-        self.process.Continue()
-        self.assertTrue(self.process.GetState() == lldb.eStateStopped)
-        thread = lldbutil.get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        process.Continue()
+        self.assertTrue(process.GetState() == lldb.eStateStopped)
+        thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
         frame0 = thread.GetFrameAtIndex(0)
         symbol_line2 = frame0.GetSymbol()
diff --git a/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py b/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py
index 8620824..b310c1a 100644
--- a/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py
+++ b/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py
@@ -59,18 +59,17 @@
         ci.HandleCommand("process launch", res)
         self.assertTrue(res.Succeeded())
 
-        # Assigning to self.process so it gets cleaned up during test tear down.
-        self.process = ci.GetProcess()
-        self.assertTrue(self.process)
+        process = ci.GetProcess()
+        self.assertTrue(process)
 
         import lldbutil
-        if self.process.GetState() != lldb.eStateStopped:
+        if process.GetState() != lldb.eStateStopped:
             self.fail("Process should be in the 'stopped' state, "
                       "instead the actual state is: '%s'" %
-                      lldbutil.state_type_to_str(self.process.GetState()))
+                      lldbutil.state_type_to_str(process.GetState()))
 
         if self.TraceOn():
-            lldbutil.print_stacktraces(self.process)        
+            lldbutil.print_stacktraces(process)        
                         
 
 if __name__ == '__main__':
diff --git a/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py b/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py
index ff9723b..1fd337a 100644
--- a/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py
+++ b/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py
@@ -33,15 +33,15 @@
         self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
-        self.process = target.LaunchSimple(None, None, os.getcwd())
+        process = target.LaunchSimple(None, None, os.getcwd())
 
-        if not self.process:
+        if not process:
             self.fail("SBTarget.LaunchProcess() failed")
-        self.assertTrue(self.process.GetState() == lldb.eStateStopped,
+        self.assertTrue(process.GetState() == lldb.eStateStopped,
                         PROCESS_STOPPED)
 
         import lldbutil
-        thread = lldbutil.get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         frame0 = thread.GetFrameAtIndex(0)
         frame1 = thread.GetFrameAtIndex(1)
         parent = lldbutil.get_parent_frame(frame0)
diff --git a/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py b/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py
index cc94157..c9862fe 100644
--- a/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py
+++ b/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py
@@ -45,9 +45,9 @@
 
         # Now launch the process, and do not stop at entry point.
         rc = lldb.SBError()
-        self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
+        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
 
-        if not rc.Success() or not self.process:
+        if not rc.Success() or not process:
             self.fail("SBTarget.LaunchProcess() failed")
 
         from lldbutil import get_description
@@ -106,14 +106,14 @@
 
         # Now launch the process, and do not stop at entry point.
         rc = lldb.SBError()
-        self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
+        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
 
-        if not rc.Success() or not self.process:
+        if not rc.Success() or not process:
             self.fail("SBTarget.LaunchProcess() failed")
 
         from lldbutil import print_stacktrace
         stopped_due_to_breakpoint = False
-        for thread in self.process:
+        for thread in process:
             if self.TraceOn():
                 print_stacktrace(thread)
             ID = thread.GetThreadID()
diff --git a/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py b/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py
index 8e66d37..c4bbad6 100644
--- a/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py
+++ b/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py
@@ -34,13 +34,13 @@
 
         # Now launch the process, and do not stop at entry point.
         rc = lldb.SBError()
-        self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
+        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
 
-        if not rc.Success() or not self.process:
+        if not rc.Success() or not process:
             self.fail("SBTarget.LaunchProcess() failed")
 
         import lldbutil
-        for thread in self.process:
+        for thread in process:
             if thread.GetStopReason() == lldb.eStopReasonBreakpoint:
                 for frame in thread:
                     # Dump the registers of this frame using lldbutil.get_GPRs() and friends.
diff --git a/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py b/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py
index 43bf1eb..8995072 100644
--- a/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py
+++ b/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py
@@ -35,19 +35,19 @@
 
         # Now launch the process, and do not stop at entry point.
         rc = lldb.SBError()
-        self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
+        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, rc)
 
-        if not rc.Success() or not self.process:
+        if not rc.Success() or not process:
             self.fail("SBTarget.LaunchProcess() failed")
 
         import lldbutil
-        if self.process.GetState() != lldb.eStateStopped:
+        if process.GetState() != lldb.eStateStopped:
             self.fail("Process should be in the 'stopped' state, "
                       "instead the actual state is: '%s'" %
-                      lldbutil.state_type_to_str(self.process.GetState()))
+                      lldbutil.state_type_to_str(process.GetState()))
 
         if self.TraceOn():
-            lldbutil.print_stacktraces(self.process)
+            lldbutil.print_stacktraces(process)
 
 
 if __name__ == '__main__':
diff --git a/lldb/test/python_api/process/TestProcessAPI.py b/lldb/test/python_api/process/TestProcessAPI.py
index 4e014cc..a9bdec5 100644
--- a/lldb/test/python_api/process/TestProcessAPI.py
+++ b/lldb/test/python_api/process/TestProcessAPI.py
@@ -76,9 +76,9 @@
 
         # Launch the process, and do not stop at the entry point.
         error = lldb.SBError()
-        self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
 
-        thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
         frame = thread.GetFrameAtIndex(0)
 
@@ -95,7 +95,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!
-        content = self.process.ReadMemory(location, 1, error)
+        content = process.ReadMemory(location, 1, error)
         if not error.Success():
             self.fail("SBProcess.ReadMemory() failed")
         if self.TraceOn():
@@ -118,9 +118,9 @@
 
         # Launch the process, and do not stop at the entry point.
         error = lldb.SBError()
-        self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
 
-        thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
         frame = thread.GetFrameAtIndex(0)
 
@@ -139,14 +139,14 @@
         # 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.
-        result = self.process.WriteMemory(location, 'a', error)
+        result = process.WriteMemory(location, 'a', error)
         if not error.Success() or result != 1:
             self.fail("SBProcess.WriteMemory() failed")
 
         # Read from the memory location.  This time it should be 'a'.
         # 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!
-        content = self.process.ReadMemory(location, 1, error)
+        content = process.ReadMemory(location, 1, error)
         if not error.Success():
             self.fail("SBProcess.ReadMemory() failed")
         if self.TraceOn():
@@ -169,9 +169,9 @@
 
         # Launch the process, and do not stop at the entry point.
         error = lldb.SBError()
-        self.process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.Launch (self.dbg.GetListener(), None, None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
 
-        thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
         frame = thread.GetFrameAtIndex(0)
 
@@ -192,7 +192,7 @@
         byteSize = val.GetByteSize()
         bytes = int_to_bytearray(256, byteSize)
 
-        byteOrder = self.process.GetByteOrder()
+        byteOrder = process.GetByteOrder()
         if byteOrder == lldb.eByteOrderBig:
             bytes.reverse()
         elif byteOrder == lldb.eByteOrderLittle:
@@ -207,7 +207,7 @@
 
         # Now use WriteMemory() API to write 256 into the global variable.
         new_value = str(bytes)
-        result = self.process.WriteMemory(location, new_value, error)
+        result = process.WriteMemory(location, new_value, error)
         if not error.Success() or result != byteSize:
             self.fail("SBProcess.WriteMemory() failed")
 
@@ -225,7 +225,7 @@
             startstr = '256')
 
         # Now read the memory content.  The bytearray should have (byte)1 as the second element.
-        content = self.process.ReadMemory(location, byteSize, error)
+        content = process.ReadMemory(location, byteSize, error)
         if not error.Success():
             self.fail("SBProcess.ReadMemory() failed")
 
diff --git a/lldb/test/python_api/symbol-context/TestSymbolContext.py b/lldb/test/python_api/symbol-context/TestSymbolContext.py
index 88386bc..b601920 100644
--- a/lldb/test/python_api/symbol-context/TestSymbolContext.py
+++ b/lldb/test/python_api/symbol-context/TestSymbolContext.py
@@ -47,14 +47,12 @@
                         VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
-        self.process = target.LaunchSimple(None, None, os.getcwd())
-
-        self.process = target.GetProcess()
-        self.assertTrue(self.process, PROCESS_IS_VALID)
+        process = target.LaunchSimple(None, None, os.getcwd())
+        self.assertTrue(process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line.
         from lldbutil import get_stopped_thread
-        thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
         frame0 = thread.GetFrameAtIndex(0)
         self.assertTrue(frame0.GetLineEntry().GetLine() == self.line)
diff --git a/lldb/test/python_api/target/TestTargetAPI.py b/lldb/test/python_api/target/TestTargetAPI.py
index 0de4563..b6fab12 100644
--- a/lldb/test/python_api/target/TestTargetAPI.py
+++ b/lldb/test/python_api/target/TestTargetAPI.py
@@ -99,8 +99,7 @@
         breakpoint = target.BreakpointCreateByLocation('main.c', line)
 
         # Now launch the process, do not stop at entry point, and redirect stdout to "stdout.txt" file.
-        # The inferior should run to completion after "process.Continue()" call, so there's no need
-        # to assign to self.process to have the inferior kiiled during test teardown.
+        # The inferior should run to completion after "process.Continue()" call.
         error = lldb.SBError()
         process = target.Launch (self.dbg.GetListener(), None, None, None, "stdout.txt", None, None, 0, False, error)
         process.Continue()
@@ -146,14 +145,12 @@
                         VALID_BREAKPOINT)
 
         # Now launch the process, and do not stop at entry point.
-        self.process = target.LaunchSimple(None, None, os.getcwd())
-
-        self.process = target.GetProcess()
-        self.assertTrue(self.process, PROCESS_IS_VALID)
+        process = target.LaunchSimple(None, None, os.getcwd())
+        self.assertTrue(process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line1.
-        self.assertTrue(self.process.GetState() == lldb.eStateStopped)
-        thread = lldbutil.get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        self.assertTrue(process.GetState() == lldb.eStateStopped)
+        thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
         #self.runCmd("process status")
         frame0 = thread.GetFrameAtIndex(0)
@@ -163,9 +160,9 @@
         address1 = lineEntry.GetStartAddress()
 
         # Continue the inferior, the breakpoint 2 should be hit.
-        self.process.Continue()
-        self.assertTrue(self.process.GetState() == lldb.eStateStopped)
-        thread = lldbutil.get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        process.Continue()
+        self.assertTrue(process.GetState() == lldb.eStateStopped)
+        thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
         #self.runCmd("process status")
         frame0 = thread.GetFrameAtIndex(0)
diff --git a/lldb/test/python_api/thread/TestThreadAPI.py b/lldb/test/python_api/thread/TestThreadAPI.py
index 103e1c1..58e157f 100644
--- a/lldb/test/python_api/thread/TestThreadAPI.py
+++ b/lldb/test/python_api/thread/TestThreadAPI.py
@@ -116,15 +116,15 @@
         self.runCmd("breakpoint list")
 
         # Launch the process, and do not stop at the entry point.
-        self.process = target.LaunchSimple(None, None, os.getcwd())
+        process = target.LaunchSimple(None, None, os.getcwd())
 
-        thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
         self.runCmd("process status")
 
         proc_of_thread = thread.GetProcess()
         #print "proc_of_thread:", proc_of_thread
-        self.assertTrue(proc_of_thread.GetProcessID() == self.process.GetProcessID())
+        self.assertTrue(proc_of_thread.GetProcessID() == process.GetProcessID())
 
     def get_stop_description(self):
         """Test Python SBThread.GetStopDescription() API."""
@@ -138,9 +138,9 @@
         #self.runCmd("breakpoint list")
 
         # Launch the process, and do not stop at the entry point.
-        self.process = target.LaunchSimple(None, None, os.getcwd())
+        process = target.LaunchSimple(None, None, os.getcwd())
 
-        thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
         #self.runCmd("process status")
 
@@ -163,10 +163,10 @@
         self.runCmd("breakpoint list")
 
         # Launch the process, and do not stop at the entry point.
-        self.process = target.LaunchSimple(None, None, os.getcwd())
+        process = target.LaunchSimple(None, None, os.getcwd())
 
         while True:
-            thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+            thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
             self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint")
             caller_symbol = get_caller_symbol(thread)
             #print "caller symbol of malloc:", caller_symbol
@@ -176,7 +176,7 @@
                 break
             #self.runCmd("thread backtrace")
             #self.runCmd("process status")           
-            self.process.Continue()
+            process.Continue()
 
         thread.StepOut()
         self.runCmd("thread backtrace")
@@ -196,13 +196,13 @@
         self.runCmd("breakpoint list")
 
         # Launch the process, and do not stop at the entry point.
-        self.process = target.LaunchSimple(None, None, os.getcwd())
+        process = target.LaunchSimple(None, None, os.getcwd())
 
-        self.assertTrue(self.process, PROCESS_IS_VALID)
+        self.assertTrue(process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line2.
-        self.assertTrue(self.process.GetState() == lldb.eStateStopped)
-        thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        self.assertTrue(process.GetState() == lldb.eStateStopped)
+        thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
         self.runCmd("thread backtrace")
         frame0 = thread.GetFrameAtIndex(0)
@@ -237,13 +237,13 @@
         self.runCmd("breakpoint list")
 
         # Launch the process, and do not stop at the entry point.
-        self.process = target.LaunchSimple(None, None, os.getcwd())
+        process = target.LaunchSimple(None, None, os.getcwd())
 
-        self.assertTrue(self.process, PROCESS_IS_VALID)
+        self.assertTrue(process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line2.
-        self.assertTrue(self.process.GetState() == lldb.eStateStopped)
-        thread = get_stopped_thread(self.process, lldb.eStopReasonBreakpoint)
+        self.assertTrue(process.GetState() == lldb.eStateStopped)
+        thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
         self.runCmd("thread backtrace")
         frame0 = thread.GetFrameAtIndex(0)