Skip to content

Commit 6672a4f

Browse files
committed
[lldb/Commands] Fix, rename and document column number arg to breakpoint set.
We were incorrectly parsing the -C argument to breakpoint set as the column breakpoint, even though according to the help this should be the breakpoint command. This fixes that by renaming the option to -u, adding it to help, and adding a test case. Differential revision: https://reviews.llvm.org/D73284
1 parent 1624cba commit 6672a4f

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

lldb/include/lldb/lldb-enumerations.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ enum CommandArgumentType {
590590
eArgTypeWatchType,
591591
eArgRawInput,
592592
eArgTypeCommand,
593+
eArgTypeColumnNum,
593594
eArgTypeLastArg // Always keep this entry as the last entry in this
594595
// enumeration!!
595596
};

lldb/source/Commands/CommandObjectBreakpoint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
274274
m_func_name_type_mask |= eFunctionNameTypeBase;
275275
break;
276276

277-
case 'C':
277+
case 'u':
278278
if (option_arg.getAsInteger(0, m_column))
279279
error.SetErrorStringWithFormat("invalid column number: %s",
280280
option_arg.str().c_str());

lldb/source/Commands/Options.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ let Command = "breakpoint set" in {
115115
def breakpoint_set_line : Option<"line", "l">, Group<1>, Arg<"LineNum">,
116116
Required,
117117
Desc<"Specifies the line number on which to set this breakpoint.">;
118+
def breakpoint_set_column : Option<"column", "u">, Group<1>, Arg<"ColumnNum">,
119+
Desc<"Specifies the column number on which to set this breakpoint.">;
118120
def breakpoint_set_address : Option<"address", "a">, Group<2>,
119121
Arg<"AddressOrExpression">, Required,
120122
Desc<"Set the breakpoint at the specified address. If the address maps "

lldb/source/Interpreter/CommandObject.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,8 @@ CommandObject::ArgumentTableEntry CommandObject::g_arguments_data[] = {
11051105
{ eArgTypeWatchpointIDRange, "watchpt-id-list", CommandCompletions::eNoCompletion, { nullptr, false }, "For example, '1-3' or '1 to 3'." },
11061106
{ eArgTypeWatchType, "watch-type", CommandCompletions::eNoCompletion, { nullptr, false }, "Specify the type for a watchpoint." },
11071107
{ eArgRawInput, "raw-input", CommandCompletions::eNoCompletion, { nullptr, false }, "Free-form text passed to a command without prior interpretation, allowing spaces without requiring quotes. To pass arguments and free form text put two dashes ' -- ' between the last argument and any raw input." },
1108-
{ eArgTypeCommand, "command", CommandCompletions::eNoCompletion, { nullptr, false }, "An LLDB Command line command." }
1108+
{ eArgTypeCommand, "command", CommandCompletions::eNoCompletion, { nullptr, false }, "An LLDB Command line command." },
1109+
{ eArgTypeColumnNum, "column", CommandCompletions::eNoCompletion, { nullptr, false }, "Column number in a source file." }
11091110
// clang-format on
11101111
};
11111112

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# RUN: %clang_host -g -O0 %S/Inputs/main.c -o %t.out
2+
# RUN: %lldb -b -o 'help breakpoint set' -o 'breakpoint set -f main.c -l 2 -u 21' %t.out | FileCheck %s
3+
# CHECK: -u <column> ( --column <column> )
4+
# CHECK: Specifies the column number on which to set this breakpoint.
5+
# CHECK: at main.c:2:21

0 commit comments

Comments
 (0)