Skip to content

[lldb] Allow aliases to aliases of raw input commands #3832

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
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
5 changes: 3 additions & 2 deletions lldb/source/Commands/CommandObjectCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,9 @@ rather than using a positional placeholder:"
OptionArgVectorSP option_arg_vector_sp =
OptionArgVectorSP(new OptionArgVector);

if (CommandObjectSP cmd_obj_sp =
m_interpreter.GetCommandSPExact(cmd_obj.GetCommandName())) {
const bool include_aliases = true;
if (CommandObjectSP cmd_obj_sp = m_interpreter.GetCommandSPExact(
cmd_obj.GetCommandName(), include_aliases)) {
if (m_interpreter.AliasExists(alias_command) ||
m_interpreter.UserCommandExists(alias_command)) {
result.AppendWarningWithFormat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def cleanup():
self.runCmd('command unalias rd', check=False)
self.runCmd('command unalias fo', check=False)
self.runCmd('command unalias foself', check=False)
self.runCmd('command unalias add_two', check=False)
self.runCmd('command unalias two', check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down Expand Up @@ -97,3 +99,8 @@ def cleanup():
'Show variables for the current',
'stack frame.'],
matching=True)

# Check that aliases can be created for raw input commands.
self.expect('command alias two expr -- 2')
self.expect('command alias add_two two +')
self.expect('add_two 3', patterns=[' = 5$'])