diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index fbd6ca44db950..75dc890cc40ed 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -767,7 +767,7 @@ class CommandObjectBreakpointAddFile : public CommandObjectParsed { m_cur_value.SetLine(line_num); } break; - case 'c': + case 'u': uint32_t column_num; if (option_arg.getAsInteger(0, column_num)) error = Status::FromError( diff --git a/lldb/test/API/functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py b/lldb/test/API/functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py index 5798c8ffa8220..1f5718149b3e3 100644 --- a/lldb/test/API/functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py +++ b/lldb/test/API/functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py @@ -27,6 +27,25 @@ def testBreakpointByLineAndColumn(self): in_then |= b_loc.GetColumn() == 50 self.assertTrue(in_then) + def testBreakpointByLineAndColumnUsingCLI(self): + self.build() + src_file = lldb.SBFileSpec("main.cpp") + line = ( + line_number("main.cpp", "At the beginning of a function name (col:50)") + 1 + ) # Next line after comment + target, process, _, _ = lldbutil.run_to_source_breakpoint(self, "This is a random comment", src_file) + bkpt_no = lldbutil.run_break_set_by_file_and_line(self, "main.cpp", line, "--column 50") + breakpoint = target.FindBreakpointByID(bkpt_no) + threads = lldbutil.continue_to_breakpoint(process, breakpoint) + self.assertEqual(len(threads), 1, "Stopped at our breakpoint") + self.expect("fr v did_call", substrs=["1"]) + in_then = False + for i in range(breakpoint.GetNumLocations()): + b_loc = breakpoint.GetLocationAtIndex(i).GetAddress().GetLineEntry() + self.assertEqual(b_loc.GetLine(), line) + in_then |= b_loc.GetColumn() == 50 + self.assertTrue(in_then) + ## Skip gcc version less 7.1 since it doesn't support -gcolumn-info @skipIf(compiler="gcc", compiler_version=["<", "7.1"]) def testBreakpointByLine(self):