From d768ee214075e534b25b7ee8325d59a7f6b0d2b9 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Fri, 17 May 2019 01:03:21 +0000 Subject: [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. llvm-svn: 360966 --- lldb/source/Interpreter/CommandInterpreter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp') diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index df583bc72dc..4a132622faa 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -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; } -- cgit v1.2.3