brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 5e1fb9d Raw
54 lines · python
1"""2Test the "process continue --reverse" and "--forward" options3when reverse-continue is not supported.4"""5 6 7import lldb8from lldbsuite.test.lldbtest import *9from lldbsuite.test.decorators import *10from lldbsuite.test import lldbutil11 12 13class TestReverseContinueCommandNotSupported(TestBase):14    def test_reverse_continue_not_supported(self):15        target = self.connect()16 17        # Set breakpoint and reverse-continue18        trigger_bkpt = target.BreakpointCreateByName("trigger_breakpoint", None)19        self.assertTrue(trigger_bkpt, VALID_BREAKPOINT)20        # `process continue --forward` should work.21        self.expect(22            "process continue --forward",23            substrs=["stop reason = breakpoint {0}.1".format(trigger_bkpt.GetID())],24        )25        self.expect(26            "process continue --reverse",27            error=True,28            # This error is "<plugin name> does not support...". The plugin name changes29            # between platforms.30            substrs=["does not support reverse execution of processes"],31        )32 33    def test_reverse_continue_forward_and_reverse(self):34        self.connect()35 36        self.expect(37            "process continue --forward --reverse",38            error=True,39            substrs=["invalid combination of options for the given command"],40        )41 42    def connect(self):43        self.build()44        exe = self.getBuildArtifact("a.out")45        target = self.dbg.CreateTarget(exe)46        self.assertTrue(target, VALID_TARGET)47 48        main_bkpt = target.BreakpointCreateByName("main", None)49        self.assertTrue(main_bkpt, VALID_BREAKPOINT)50 51        process = target.LaunchSimple(None, None, self.get_process_working_directory())52        self.assertTrue(process, PROCESS_IS_VALID)53        return target54