@@ -27,6 +27,25 @@ def testBreakpointByLineAndColumn(self):
2727 in_then |= b_loc .GetColumn () == 50
2828 self .assertTrue (in_then )
2929
30+ def testBreakpointByLineAndColumnUsingCLI (self ):
31+ self .build ()
32+ src_file = lldb .SBFileSpec ("main.cpp" )
33+ line = (
34+ line_number ("main.cpp" , "At the beginning of a function name (col:50)" ) + 1
35+ ) # Next line after comment
36+ target , process , _ , _ = lldbutil .run_to_source_breakpoint (self , "This is a random comment" , src_file )
37+ bkpt_no = lldbutil .run_break_set_by_file_and_line (self , "main.cpp" , line , "--column 50" )
38+ breakpoint = target .FindBreakpointByID (bkpt_no )
39+ threads = lldbutil .continue_to_breakpoint (process , breakpoint )
40+ self .assertEqual (len (threads ), 1 , "Stopped at our breakpoint" )
41+ self .expect ("fr v did_call" , substrs = ["1" ])
42+ in_then = False
43+ for i in range (breakpoint .GetNumLocations ()):
44+ b_loc = breakpoint .GetLocationAtIndex (i ).GetAddress ().GetLineEntry ()
45+ self .assertEqual (b_loc .GetLine (), line )
46+ in_then |= b_loc .GetColumn () == 50
47+ self .assertTrue (in_then )
48+
3049 ## Skip gcc version less 7.1 since it doesn't support -gcolumn-info
3150 @skipIf (compiler = "gcc" , compiler_version = ["<" , "7.1" ])
3251 def testBreakpointByLine (self ):
0 commit comments