brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · b581969 Raw
41 lines · python
1"""2Confirm that lldb modify watchpoints only stop3when the value being watched changes.4"""5 6 7import lldb8from lldbsuite.test.decorators import *9from lldbsuite.test.lldbtest import *10from lldbsuite.test import lldbutil11 12 13@skipIfWindows14class ModifyWatchpointTestCase(TestBase):15    NO_DEBUG_INFO_TESTCASE = True16 17    def test_modify_watchpoint(self):18        """Test that a modify watchpoint only stops when the value changes."""19        self.build()20        self.main_source_file = lldb.SBFileSpec("main.c")21        (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(22            self, "break here", self.main_source_file23        )24 25        self.runCmd("watch set variable value")26        process.Continue()27        frame = process.GetSelectedThread().GetFrameAtIndex(0)28        self.assertEqual(frame.locals["value"][0].GetValueAsUnsigned(), 10)29 30        process.Continue()31        frame = process.GetSelectedThread().GetFrameAtIndex(0)32        self.assertEqual(frame.locals["value"][0].GetValueAsUnsigned(), 5)33 34        process.Continue()35        frame = process.GetSelectedThread().GetFrameAtIndex(0)36        self.assertEqual(frame.locals["value"][0].GetValueAsUnsigned(), 7)37 38        process.Continue()39        frame = process.GetSelectedThread().GetFrameAtIndex(0)40        self.assertEqual(frame.locals["value"][0].GetValueAsUnsigned(), 9)41