[Lldb-commits] [lldb] r133097 - in /lldb/trunk/test: ./ array_types/ bitfields/ breakpoint_conditions/ breakpoint_ignore_count/ class_static/ class_types/ conditional_break/ cpp/dynamic-value/ expression_command/test/ foundation/ hello_world/ inferior-crashing/ objc-dynamic-value/ objc-stepping/ python_api/event/ python_api/frame/ python_api/function_symbol/ python_api/interpreter/ python_api/lldbutil/frame/ python_api/lldbutil/iter/ python_api/lldbutil/process/ python_api/process/ python_api/symbol-context/ python_api...

Johnny Chen johnny.chen at apple.com
Wed Jun 15 15:14:12 PDT 2011


Author: johnny
Date: Wed Jun 15 17:14:12 2011
New Revision: 133097

URL: http://llvm.org/viewvc/llvm-project?rev=133097&view=rev
Log:
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.

Modified:
    lldb/trunk/test/array_types/TestArrayTypes.py
    lldb/trunk/test/bitfields/TestBitfields.py
    lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py
    lldb/trunk/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
    lldb/trunk/test/class_static/TestStaticVariables.py
    lldb/trunk/test/class_types/TestClassTypes.py
    lldb/trunk/test/conditional_break/TestConditionalBreak.py
    lldb/trunk/test/cpp/dynamic-value/TestDynamicValue.py
    lldb/trunk/test/expression_command/test/TestExprs.py
    lldb/trunk/test/foundation/TestObjCMethods.py
    lldb/trunk/test/hello_world/TestHelloWorld.py
    lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py
    lldb/trunk/test/lldbutil.py
    lldb/trunk/test/objc-dynamic-value/TestObjCDynamicValue.py
    lldb/trunk/test/objc-stepping/TestObjCStepping.py
    lldb/trunk/test/python_api/event/TestEvents.py
    lldb/trunk/test/python_api/frame/TestFrames.py
    lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py
    lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py
    lldb/trunk/test/python_api/interpreter/TestCommandInterpreterAPI.py
    lldb/trunk/test/python_api/lldbutil/frame/TestFrameUtils.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/python_api/symbol-context/TestSymbolContext.py
    lldb/trunk/test/python_api/target/TestTargetAPI.py
    lldb/trunk/test/python_api/thread/TestThreadAPI.py

Modified: lldb/trunk/test/array_types/TestArrayTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/array_types/TestArrayTypes.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/array_types/TestArrayTypes.py (original)
+++ lldb/trunk/test/array_types/TestArrayTypes.py Wed Jun 15 17:14:12 2011
@@ -110,19 +110,17 @@
             substrs = ["resolved = 1"])
 
         # 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)
 
         # Sanity check the print representation of process.
-        proc = repr(self.process)
+        proc = repr(process)
         self.expect(proc, msg="Process looks good", exe=False,
             substrs = ["state = stopped",
                        "executable = a.out"])
 
         # The stop reason of the thread should be breakpoint.
-        thread = self.process.GetThreadAtIndex(0)
+        thread = process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
             from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %

Modified: lldb/trunk/test/bitfields/TestBitfields.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/bitfields/TestBitfields.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/bitfields/TestBitfields.py (original)
+++ lldb/trunk/test/bitfields/TestBitfields.py Wed Jun 15 17:14:12 2011
@@ -94,8 +94,8 @@
         breakpoint = target.BreakpointCreateByLocation("main.c", self.line)
         self.assertTrue(breakpoint, VALID_BREAKPOINT)
 
-        self.process = target.LaunchSimple(None, None, os.getcwd())
-        self.assertTrue(self.process, PROCESS_IS_VALID)
+        process = target.LaunchSimple(None, None, os.getcwd())
+        self.assertTrue(process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
         thread = target.GetProcess().GetThreadAtIndex(0)

Modified: lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py (original)
+++ lldb/trunk/test/breakpoint_conditions/TestBreakpointConditions.py Wed Jun 15 17:14:12 2011
@@ -139,14 +139,12 @@
             startstr = 'val == 3')
 
         # 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 and the break condition should hold.
         from lldbutil import get_stopped_thread
-        thread = get_stopped_thread(self.process, lldb.eStopReasonPlanComplete)
+        thread = get_stopped_thread(process, lldb.eStopReasonPlanComplete)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
         frame0 = thread.GetFrameAtIndex(0)
         var = frame0.FindValue('val', lldb.eValueTypeVariableArgument)
@@ -156,7 +154,7 @@
         # The hit count for the breakpoint should be 3.
         self.assertTrue(breakpoint.GetHitCount() == 3)
 
-        self.process.Continue()
+        process.Continue()
 
         
 if __name__ == '__main__':

Modified: lldb/trunk/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py (original)
+++ lldb/trunk/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py Wed Jun 15 17:14:12 2011
@@ -101,16 +101,14 @@
                         "SetIgnoreCount() works correctly")
 
         # 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 main.c:37, frame#1 should be on main.c:25, and
         # frame#2 should be on main.c:48.
-        #lldbutil.print_stacktraces(self.process)
+        #lldbutil.print_stacktraces(process)
         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)
         frame1 = thread.GetFrameAtIndex(1)
@@ -123,7 +121,7 @@
         # The hit count for the breakpoint should be 3.
         self.assertTrue(breakpoint.GetHitCount() == 3)
 
-        self.process.Continue()
+        process.Continue()
 
         
 if __name__ == '__main__':

Modified: lldb/trunk/test/class_static/TestStaticVariables.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/class_static/TestStaticVariables.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/class_static/TestStaticVariables.py (original)
+++ lldb/trunk/test/class_static/TestStaticVariables.py Wed Jun 15 17:14:12 2011
@@ -80,13 +80,11 @@
         self.assertTrue(breakpoint, 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)
 
         # The stop reason of the thread should be breakpoint.
-        thread = self.process.GetThreadAtIndex(0)
+        thread = process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
             from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %

Modified: lldb/trunk/test/class_types/TestClassTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/class_types/TestClassTypes.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/class_types/TestClassTypes.py (original)
+++ lldb/trunk/test/class_types/TestClassTypes.py Wed Jun 15 17:14:12 2011
@@ -120,18 +120,18 @@
 
         # Now launch the process, and do not stop at 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)
 
-        if not error.Success() or not self.process:
+        if not error.Success() or not process:
             self.fail("SBTarget.Launch() failed")
 
-        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()))
 
         # The stop reason of the thread should be breakpoint.
-        thread = self.process.GetThreadAtIndex(0)
+        thread = process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
             from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
@@ -149,7 +149,7 @@
         # We should be stopped on the breakpoint with a hit count of 1.
         self.assertTrue(breakpoint.GetHitCount() == 1, BREAKPOINT_HIT_ONCE)
 
-        self.process.Continue()
+        process.Continue()
 
     def class_types_expr_parser(self):
         """Test 'frame variable this' and 'expr this' when stopped inside a constructor."""

Modified: lldb/trunk/test/conditional_break/TestConditionalBreak.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/conditional_break/TestConditionalBreak.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/conditional_break/TestConditionalBreak.py (original)
+++ lldb/trunk/test/conditional_break/TestConditionalBreak.py Wed Jun 15 17:14:12 2011
@@ -53,12 +53,12 @@
 
         # Now launch the process, and do not stop at 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)
 
-        self.assertTrue(error.Success() and self.process, PROCESS_IS_VALID)
+        self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
-        self.assertTrue(self.process.GetState() == lldb.eStateStopped,
+        self.assertTrue(process.GetState() == lldb.eStateStopped,
                         STOPPED_DUE_TO_BREAKPOINT)
 
         # Find the line number where a's parent frame function is c.
@@ -72,7 +72,7 @@
         # The 10 in range(10) is just an arbitrary number, which means we would
         # like to try for at most 10 times.
         for j in range(10):
-            thread = self.process.GetThreadAtIndex(0)
+            thread = process.GetThreadAtIndex(0)
             
             if thread.GetNumFrames() >= 2:
                 frame0 = thread.GetFrameAtIndex(0)
@@ -94,7 +94,7 @@
                     self.assertTrue(val.GetValue(frame1) == "3", "'val' has a value of 3")
                     break
 
-            self.process.Continue()
+            process.Continue()
 
     def simulate_conditional_break_by_user(self):
         """Simulate a user using lldb commands to break on c() if called from a()."""

Modified: lldb/trunk/test/cpp/dynamic-value/TestDynamicValue.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/cpp/dynamic-value/TestDynamicValue.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/cpp/dynamic-value/TestDynamicValue.py (original)
+++ lldb/trunk/test/cpp/dynamic-value/TestDynamicValue.py Wed Jun 15 17:14:12 2011
@@ -114,12 +114,12 @@
                         VALID_BREAKPOINT)
 
         # Now 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.GetState() == lldb.eStateStopped,
