https://github.com/da-viper updated https://github.com/llvm/llvm-project/pull/134562
>From be69e129667cac2ab75597bb3ed02f7d6da39bce Mon Sep 17 00:00:00 2001 From: Ebuka Ezike <yerimy...@gmail.com> Date: Sun, 6 Apr 2025 01:36:12 +0100 Subject: [PATCH 1/3] [lldb][lldb-dap] explicitly set the expr as an alias for expression. dap console does not recognise `expr` as a command because it is not explicitly set. It works fine in normal lldb because it is gotten from approximate match which is not available in the SBAPI --- lldb/source/Interpreter/CommandInterpreter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 112d2f20fda41..a4071f5f0a602 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -444,6 +444,7 @@ void CommandInterpreter::Initialize() { if (cmd_obj_sp) { // Ensure `e` runs `expression`. AddAlias("e", cmd_obj_sp); + AddAlias("expr", cmd_obj_sp); AddAlias("call", cmd_obj_sp, "--")->SetHelpLong(""); CommandAlias *parray_alias = AddAlias("parray", cmd_obj_sp, "--element-count %1 --"); @@ -1376,7 +1377,9 @@ bool CommandInterpreter::GetAliasFullName(llvm::StringRef cmd, } bool CommandInterpreter::AliasExists(llvm::StringRef cmd) const { - return m_alias_dict.find(cmd) != m_alias_dict.end(); + std::string alias_name; + return GetAliasFullName(cmd, alias_name); + // return m_alias_dict.find(cmd) != m_alias_dict.end(); } bool CommandInterpreter::UserCommandExists(llvm::StringRef cmd) const { >From 7deb08ff1cf11e854f45f6dfaad30a640eb6b3c3 Mon Sep 17 00:00:00 2001 From: Ebuka Ezike <yerimy...@gmail.com> Date: Sun, 6 Apr 2025 23:02:04 +0100 Subject: [PATCH 2/3] [lldb][lldb-dap] explicitly set the expr as an alias for expression. dap console does not recognise `expr` as a command because it is not explicitly set. It works fine in normal lldb because it is gotten from approximate match which is not available in the SBAPI --- lldb/source/Interpreter/CommandInterpreter.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index a4071f5f0a602..2e4c40ca53176 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -1377,9 +1377,14 @@ bool CommandInterpreter::GetAliasFullName(llvm::StringRef cmd, } bool CommandInterpreter::AliasExists(llvm::StringRef cmd) const { - std::string alias_name; - return GetAliasFullName(cmd, alias_name); - // return m_alias_dict.find(cmd) != m_alias_dict.end(); + const bool exact_match = (m_alias_dict.find(cmd) != m_alias_dict.end()); + if (exact_match) + return true; + + StringList matches; + const int num_cmd_matches = + AddNamesMatchingPartialString(m_command_dict, cmd, matches); + return num_cmd_matches > 0; } bool CommandInterpreter::UserCommandExists(llvm::StringRef cmd) const { >From ea645d2a4964f5b7f5cbd77f0b1e9bd07699ac23 Mon Sep 17 00:00:00 2001 From: Ebuka Ezike <yerimy...@gmail.com> Date: Sun, 13 Apr 2025 15:16:30 +0100 Subject: [PATCH 3/3] [lldb][lldb-dap] Revert matching alias partial string --- lldb/source/Interpreter/CommandInterpreter.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 2e4c40ca53176..0e063924388a4 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -1377,14 +1377,7 @@ bool CommandInterpreter::GetAliasFullName(llvm::StringRef cmd, } bool CommandInterpreter::AliasExists(llvm::StringRef cmd) const { - const bool exact_match = (m_alias_dict.find(cmd) != m_alias_dict.end()); - if (exact_match) - return true; - - StringList matches; - const int num_cmd_matches = - AddNamesMatchingPartialString(m_command_dict, cmd, matches); - return num_cmd_matches > 0; + return m_alias_dict.find(cmd) != m_alias_dict.end(); } bool CommandInterpreter::UserCommandExists(llvm::StringRef cmd) const { _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits