Skip to content

Commit 60e3a81

Browse files
authored
[lldb] Add builtin e alias for expression (#115359)
The changes in 461f859 (#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`.
1 parent 200afcf commit 60e3a81

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
@@ -441,6 +441,8 @@ void CommandInterpreter::Initialize() {
441441

442442
cmd_obj_sp = GetCommandSPExact("expression");
443443
if (cmd_obj_sp) {
444+
// Ensure `e` runs `expression`.
445+
AddAlias("e", cmd_obj_sp);
444446
AddAlias("call", cmd_obj_sp, "--")->SetHelpLong("");
445447
CommandAlias *parray_alias =
446448
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)