[Lldb-commits] [lldb] r253094 - Change the test to use the instruction list to get the consecutive addresses to break on. Rerunning

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 13 14:19:08 PST 2015


Author: jingham
Date: Fri Nov 13 16:19:08 2015
New Revision: 253094

URL: http://llvm.org/viewvc/llvm-project?rev=253094&view=rev
Log:
Change the test to use the instruction list to get the consecutive addresses to break on.  Rerunning
was being foiled by ASLR.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py?rev=253094&r1=253093&r2=253094&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoins/TestConsecutiveBreakpoints.py Fri Nov 13 16:19:08 2015
@@ -19,7 +19,7 @@ class ConsecutiveBreakpoitsTestCase(Test
     def test (self):
         self.build ()
         self.consecutive_breakpoints_tests()
-
+        
     def consecutive_breakpoints_tests(self):
         exe = os.path.join (os.getcwd(), "a.out")
 
@@ -40,24 +40,15 @@ class ConsecutiveBreakpoitsTestCase(Test
         thread = process.GetThreadAtIndex(0)
         self.assertEqual(thread.GetStopReason(), lldb.eStopReasonBreakpoint)
 
-        # Step to the next instruction
-        thread.StepInstruction(False)
-        self.assertEqual(thread.GetStopReason(), lldb.eStopReasonPlanComplete)
-        address = thread.GetFrameAtIndex(0).GetPC()
-
-        # Run the process until termination
-        process.Continue()
-
-        # Now launch the process again, and do not stop at entry point.
-        process = target.LaunchSimple (None, None, self.get_process_working_directory())
-        self.assertTrue(process, PROCESS_IS_VALID)
-
-        # We should be stopped at the first breakpoint
-        thread = process.GetThreadAtIndex(0)
-        self.assertEqual(thread.GetStopReason(), lldb.eStopReasonBreakpoint)
-
         # Set breakpoint to the next instruction
-        target.BreakpointCreateByAddress(address)
+        frame = thread.GetFrameAtIndex(0)
+        
+        address = frame.GetPCAddress()
+        instructions = target.ReadInstructions(address, 2)
+        self.assertTrue(len(instructions) == 2)
+        address = instructions[1].GetAddress()
+        
+        target.BreakpointCreateByAddress(address.GetLoadAddress(target))
         process.Continue()
 
         # We should be stopped at the second breakpoint




More information about the lldb-commits mailing list