https://github.com/kastiglione updated https://github.com/llvm/llvm-project/pull/116260
>From bc771d2c7dc223c353fbfca9dbe491e08311950b Mon Sep 17 00:00:00 2001 From: Dave Lee <davelee....@gmail.com> Date: Thu, 14 Nov 2024 09:03:33 -0800 Subject: [PATCH 1/2] [lldb] Support any flag to _regexp-bt In particular, this allows `bt -u`. --- lldb/source/Interpreter/CommandInterpreter.cpp | 3 +-- .../cpp/std-function-recognizer/TestStdFunctionRecognizer.py | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index f2712af0a08a73..2cdf5e6da6fd13 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("^(-.*)$", "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, >From fe72e0df59676fbcd44964f8b3dccd675920d886 Mon Sep 17 00:00:00 2001 From: Dave Lee <davelee....@gmail.com> Date: Thu, 14 Nov 2024 09:26:14 -0800 Subject: [PATCH 2/2] Use -.+ instead of -.* --- lldb/source/Interpreter/CommandInterpreter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 2cdf5e6da6fd13..c1404539bb8e14 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -851,7 +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("^(-.*)$", "thread backtrace %1") && + bt_regex_cmd_up->AddRegexCommand("^(-.+)$", "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()); _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits