Skip to content

Commit 5d16fbc

Browse files
authored
[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`.
1 parent 90cbd4a commit 5d16fbc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lldb/source/Interpreter/CommandInterpreter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,7 @@ void CommandInterpreter::LoadCommandDictionary() {
851851
// now "bt 3" is the preferred form, in line with gdb.
852852
if (bt_regex_cmd_up->AddRegexCommand("^([[:digit:]]+)[[:space:]]*$",
853853
"thread backtrace -c %1") &&
854-
bt_regex_cmd_up->AddRegexCommand("^-c ([[:digit:]]+)[[:space:]]*$",
855-
"thread backtrace -c %1") &&
854+
bt_regex_cmd_up->AddRegexCommand("^(-[^[:space:]].*)$", "thread backtrace %1") &&
856855
bt_regex_cmd_up->AddRegexCommand("^all[[:space:]]*$", "thread backtrace all") &&
857856
bt_regex_cmd_up->AddRegexCommand("^[[:space:]]*$", "thread backtrace")) {
858857
CommandObjectSP command_sp(bt_regex_cmd_up.release());

lldb/test/API/lang/cpp/std-function-recognizer/TestStdFunctionRecognizer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ def test_backtrace(self):
4646
"thread backtrace", matching=False, patterns=["frame.*std::__.*::__function"]
4747
)
4848
# Unfiltered.
49+
self.expect(
50+
"bt -u",
51+
ordered=True,
52+
patterns=["frame.*foo", "frame.*std::__[^:]*::__function", "frame.*main"],
53+
)
4954
self.expect(
5055
"thread backtrace -u",
5156
ordered=True,

0 commit comments

Comments
 (0)