+        self.assertTrue(process.GetState() == lldb.eStateStopped,
                         PROCESS_STOPPED)
 
-        threads = lldbutil.get_threads_stopped_at_breakpoint (self.process, first_call_bpt)
+        threads = lldbutil.get_threads_stopped_at_breakpoint (process, first_call_bpt)
         self.assertTrue (len(threads) == 1)
         thread = threads[0]
 
@@ -141,7 +141,7 @@
 
         # Okay now run to doSomething:
 
-        threads = lldbutil.continue_to_breakpoint (self.process, do_something_bpt)
+        threads = lldbutil.continue_to_breakpoint (process, do_something_bpt)
         self.assertTrue (len(threads) == 1)
         thread = threads[0]
 
@@ -194,7 +194,7 @@
 
         # Okay, now continue again, and when we hit the second breakpoint in main
 
-        threads = lldbutil.continue_to_breakpoint (self.process, second_call_bpt)
+        threads = lldbutil.continue_to_breakpoint (process, second_call_bpt)
         self.assertTrue (len(threads) == 1)
         thread = threads[0]
 
@@ -206,7 +206,7 @@
         # Finally continue to doSomething again, and make sure we get the right value for anotherA,
         # which this time around is just an "A".
 
-        threads = lldbutil.continue_to_breakpoint (self.process, do_something_bpt)
+        threads = lldbutil.continue_to_breakpoint (process, do_something_bpt)
         self.assertTrue(len(threads) == 1)
         thread = threads[0]
 

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=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/test/TestExprs.py (original)
+++ lldb/trunk/test/expression_command/test/TestExprs.py Wed Jun 15 17:14:12 2011
@@ -101,18 +101,18 @@
         # 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()
-        self.process = target.Launch(self.dbg.GetListener(), ['X', 'Y', 'Z'], None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
+        process = target.Launch(self.dbg.GetListener(), ['X', 'Y', 'Z'], None, os.ctermid(), os.ctermid(), os.ctermid(), None, 0, False, error)
 
-        if not error.Success() or not self.process:
+        if not error.Success() or not process:
             self.fail("SBTarget.LaunchProcess() failed")
 
-        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()))
 
         # The stop reason of the thread should be breakpoint.
-        thread = self.process.GetThreadAtIndex(0)
+        thread = process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
             from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %

Modified: lldb/trunk/test/foundation/TestObjCMethods.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/foundation/TestObjCMethods.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/foundation/TestObjCMethods.py (original)
+++ lldb/trunk/test/foundation/TestObjCMethods.py Wed Jun 15 17:14:12 2011
@@ -213,12 +213,12 @@
 
         # Now launch the process, and do not stop at 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)
 
-        self.assertTrue(self.process, PROCESS_IS_VALID)
+        self.assertTrue(process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
-        thread = self.process.GetThreadAtIndex(0)
+        thread = process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
             from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %

Modified: lldb/trunk/test/hello_world/TestHelloWorld.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/hello_world/TestHelloWorld.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/hello_world/TestHelloWorld.py (original)
+++ lldb/trunk/test/hello_world/TestHelloWorld.py Wed Jun 15 17:14:12 2011
@@ -62,10 +62,10 @@
             # On the other hand, the following line of code are more reliable.
             self.runCmd("run")
 
-        self.process = target.GetProcess()
-        self.assertTrue(self.process, PROCESS_IS_VALID)
+        process = target.GetProcess()
+        self.assertTrue(process, PROCESS_IS_VALID)
 
-        thread = self.process.GetThreadAtIndex(0)
+        thread = process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
             from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %

Modified: lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py (original)
+++ lldb/trunk/test/inferior-crashing/TestInferiorCrashing.py Wed Jun 15 17:14:12 2011
@@ -58,15 +58,15 @@
 
         # Now launch the process, and do not stop at entry point.
         # Both argv and envp are null.
-        self.process = target.LaunchSimple(None, None, os.getcwd())
+        process = target.LaunchSimple(None, None, os.getcwd())
 
         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()))
 
-        thread = lldbutil.get_stopped_thread(self.process, lldb.eStopReasonException)
+        thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonException)
         if not thread:
             self.fail("Fail to stop the thread upon bad access exception")
 

Modified: lldb/trunk/test/lldbutil.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbutil.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/lldbutil.py (original)
+++ lldb/trunk/test/lldbutil.py Wed Jun 15 17:14:12 2011
@@ -230,7 +230,7 @@
 
     ...
         from lldbutil import get_stopped_thread
