Skip to content

Commit 0dfb08f

Browse files
author
git apple-llvm automerger
committed
Merge commit 'ab73f6def9c7' from swift/swift-5.2-branch into swift/master
2 parents 6093227 + ab73f6d commit 0dfb08f

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# UNSUPPORTED: system-windows
22
#
33
# RUN: %clang_host -g -O0 %S/Inputs/main.c -o %t.out
4-
# RUN: %lldb -b -o 'help breakpoint set' -o 'breakpoint set -f main.c -l 2 -u 21' %t.out | FileCheck %s
5-
# CHECK: -u <column> ( --column <column> )
6-
# CHECK: Specifies the column number on which to set this breakpoint.
4+
# RUN: %lldb -b -o 'help breakpoint set' -o 'breakpoint set -f main.c -l 2 -u 21' %t.out | FileCheck %s --check-prefix HELP --check-prefix CHECK
5+
# RUN: %lldb -b -o 'help _regexp-break' -o 'b main.c:2:21' %t.out | FileCheck %s --check-prefix HELP-REGEX --check-prefix CHECK
6+
# HELP: -u <column> ( --column <column> )
7+
# HELP: Specifies the column number on which to set this breakpoint.
8+
# HELP-REGEX: _regexp-break <filename>:<linenum>:<colnum>
9+
# HELP-REGEX: main.c:12:21{{.*}}Break at line 12 and column 21 of main.c
710
# CHECK: at main.c:2:21

lldb/source/Interpreter/CommandInterpreter.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,10 @@ void CommandInterpreter::LoadCommandDictionary() {
489489
m_command_dict["language"] =
490490
CommandObjectSP(new CommandObjectLanguage(*this));
491491

492+
// clang-format off
492493
const char *break_regexes[][2] = {
494+
{"^(.*[^[:space:]])[[:space:]]*:[[:space:]]*([[:digit:]]+)[[:space:]]*:[[:space:]]*([[:digit:]]+)[[:space:]]*$",
495+
"breakpoint set --file '%1' --line %2 --column %3"},
493496
{"^(.*[^[:space:]])[[:space:]]*:[[:space:]]*([[:digit:]]+)[[:space:]]*$",
494497
"breakpoint set --file '%1' --line %2"},
495498
{"^/([^/]+)/$", "breakpoint set --source-pattern-regexp '%1'"},
@@ -504,6 +507,7 @@ void CommandInterpreter::LoadCommandDictionary() {
504507
"breakpoint set --name '%1' --skip-prologue=0"},
505508
{"^[\"']?(.*[^[:space:]\"'])[\"']?[[:space:]]*$",
506509
"breakpoint set --name '%1'"}};
510+
// clang-format on
507511

508512
size_t num_regexes = llvm::array_lengthof(break_regexes);
509513

@@ -512,6 +516,9 @@ void CommandInterpreter::LoadCommandDictionary() {
512516
*this, "_regexp-break",
513517
"Set a breakpoint using one of several shorthand formats.",
514518
"\n"
519+
"_regexp-break <filename>:<linenum>:<colnum>\n"
520+
" main.c:12:21 // Break at line 12 and column "
521+
"21 of main.c\n\n"
515522
"_regexp-break <filename>:<linenum>\n"
516523
" main.c:12 // Break at line 12 of "
517524
"main.c\n\n"
@@ -535,7 +542,7 @@ void CommandInterpreter::LoadCommandDictionary() {
535542
"current file\n"
536543
" // containing text 'break "
537544
"here'.\n",
538-
2,
545+
3,
539546
CommandCompletions::eSymbolCompletion |
540547
CommandCompletions::eSourceFileCompletion,
541548
false));
@@ -562,6 +569,9 @@ void CommandInterpreter::LoadCommandDictionary() {
562569
*this, "_regexp-tbreak",
563570
"Set a one-shot breakpoint using one of several shorthand formats.",
564571
"\n"
572+
"_regexp-break <filename>:<linenum>:<colnum>\n"
573+
" main.c:12:21 // Break at line 12 and column "
574+
"21 of main.c\n\n"
565575
"_regexp-break <filename>:<linenum>\n"
566576
" main.c:12 // Break at line 12 of "
567577
"main.c\n\n"

0 commit comments

Comments
 (0)