Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lldb/source/Commands/CommandObjectBreakpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading