4130aae96210ed784a60d3c68a303f8c865283bd
[openbsd] /
1 """
2 Test some lldb command abbreviations.
3 """
4
5
6
7 import lldb
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
11
12
13 class DisassemblyTestCase(TestBase):
14
15     mydir = TestBase.compute_mydir(__file__)
16     NO_DEBUG_INFO_TESTCASE = True
17
18     def test(self):
19         self.build()
20         target, _, _, bkpt = lldbutil.run_to_source_breakpoint(self,
21                 "Set a breakpoint here", lldb.SBFileSpec("main.cpp"))
22         self.runCmd("dis -f")
23         disassembly_with_break = self.res.GetOutput().splitlines()
24
25         self.assertTrue(target.BreakpointDelete(bkpt.GetID()))
26
27         self.runCmd("dis -f")
28         disassembly_without_break = self.res.GetOutput().splitlines()
29
30         # Make sure all assembly instructions are the same as instructions
31         # with the breakpoint removed.
32         self.assertEqual(len(disassembly_with_break),
33                          len(disassembly_without_break))
34         for dis_inst_with, dis_inst_without in \
35                 zip(disassembly_with_break, disassembly_without_break):
36             inst_with = dis_inst_with.split(':')[-1]
37             inst_without = dis_inst_without.split(':')[-1]
38             self.assertEqual(inst_with, inst_without)