Skip to content

[lldb] Add builtin e alias for expression #115359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lldb/source/Interpreter/CommandInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ void CommandInterpreter::Initialize() {

cmd_obj_sp = GetCommandSPExact("expression");
if (cmd_obj_sp) {
// Ensure `e` runs `expression`.
AddAlias("e", cmd_obj_sp);
AddAlias("call", cmd_obj_sp, "--")->SetHelpLong("");
CommandAlias *parray_alias =
AddAlias("parray", cmd_obj_sp, "--element-count %1 --");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ def test_command_abbreviations_and_aliases(self):
self.assertTrue(result.Succeeded())
self.assertEqual("apropos script", result.GetOutput())

command_interpreter.ResolveCommand("e", result)
self.assertTrue(result.Succeeded())
self.assertEqual("expression", result.GetOutput())

command_interpreter.ResolveCommand("h", result)
self.assertTrue(result.Succeeded())
self.assertEqual("help", result.GetOutput())
Expand Down
Loading