mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 21:53:12 +08:00
[CommandInterpreter] Accept blanks after all or [0-9]+ for bt.
Previously "bt all " would've failed as the regex didn't match them. Over the shoulder review by Jonas Devlieghere. <rdar://problem/50824935> llvm-svn: 360966
This commit is contained in:
12
lldb/lit/Commands/command-backtrace.test
Normal file
12
lldb/lit/Commands/command-backtrace.test
Normal file
@@ -0,0 +1,12 @@
|
||||
# Check basic functionality of command bt.
|
||||
# RUN: %lldb -s %s 2>&1 | FileCheck %s
|
||||
|
||||
# Make sure this is not rejected by the parser as invalid syntax.
|
||||
# Blank characters after the '1' are important, as we're testing the parser.
|
||||
bt 1
|
||||
# CHECK: error: invalid target
|
||||
|
||||
# Make sure this is not rejected by the parser as invalid syntax.
|
||||
# Blank characters after the '1' are important, as we're testing the parser.
|
||||
bt all
|
||||
# CHECK: error: invalid target
|
||||
@@ -758,12 +758,12 @@ void CommandInterpreter::LoadCommandDictionary() {
|
||||
// command if you wanted to backtrace three frames you would do "bt -c 3"
|
||||
// but the intention is to have this emulate the gdb "bt" command and so
|
||||
// now "bt 3" is the preferred form, in line with gdb.
|
||||
if (bt_regex_cmd_up->AddRegexCommand("^([[:digit:]]+)$",
|
||||
if (bt_regex_cmd_up->AddRegexCommand("^([[:digit:]]+)\\s*$",
|
||||
"thread backtrace -c %1") &&
|
||||
bt_regex_cmd_up->AddRegexCommand("^-c ([[:digit:]]+)$",
|
||||
bt_regex_cmd_up->AddRegexCommand("^-c ([[:digit:]]+)\\s*$",
|
||||
"thread backtrace -c %1") &&
|
||||
bt_regex_cmd_up->AddRegexCommand("^all$", "thread backtrace all") &&
|
||||
bt_regex_cmd_up->AddRegexCommand("^$", "thread backtrace")) {
|
||||
bt_regex_cmd_up->AddRegexCommand("^all\\s*$", "thread backtrace all") &&
|
||||
bt_regex_cmd_up->AddRegexCommand("^\\s*$", "thread backtrace")) {
|
||||
CommandObjectSP command_sp(bt_regex_cmd_up.release());
|
||||
m_command_dict[command_sp->GetCommandName()] = command_sp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user