Skip to content

Commit aa88758

Browse files
committed
[lldb] Add builtin e alias for expression (llvm#115359)
The changes in 461f859 (llvm#65974) resulted in a change in behavior not just for completion, but also for selection of inexect commands. Since many use `e` to mean `expression`, this change adds an alias for `e`. Note that the referenced change similarly aliases `h` to `help`. (cherry picked from commit 60e3a81)
1 parent e09264f commit aa88758

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lldb/source/Interpreter/CommandInterpreter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@ void CommandInterpreter::Initialize() {
442442

443443
cmd_obj_sp = GetCommandSPExact("expression");
444444
if (cmd_obj_sp) {
445+
// Ensure `e` runs `expression`.
446+
AddAlias("e", cmd_obj_sp);
445447
AddAlias("call", cmd_obj_sp, "--")->SetHelpLong("");
446448
CommandAlias *parray_alias =
447449
AddAlias("parray", cmd_obj_sp, "--element-count %1 --");

lldb/test/API/functionalities/abbreviation/TestAbbreviations.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ def test_command_abbreviations_and_aliases(self):
2020
self.assertTrue(result.Succeeded())
2121
self.assertEqual("apropos script", result.GetOutput())
2222

23+
command_interpreter.ResolveCommand("e", result)
24+
self.assertTrue(result.Succeeded())
25+
self.assertEqual("expression", result.GetOutput())
26+
2327
command_interpreter.ResolveCommand("h", result)
2428
self.assertTrue(result.Succeeded())
2529
self.assertEqual("help", result.GetOutput())

0 commit comments

Comments
 (0)