[Lldb-commits] [lldb] [lldb][lldb-dap] explicitly set the expr as an alias for expression. (PR #134562)

Ebuka Ezike via lldb-commits lldb-commits at lists.llvm.org
Sun Apr 6 14:41:25 PDT 2025


https://github.com/da-viper created https://github.com/llvm/llvm-project/pull/134562

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

>From be69e129667cac2ab75597bb3ed02f7d6da39bce Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <yerimyah1 at gmail.com>
Date: Sun, 6 Apr 2025 01:36:12 +0100
Subject: [PATCH] [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 {



More information about the lldb-commits mailing list