diff options
Diffstat (limited to 'lldb')
28 files changed, 149 insertions, 174 deletions
diff --git a/lldb/test/array_types/TestArrayTypes.py b/lldb/test/array_types/TestArrayTypes.py index bf1ae12073b..7d5eea1d3ce 100644 --- a/lldb/test/array_types/TestArrayTypes.py +++ b/lldb/test/array_types/TestArrayTypes.py @@ -110,19 +110,17 @@ class ArrayTypesTestCase(TestBase): 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 % diff --git a/lldb/test/bitfields/TestBitfields.py b/lldb/test/bitfields/TestBitfields.py index e192654153c..bf8f541bc25 100644 --- a/lldb/test/bitfields/TestBitfields.py +++ b/lldb/test/bitfields/TestBitfields.py @@ -94,8 +94,8 @@ class BitfieldsTestCase(TestBase): 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) diff --git a/lldb/test/breakpoint_conditions/TestBreakpointConditions.py b/lldb/test/breakpoint_conditions/TestBreakpointConditions.py index ea4186e6dec..3c9d06c54cd 100644 --- a/lldb/test/breakpoint_conditions/TestBreakpointConditions.py +++ b/lldb/test/breakpoint_conditions/TestBreakpointConditions.py @@ -139,14 +139,12 @@ class BreakpointConditionsTestCase(TestBase): 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 @@ class BreakpointConditionsTestCase(TestBase): # The hit count for the breakpoint should be 3. self.assertTrue(breakpoint.GetHitCount() == 3) - self.process.Continue() + process.Continue() if __name__ == '__main__': diff --git a/lldb/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py b/lldb/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py index f36db669e0a..a4bedcb6397 100644 --- a/lldb/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py +++ b/lldb/test/breakpoint_ignore_count/TestBreakpointIgnoreCount.py @@ -101,16 +101,14 @@ class BreakpointIgnoreCountTestCase(TestBase): "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 @@ class BreakpointIgnoreCountTestCase(TestBase): # The hit count for the breakpoint should be 3. self.assertTrue(breakpoint.GetHitCount() == 3) - self.process.Continue() + process.Continue() if __name__ == '__main__': diff --git a/lldb/test/class_static/TestStaticVariables.py b/lldb/test/class_static/TestStaticVariables.py index e1aa9de8f56..b23eb675aad 100644 --- a/lldb/test/class_static/TestStaticVariables.py +++ b/lldb/test/class_static/TestStaticVariables.py @@ -80,13 +80,11 @@ class StaticVariableTestCase(TestBase): 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 % diff --git a/lldb/test/class_types/TestClassTypes.py b/lldb/test/class_types/TestClassTypes.py index e847bd6fa53..358c32d6293 100644 --- a/lldb/test/class_types/TestClassTypes.py +++ b/lldb/test/class_types/TestClassTypes.py @@ -120,18 +120,18 @@ class ClassTypesTestCase(TestBase): # 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 @@ class ClassTypesTestCase(TestBase): # 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.""" diff --git a/lldb/test/conditional_break/TestConditionalBreak.py b/lldb/test/conditional_break/TestConditionalBreak.py index ea9df4e245e..e65976346ae 100644 --- a/lldb/test/conditional_break/TestConditionalBreak.py +++ b/lldb/test/conditional_break/TestConditionalBreak.py @@ -53,12 +53,12 @@ class ConditionalBreakTestCase(TestBase): # 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 @@ class ConditionalBreakTestCase(TestBase): # 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 @@ class ConditionalBreakTestCase(TestBase): 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().""" diff --git a/lldb/test/cpp/dynamic-value/TestDynamicValue.py b/lldb/test/cpp/dynamic-value/TestDynamicValue.py index c4ee6fd0b88..9cf9e0cd37d 100644 --- a/lldb/test/cpp/dynamic-value/TestDynamicValue.py +++ b/lldb/test/cpp/dynamic-value/TestDynamicValue.py @@ -114,12 +114,12 @@ class DynamicValueTestCase(TestBase): 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 @@ class DynamicValueTestCase(TestBase): # 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 @@ class DynamicValueTestCase(TestBase): # 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 @@ class DynamicValueTestCase(TestBase): # 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] diff --git a/lldb/test/expression_command/test/TestExprs.py b/lldb/test/expression_command/test/TestExprs.py index e2ef4d9c003..0d9d1883158 100644 --- a/lldb/test/expression_command/test/TestExprs.py +++ b/lldb/test/expression_command/test/TestExprs.py @@ -101,18 +101,18 @@ class BasicExprCommandsTestCase(TestBase): # 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 % diff --git a/lldb/test/foundation/TestObjCMethods.py b/lldb/test/foundation/TestObjCMethods.py index a12370cf274..be43d41f940 100644 --- a/lldb/test/foundation/TestObjCMethods.py +++ b/lldb/test/foundation/TestObjCMethods.py @@ -213,12 +213,12 @@ class FoundationTestCase(TestBase): # 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 % diff --git a/lldb/test/hello_world/TestHelloWorld.py b/lldb/test/hello_world/TestHelloWorld.py index 47efd9224c1..f5ba6923dab 100644 --- a/lldb/test/hello_world/TestHelloWorld.py +++ b/lldb/test/hello_world/TestHelloWorld.py @@ -62,10 +62,10 @@ class HelloWorldTestCase(TestBase): # 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 % diff --git a/lldb/test/inferior-crashing/TestInferiorCrashing.py b/lldb/test/inferior-crashing/TestInferiorCrashing.py index 5c3188c07e7..d4c46cae8d0 100644 --- a/lldb/test/inferior-crashing/TestInferiorCrashing.py +++ b/lldb/test/inferior-crashing/TestInferiorCrashing.py @@ -58,15 +58,15 @@ class CrashingInferiorTestCase(TestBase): # 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") diff --git a/lldb/test/lldbutil.py b/lldb/test/lldbutil.py index 4a299ea6903..94f6afd9357 100644 --- a/lldb/test/lldbutil.py +++ b/lldb/test/lldbutil.py @@ -230,7 +230,7 @@ def get_stopped_thread(process, reason): ... 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 @@ def get_stopped_thread(process, reason): ... 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") ... diff --git a/lldb/test/objc-dynamic-value/TestObjCDynamicValue.py b/lldb/test/objc-dynamic-value/TestObjCDynamicValue.py index 5e96b4e1ba3..37d9a06e818 100644 --- a/lldb/test/objc-dynamic-value/TestObjCDynamicValue.py +++ b/lldb/test/objc-dynamic-value/TestObjCDynamicValue.py @@ -67,12 +67,12 @@ class ObjCDynamicValueTestCase(TestBase): 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 @@ class ObjCDynamicValueTestCase(TestBase): 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 @@ class ObjCDynamicValueTestCase(TestBase): # 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 @@ class ObjCDynamicValueTestCase(TestBase): # 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] diff --git a/lldb/test/objc-stepping/TestObjCStepping.py b/lldb/test/objc-stepping/TestObjCStepping.py index 80b6b9f04c9..27135b0589c 100644 --- a/lldb/test/objc-stepping/TestObjCStepping.py +++ b/lldb/test/objc-stepping/TestObjCStepping.py @@ -64,12 +64,12 @@ class TestObjCStepping(TestBase): 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 @@ class TestObjCStepping(TestBase): 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 @@ class TestObjCStepping(TestBase): 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 @@ class TestObjCStepping(TestBase): # 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 @@ class TestObjCStepping(TestBase): 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 @@ class TestObjCStepping(TestBase): 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.") diff --git a/lldb/test/python_api/event/TestEvents.py b/lldb/test/python_api/event/TestEvents.py index 7b21df16dd0..64542036830 100644 --- a/lldb/test/python_api/event/TestEvents.py +++ b/lldb/test/python_api/event/TestEvents.py @@ -64,13 +64,11 @@ class EventAPITestCase(TestBase): # 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 @@ class EventAPITestCase(TestBase): # 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 @@ class EventAPITestCase(TestBase): 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 @@ class EventAPITestCase(TestBase): # 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 053da2453b6..e9b1ed199e8 100644 --- a/lldb/test/python_api/frame/TestFrames.py +++ b/lldb/test/python_api/frame/TestFrames.py @@ -41,9 +41,6 @@ class FrameAPITestCase(TestBase): 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 37a98d3bd5b..b3a8bbb215d 100644 --- a/lldb/test/python_api/function_symbol/TestDisasmAPI.py +++ b/lldb/test/python_api/function_symbol/TestDisasmAPI.py @@ -53,14 +53,12 @@ class DisasmAPITestCase(TestBase): 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 @@ class DisasmAPITestCase(TestBase): 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 913543781bf..f983ed645dc 100644 --- a/lldb/test/python_api/function_symbol/TestSymbolAPI.py +++ b/lldb/test/python_api/function_symbol/TestSymbolAPI.py @@ -53,14 +53,12 @@ class SymbolAPITestCase(TestBase): 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 @@ class SymbolAPITestCase(TestBase): 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 8620824005c..b310c1a917e 100644 --- a/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py +++ b/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py @@ -59,18 +59,17 @@ class CommandInterpreterAPICase(TestBase): 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 ff9723b4036..1fd337a78b1 100644 --- a/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py +++ b/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py @@ -33,15 +33,15 @@ class FrameUtilsTestCase(TestBase): 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 cc941578666..c9862fe9e05 100644 --- a/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py +++ b/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py @@ -45,9 +45,9 @@ class LLDBIteratorTestCase(TestBase): # 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 @@ class LLDBIteratorTestCase(TestBase): # 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 8e66d37d5f8..c4bbad63f0a 100644 --- a/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py +++ b/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py @@ -34,13 +34,13 @@ class RegistersIteratorTestCase(TestBase): # 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 43bf1eb6c71..899507279ec 100644 --- a/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py +++ b/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py @@ -35,19 +35,19 @@ class ThreadsStackTracesTestCase(TestBase): # 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 4e014cc3b3e..a9bdec546c8 100644 --- a/lldb/test/python_api/process/TestProcessAPI.py +++ b/lldb/test/python_api/process/TestProcessAPI.py @@ -76,9 +76,9 @@ class ProcessAPITestCase(TestBase): # 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 @@ 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! - 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 @@ class ProcessAPITestCase(TestBase): # 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 @@ 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. - 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 @@ class ProcessAPITestCase(TestBase): # 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 @@ class ProcessAPITestCase(TestBase): 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 @@ class ProcessAPITestCase(TestBase): # 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 @@ class ProcessAPITestCase(TestBase): 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 88386bcd45f..b601920e10f 100644 --- a/lldb/test/python_api/symbol-context/TestSymbolContext.py +++ b/lldb/test/python_api/symbol-context/TestSymbolContext.py @@ -47,14 +47,12 @@ class SymbolContextAPITestCase(TestBase): 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 0de456396c7..b6fab12a321 100644 --- a/lldb/test/python_api/target/TestTargetAPI.py +++ b/lldb/test/python_api/target/TestTargetAPI.py @@ -99,8 +99,7 @@ class TargetAPITestCase(TestBase): 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 @@ class TargetAPITestCase(TestBase): 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 @@ class TargetAPITestCase(TestBase): 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 103e1c14ce3..58e157f68e6 100644 --- a/lldb/test/python_api/thread/TestThreadAPI.py +++ b/lldb/test/python_api/thread/TestThreadAPI.py @@ -116,15 +116,15 @@ class ThreadAPITestCase(TestBase): 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 @@ class ThreadAPITestCase(TestBase): #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 @@ class ThreadAPITestCase(TestBase): 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 @@ class ThreadAPITestCase(TestBase): break #self.runCmd("thread backtrace") #self.runCmd("process status") - self.process.Continue() + process.Continue() thread.StepOut() self.runCmd("thread backtrace") @@ -196,13 +196,13 @@ class ThreadAPITestCase(TestBase): 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 @@ class ThreadAPITestCase(TestBase): 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) |