probinson created this revision.
probinson added a reviewer: jingham.
probinson added a subscriber: LLDB.

LLVM is about to start emitting "line 0" records more often in the DWARF line 
table.
One test tripped over this; made the test accommodate the new records.


https://reviews.llvm.org/D27282

Files:
  
packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py


Index: 
packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
===================================================================
--- 
packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
+++ 
packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
@@ -23,32 +23,35 @@
         self.build(dictionary=self.getBuildFlags())
         self.exit_during_step_base(
             "thread step-inst -m all-threads",
-            'stop reason = instruction step')
+            'stop reason = instruction step',
+            True)
 
     @skipIfFreeBSD  # llvm.org/pr21411: test is hanging
     def test_step_over(self):
         """Test thread exit during step-over handling."""
         self.build(dictionary=self.getBuildFlags())
         self.exit_during_step_base(
             "thread step-over -m all-threads",
-            'stop reason = step over')
+            'stop reason = step over',
+            False)
 
     @skipIfFreeBSD  # llvm.org/pr21411: test is hanging
     def test_step_in(self):
         """Test thread exit during step-in handling."""
         self.build(dictionary=self.getBuildFlags())
         self.exit_during_step_base(
             "thread step-in -m all-threads",
-            'stop reason = step in')
+            'stop reason = step in',
+            False)
 
     def setUp(self):
         # Call super's setUp().
         TestBase.setUp(self)
         # Find the line numbers to break and continue.
         self.breakpoint = line_number('main.cpp', '// Set breakpoint here')
         self.continuepoint = line_number('main.cpp', '// Continue from here')
 
-    def exit_during_step_base(self, step_cmd, step_stop_reason):
+    def exit_during_step_base(self, step_cmd, step_stop_reason, 
by_instruction):
         """Test thread exit during step handling."""
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -111,6 +114,9 @@
 
             current_line = frame.GetLineEntry().GetLine()
 
+            if by_instruction and current_line == 0:
+                continue
+
             self.assertGreaterEqual(
                 current_line,
                 self.breakpoint,


Index: packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
===================================================================
--- packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
+++ packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
@@ -23,32 +23,35 @@
         self.build(dictionary=self.getBuildFlags())
         self.exit_during_step_base(
             "thread step-inst -m all-threads",
-            'stop reason = instruction step')
+            'stop reason = instruction step',
+            True)
 
     @skipIfFreeBSD  # llvm.org/pr21411: test is hanging
     def test_step_over(self):
         """Test thread exit during step-over handling."""
         self.build(dictionary=self.getBuildFlags())
         self.exit_during_step_base(
             "thread step-over -m all-threads",
-            'stop reason = step over')
+            'stop reason = step over',
+            False)
 
     @skipIfFreeBSD  # llvm.org/pr21411: test is hanging
     def test_step_in(self):
         """Test thread exit during step-in handling."""
         self.build(dictionary=self.getBuildFlags())
         self.exit_during_step_base(
             "thread step-in -m all-threads",
-            'stop reason = step in')
+            'stop reason = step in',
+            False)
 
     def setUp(self):
         # Call super's setUp().
         TestBase.setUp(self)
         # Find the line numbers to break and continue.
         self.breakpoint = line_number('main.cpp', '// Set breakpoint here')
         self.continuepoint = line_number('main.cpp', '// Continue from here')
 
-    def exit_during_step_base(self, step_cmd, step_stop_reason):
+    def exit_during_step_base(self, step_cmd, step_stop_reason, by_instruction):
         """Test thread exit during step handling."""
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -111,6 +114,9 @@
 
             current_line = frame.GetLineEntry().GetLine()
 
+            if by_instruction and current_line == 0:
+                continue
+
             self.assertGreaterEqual(
                 current_line,
                 self.breakpoint,
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to