aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Lee <davelee.com@gmail.com>2024-11-14 13:27:41 -0800
committerGitHub <noreply@github.com>2024-11-14 13:27:41 -0800
commit5d16fbc275d57b88866a2606453ead6a024ffee0 (patch)
tree4207825d513d3d61ab015aed8f0e83651c339020
parent90cbd4adb3ecee72319c320ed62a9d1329a49bb9 (diff)
downloadllvm-5d16fbc275d57b88866a2606453ead6a024ffee0.zip
llvm-5d16fbc275d57b88866a2606453ead6a024ffee0.tar.gz
llvm-5d16fbc275d57b88866a2606453ead6a024ffee0.tar.bz2
[lldb] Support any flag to _regexp-bt (#116260)
In particular, this allows `bt -u`. Note that this passthrough behavior has precedent in `_regexp-break`, where `b (-.*)` is expanded to `breakpoint set %1`.
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp3
-rw-r--r--lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index f2712af..764dcfd 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -851,8 +851,7 @@ void CommandInterpreter::LoadCommandDictionary() {
// now "bt 3" is the preferred form, in line with gdb.
if (bt_regex_cmd_up->AddRegexCommand("^([[:digit:]]+)[[:space:]]*$",
"thread backtrace -c %1") &&
- bt_regex_cmd_up->AddRegexCommand("^-c ([[:digit:]]+)[[:space:]]*$",
- "thread backtrace -c %1") &&
+ bt_regex_cmd_up->AddRegexCommand("^(-[^[:space:]].*)$", "thread backtrace %1") &&
bt_regex_cmd_up->AddRegexCommand("^all[[:space:]]*$", "thread backtrace all") &&
bt_regex_cmd_up->AddRegexCommand("^[[:space:]]*$", "thread backtrace")) {
CommandObjectSP command_sp(bt_regex_cmd_up.release());
diff --git a/lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py b/lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py
index d1cb821..978bf20 100644
--- a/lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py
+++ b/lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py
@@ -47,6 +47,11 @@ class LibCxxStdFunctionRecognizerTestCase(TestBase):
)
# Unfiltered.
self.expect(
+ "bt -u",
+ ordered=True,
+ patterns=["frame.*foo", "frame.*std::__[^:]*::__function", "frame.*main"],
+ )
+ self.expect(
"thread backtrace -u",
ordered=True,
patterns=["frame.*foo", "frame.*std::__[^:]*::__function", "frame.*main"],