2 Test setting a breakpoint by line and column.
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
13 class BreakpointByLineAndColumnTestCase(TestBase):
15 mydir = TestBase.compute_mydir(__file__)
17 ## Skip gcc version less 7.1 since it doesn't support -gcolumn-info
18 @skipIf(compiler="gcc", compiler_version=['<', '7.1'])
19 def testBreakpointByLineAndColumn(self):
21 main_c = lldb.SBFileSpec("main.c")
22 _, _, _, breakpoint = lldbutil.run_to_line_breakpoint(self,
24 self.expect("fr v did_call", substrs='1')
26 for i in range(breakpoint.GetNumLocations()):
27 b_loc = breakpoint.GetLocationAtIndex(i).GetAddress().GetLineEntry()
28 self.assertEqual(b_loc.GetLine(), 19)
29 in_then |= b_loc.GetColumn() == 50
30 self.assertTrue(in_then)
32 ## Skip gcc version less 7.1 since it doesn't support -gcolumn-info
33 @skipIf(compiler="gcc", compiler_version=['<', '7.1'])
34 def testBreakpointByLine(self):
36 main_c = lldb.SBFileSpec("main.c")
37 _, _, _, breakpoint = lldbutil.run_to_line_breakpoint(self, main_c, 19)
38 self.expect("fr v did_call", substrs='0')
40 for i in range(breakpoint.GetNumLocations()):
41 b_loc = breakpoint.GetLocationAtIndex(i).GetAddress().GetLineEntry()
42 self.assertEqual(b_loc.GetLine(), 19)
43 in_condition |= b_loc.GetColumn() < 30
44 self.assertTrue(in_condition)