[Lldb-commits] [lldb] 5d16fbc - [lldb] Support any flag to _regexp-bt (#116260)
via lldb-commits
lldb-commits at lists.llvm.org
Thu Nov 14 13:27:45 PST 2024
Author: Dave Lee
Date: 2024-11-14T13:27:41-08:00
New Revision: 5d16fbc275d57b88866a2606453ead6a024ffee0
URL: https://github.com/llvm/llvm-project/commit/5d16fbc275d57b88866a2606453ead6a024ffee0
DIFF: https://github.com/llvm/llvm-project/commit/5d16fbc275d57b88866a2606453ead6a024ffee0.diff
LOG: [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`.
Added:
Modified:
lldb/source/Interpreter/CommandInterpreter.cpp
lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py
Removed:
################################################################################
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index f2712af0a08a73..764dcfd1903b19 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 d1cb8214d658ff..978bf2066e43b0 100644
--- a/lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py
+++ b/lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py
@@ -46,6 +46,11 @@ def test_backtrace(self):
"thread backtrace", matching=False, patterns=["frame.*std::__.*::__function"]
)
# Unfiltered.
+ self.expect(
+ "bt -u",
+ ordered=True,
+ patterns=["frame.*foo", "frame.*std::__[^:]*::__function", "frame.*main"],
+ )
self.expect(
"thread backtrace -u",
ordered=True,
More information about the lldb-commits
mailing list