-        thread = get_stopped_thread(self.process, lldb.eStopReasonPlanComplete)
+        thread = get_stopped_thread(process, lldb.eStopReasonPlanComplete)
         self.assertTrue(thread != None, "There should be a thread stopped due to breakpoint condition")
     ...
 
@@ -238,7 +238,7 @@
 
     ...
         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")
     ...
 

Modified: lldb/trunk/test/objc-dynamic-value/TestObjCDynamicValue.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/objc-dynamic-value/TestObjCDynamicValue.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/objc-dynamic-value/TestObjCDynamicValue.py (original)
+++ lldb/trunk/test/objc-dynamic-value/TestObjCDynamicValue.py Wed Jun 15 17:14:12 2011
@@ -67,12 +67,12 @@
                         VALID_BREAKPOINT)
 
         # Now 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.GetState() == lldb.eStateStopped,
+        self.assertTrue(process.GetState() == lldb.eStateStopped,
                         PROCESS_STOPPED)
 
-        threads = lldbutil.get_threads_stopped_at_breakpoint (self.process, main_before_setProperty_bkpt)
+        threads = lldbutil.get_threads_stopped_at_breakpoint (process, main_before_setProperty_bkpt)
         self.assertTrue (len(threads) == 1)
         thread = threads[0]
 
@@ -99,7 +99,7 @@
 
         thread.StepInto()
 
-        threads = lldbutil.get_stopped_threads (self.process, lldb.eStopReasonPlanComplete)
+        threads = lldbutil.get_stopped_threads (process, lldb.eStopReasonPlanComplete)
         self.assertTrue (len(threads) == 1)
         line_entry = threads[0].GetFrameAtIndex(0).GetLineEntry()
         self.assertTrue (line_entry.GetLine() == self.set_property_line)
@@ -107,7 +107,7 @@
 
         # Okay, back to the main business.  Continue to the handle_SourceBase and make sure we get the correct dynamic value.
 
-        threads = lldbutil.continue_to_breakpoint (self.process, handle_SourceBase_bkpt)
+        threads = lldbutil.continue_to_breakpoint (process, handle_SourceBase_bkpt)
         self.assertTrue (len(threads) == 1)
         thread = threads[0]
 
@@ -142,7 +142,7 @@
         # This one looks exactly the same, but in fact this is an "un-KVO'ed" version of SourceBase, so
         # its isa pointer points to SourceBase not NSKVOSourceBase or whatever...
 
-        threads = lldbutil.continue_to_breakpoint (self.process, handle_SourceBase_bkpt)
+        threads = lldbutil.continue_to_breakpoint (process, handle_SourceBase_bkpt)
         self.assertTrue (len(threads) == 1)
         thread = threads[0]
 

Modified: lldb/trunk/test/objc-stepping/TestObjCStepping.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/objc-stepping/TestObjCStepping.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/objc-stepping/TestObjCStepping.py (original)
+++ lldb/trunk/test/objc-stepping/TestObjCStepping.py Wed Jun 15 17:14:12 2011
@@ -64,12 +64,12 @@
         self.assertTrue(break_returnStruct_call_super, 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())
 
