brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 23fc42c Raw
37 lines · python
1"""2Test some lldb command abbreviations.3"""4 5 6import lldb7from lldbsuite.test.decorators import *8from lldbsuite.test.lldbtest import *9from lldbsuite.test import lldbutil10 11 12class DisassemblyTestCase(TestBase):13    NO_DEBUG_INFO_TESTCASE = True14 15    def test(self):16        self.build()17        target, _, _, bkpt = lldbutil.run_to_source_breakpoint(18            self, "Set a breakpoint here", lldb.SBFileSpec("main.cpp")19        )20        self.runCmd("dis -f")21        disassembly_with_break = self.res.GetOutput().splitlines()22 23        self.assertTrue(target.BreakpointDelete(bkpt.GetID()))24 25        self.runCmd("dis -f")26        disassembly_without_break = self.res.GetOutput().splitlines()27 28        # Make sure all assembly instructions are the same as instructions29        # with the breakpoint removed.30        self.assertEqual(len(disassembly_with_break), len(disassembly_without_break))31        for dis_inst_with, dis_inst_without in zip(32            disassembly_with_break, disassembly_without_break33        ):34            inst_with = dis_inst_with.split(":")[-1]35            inst_without = dis_inst_without.split(":")[-1]36            self.assertEqual(inst_with, inst_without)37