From b9c1b51e45b845debb76d8658edabca70ca56079 Mon Sep 17 00:00:00 2001 From: Kate Stone Date: Tue, 6 Sep 2016 20:57:50 +0000 Subject: *** This commit represents a complete reformatting of the LLDB source code *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751 --- .../TestConsecutiveBreakpoints.py | 65 +++++++++++++++------- 1 file changed, 44 insertions(+), 21 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints') diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py index 472479391c0..312f2944102 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py @@ -5,35 +5,42 @@ Test that we handle breakpoints on consecutive instructions correctly. from __future__ import print_function - import unittest2 import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class ConsecutiveBreakpointsTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def prepare_test(self): self.build() - exe = os.path.join (os.getcwd(), "a.out") + exe = os.path.join(os.getcwd(), "a.out") # Create a target by the debugger. self.target = self.dbg.CreateTarget(exe) self.assertTrue(self.target, VALID_TARGET) - breakpoint1 = self.target.BreakpointCreateBySourceRegex("Set breakpoint here", lldb.SBFileSpec("main.cpp")) - self.assertTrue(breakpoint1 and breakpoint1.GetNumLocations() == 1, VALID_BREAKPOINT) + breakpoint1 = self.target.BreakpointCreateBySourceRegex( + "Set breakpoint here", lldb.SBFileSpec("main.cpp")) + self.assertTrue( + breakpoint1 and breakpoint1.GetNumLocations() == 1, + VALID_BREAKPOINT) # Now launch the process, and do not stop at entry point. - self.process = self.target.LaunchSimple (None, None, self.get_process_working_directory()) + self.process = self.target.LaunchSimple( + None, None, self.get_process_working_directory()) self.assertIsNotNone(self.process, PROCESS_IS_VALID) # We should be stopped at the first breakpoint - self.thread = lldbutil.get_one_thread_stopped_at_breakpoint(self.process, breakpoint1) - self.assertIsNotNone(self.thread, "Expected one thread to be stopped at breakpoint 1") + self.thread = lldbutil.get_one_thread_stopped_at_breakpoint( + self.process, breakpoint1) + self.assertIsNotNone( + self.thread, + "Expected one thread to be stopped at breakpoint 1") # Set breakpoint to the next instruction frame = self.thread.GetFrameAtIndex(0) @@ -42,8 +49,11 @@ class ConsecutiveBreakpointsTestCase(TestBase): instructions = self.target.ReadInstructions(address, 2) self.assertTrue(len(instructions) == 2) self.bkpt_address = instructions[1].GetAddress() - self.breakpoint2 = self.target.BreakpointCreateByAddress(self.bkpt_address.GetLoadAddress(self.target)) - self.assertTrue(self.breakpoint2 and self.breakpoint2.GetNumLocations() == 1, VALID_BREAKPOINT) + self.breakpoint2 = self.target.BreakpointCreateByAddress( + self.bkpt_address.GetLoadAddress(self.target)) + self.assertTrue( + self.breakpoint2 and self.breakpoint2.GetNumLocations() == 1, + VALID_BREAKPOINT) def finish_test(self): # Run the process until termination @@ -58,8 +68,11 @@ class ConsecutiveBreakpointsTestCase(TestBase): self.process.Continue() self.assertEquals(self.process.GetState(), lldb.eStateStopped) # We should be stopped at the second breakpoint - self.thread = lldbutil.get_one_thread_stopped_at_breakpoint(self.process, self.breakpoint2) - self.assertIsNotNone(self.thread, "Expected one thread to be stopped at breakpoint 2") + self.thread = lldbutil.get_one_thread_stopped_at_breakpoint( + self.process, self.breakpoint2) + self.assertIsNotNone( + self.thread, + "Expected one thread to be stopped at breakpoint 2") self.finish_test() @@ -72,10 +85,15 @@ class ConsecutiveBreakpointsTestCase(TestBase): self.thread.StepInstruction(step_over) self.assertEquals(self.process.GetState(), lldb.eStateStopped) - self.assertEquals(self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress(self.target), - self.bkpt_address.GetLoadAddress(self.target)) - self.thread = lldbutil.get_one_thread_stopped_at_breakpoint(self.process, self.breakpoint2) - self.assertIsNotNone(self.thread, "Expected one thread to be stopped at breakpoint 2") + self.assertEquals( + self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress( + self.target), self.bkpt_address.GetLoadAddress( + self.target)) + self.thread = lldbutil.get_one_thread_stopped_at_breakpoint( + self.process, self.breakpoint2) + self.assertIsNotNone( + self.thread, + "Expected one thread to be stopped at breakpoint 2") self.finish_test() @@ -84,8 +102,9 @@ class ConsecutiveBreakpointsTestCase(TestBase): """Test that single step stops, even though the second breakpoint is not valid.""" self.prepare_test() - # Choose a thread other than the current one. A non-existing thread is fine. - thread_index = self.process.GetNumThreads()+1 + # Choose a thread other than the current one. A non-existing thread is + # fine. + thread_index = self.process.GetNumThreads() + 1 self.assertFalse(self.process.GetThreadAtIndex(thread_index).IsValid()) self.breakpoint2.SetThreadIndex(thread_index) @@ -93,9 +112,13 @@ class ConsecutiveBreakpointsTestCase(TestBase): self.thread.StepInstruction(step_over) self.assertEquals(self.process.GetState(), lldb.eStateStopped) - self.assertEquals(self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress(self.target), - self.bkpt_address.GetLoadAddress(self.target)) - self.assertEquals(self.thread.GetStopReason(), lldb.eStopReasonPlanComplete, - "Stop reason should be 'plan complete'") + self.assertEquals( + self.thread.GetFrameAtIndex(0).GetPCAddress().GetLoadAddress( + self.target), self.bkpt_address.GetLoadAddress( + self.target)) + self.assertEquals( + self.thread.GetStopReason(), + lldb.eStopReasonPlanComplete, + "Stop reason should be 'plan complete'") self.finish_test() -- cgit v1.2.3