-        self.assertTrue(self.process, PROCESS_IS_VALID)
+        self.assertTrue(process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
-        thread = self.process.GetThreadAtIndex(0)
+        thread = process.GetThreadAtIndex(0)
         if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
             from lldbutil import stop_reason_to_str
             self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
@@ -100,7 +100,7 @@
         line_number = thread.GetFrameAtIndex(0).GetLineEntry().GetLine()
         self.assertTrue (line_number == self.sourceBase_randomMethod_line, "Stepped through super into SourceBase randomMethod.")
 
-        self.process.Continue()
+        process.Continue()
         line_number = thread.GetFrameAtIndex(0).GetLineEntry().GetLine()
         self.assertTrue (line_number == self.line2, "Continued to second breakpoint in main.")
 
@@ -109,7 +109,7 @@
         line_number = thread.GetFrameAtIndex(0).GetLineEntry().GetLine()
         self.assertTrue (line_number == self.source_returnsStruct_start_line, "Stepped into Source returnsStruct.")
 
-        self.process.Continue()
+        process.Continue()
         line_number = thread.GetFrameAtIndex(0).GetLineEntry().GetLine()
         self.assertTrue (line_number == self.source_returnsStruct_call_line, "Stepped to the call super line in Source returnsStruct.")
 
@@ -120,7 +120,7 @@
         # Cool now continue to get past the call that intializes the Observer, and then do our steps in again to see that 
         # we can find our way when we're stepping through a KVO swizzled object.
 
-        self.process.Continue()
+        process.Continue()
         frame = thread.GetFrameAtIndex(0)
         line_number = frame.GetLineEntry().GetLine()
         self.assertTrue (line_number == self.line3, "Continued to third breakpoint in main, our object should now be swizzled.")
@@ -140,7 +140,7 @@
         line_number = thread.GetFrameAtIndex(0).GetLineEntry().GetLine()
         self.assertTrue (line_number == self.sourceBase_randomMethod_line, "Stepped through super into SourceBase randomMethod in swizzled object.")
 
-        self.process.Continue()
+        process.Continue()
         line_number = thread.GetFrameAtIndex(0).GetLineEntry().GetLine()
         self.assertTrue (line_number == self.line4, "Continued to fourth breakpoint in main.")
 
@@ -149,7 +149,7 @@
         line_number = thread.GetFrameAtIndex(0).GetLineEntry().GetLine()
         self.assertTrue (line_number == self.source_returnsStruct_start_line, "Stepped into Source returnsStruct in swizzled object.")
 
-        self.process.Continue()
+        process.Continue()
         line_number = thread.GetFrameAtIndex(0).GetLineEntry().GetLine()
         self.assertTrue (line_number == self.source_returnsStruct_call_line, "Stepped to the call super line in Source returnsStruct - second time.")
 

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=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/python_api/event/TestEvents.py (original)
+++ lldb/trunk/test/python_api/event/TestEvents.py Wed Jun 15 17:14:12 2011
@@ -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.

Modified: lldb/trunk/test/python_api/frame/TestFrames.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/frame/TestFrames.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/python_api/frame/TestFrames.py (original)
+++ lldb/trunk/test/python_api/frame/TestFrames.py Wed Jun 15 17:14:12 2011
@@ -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()

Modified: lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py (original)
+++ lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py Wed Jun 15 17:14:12 2011
@@ -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()

Modified: lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py (original)
+++ lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py Wed Jun 15 17:14:12 2011
@@ -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()

Modified: lldb/trunk/test/python_api/interpreter/TestCommandInterpreterAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/interpreter/TestCommandInterpreterAPI.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/python_api/interpreter/TestCommandInterpreterAPI.py (original)
+++ lldb/trunk/test/python_api/interpreter/TestCommandInterpreterAPI.py Wed Jun 15 17:14:12 2011
@@ -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__':

Modified: lldb/trunk/test/python_api/lldbutil/frame/TestFrameUtils.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/lldbutil/frame/TestFrameUtils.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/python_api/lldbutil/frame/TestFrameUtils.py (original)
+++ lldb/trunk/test/python_api/lldbutil/frame/TestFrameUtils.py Wed Jun 15 17:14:12 2011
@@ -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)

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=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/python_api/lldbutil/iter/TestLLDBIterator.py (original)
+++ lldb/trunk/test/python_api/lldbutil/iter/TestLLDBIterator.py Wed Jun 15 17:14:12 2011
@@ -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()

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=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py (original)
+++ lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py Wed Jun 15 17:14:12 2011
@@ -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.

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=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py (original)
+++ lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py Wed Jun 15 17:14:12 2011
@@ -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__':

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=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/python_api/process/TestProcessAPI.py (original)
+++ lldb/trunk/test/python_api/process/TestProcessAPI.py Wed Jun 15 17:14:12 2011
@@ -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")
 

Modified: lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py (original)
+++ lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py Wed Jun 15 17:14:12 2011
@@ -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)

Modified: lldb/trunk/test/python_api/target/TestTargetAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/target/TestTargetAPI.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/python_api/target/TestTargetAPI.py (original)
+++ lldb/trunk/test/python_api/target/TestTargetAPI.py Wed Jun 15 17:14:12 2011
@@ -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)

Modified: lldb/trunk/test/python_api/thread/TestThreadAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/thread/TestThreadAPI.py?rev=133097&r1=133096&r2=133097&view=diff
==============================================================================
--- lldb/trunk/test/python_api/thread/TestThreadAPI.py (original)
+++ lldb/trunk/test/python_api/thread/TestThreadAPI.py Wed Jun 15 17:14:12 2011
@@ -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)





More information about the lldb-commits mailing list