================
@@ -0,0 +1,79 @@
+import lldb
+import unittest
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from lldbsuite.test.gdbclientutils import *
+from lldbsuite.test.lldbreverse import ReverseTestBase
+from lldbsuite.test import lldbutil
+
+
+class TestReverseContinueBreakpoints(ReverseTestBase):
+ @add_test_categories(["dwarf"])
+ def test_reverse_continue(self):
+ target, process, initial_threads = self.setup_recording()
+
+ # Reverse-continue. We'll stop at the point where we started recording.
+ status = process.ReverseContinue()
+ self.assertSuccess(status)
+ self.expect(
+ "thread list",
+ STOPPED_DUE_TO_HISTORY_BOUNDARY,
+ substrs=["stopped", "stop reason = history boundary"],
+ )
+
+ # Continue forward normally until the target exits.
+ status = process.Continue()
+ self.assertSuccess(status)
+ self.assertState(process.GetState(), lldb.eStateExited)
+ self.assertEqual(process.GetExitStatus(), 0)
+
+ @add_test_categories(["dwarf"])
+ def test_reverse_continue_breakpoint(self):
+ target, process, initial_threads = self.setup_recording()
+
+ # Reverse-continue to the function "trigger_breakpoint".
+ trigger_bkpt = target.BreakpointCreateByName("trigger_breakpoint",
None)
+ status = process.ReverseContinue()
+ self.assertSuccess(status)
+ threads_now = lldbutil.get_threads_stopped_at_breakpoint(process,
trigger_bkpt)
+ self.assertEqual(threads_now, initial_threads)
+
+ @add_test_categories(["dwarf"])
+ def test_reverse_continue_skip_breakpoint(self):
+ target, process, initial_threads = self.setup_recording()
+
+ # Reverse-continue, skipping a disabled breakpoint at
"trigger_breakpoint".
+ trigger_bkpt = target.BreakpointCreateByName("trigger_breakpoint",
None)
+ trigger_bkpt.SetCondition("0")
----------------
medismailben wrote:
```suggestion
trigger_bkpt.SetEnabled(False)
```
If you want to disable the breakpoint you should use this API:
https://lldb.llvm.org/python_api/lldb.SBBreakpoint.html#lldb.SBBreakpoint.SetEnabled
https://github.com/llvm/llvm-project/pull/99736
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits