Skip to content

Commit ca43d6d

Browse files
authored
Merge pull request #3832 from apple/lldb-Allow-aliases-to-aliases-of-raw-input-commands
[lldb] Allow aliases to aliases of raw input commands
2 parents acfbd1b + 35ef4fa commit ca43d6d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lldb/source/Commands/CommandObjectCommands.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,9 @@ rather than using a positional placeholder:"
485485
OptionArgVectorSP option_arg_vector_sp =
486486
OptionArgVectorSP(new OptionArgVector);
487487

488-
if (CommandObjectSP cmd_obj_sp =
489-
m_interpreter.GetCommandSPExact(cmd_obj.GetCommandName())) {
488+
const bool include_aliases = true;
489+
if (CommandObjectSP cmd_obj_sp = m_interpreter.GetCommandSPExact(
490+
cmd_obj.GetCommandName(), include_aliases)) {
490491
if (m_interpreter.AliasExists(alias_command) ||
491492
m_interpreter.UserCommandExists(alias_command)) {
492493
result.AppendWarningWithFormat(

lldb/test/API/commands/command/nested_alias/TestNestedAlias.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def cleanup():
4747
self.runCmd('command unalias rd', check=False)
4848
self.runCmd('command unalias fo', check=False)
4949
self.runCmd('command unalias foself', check=False)
50+
self.runCmd('command unalias add_two', check=False)
51+
self.runCmd('command unalias two', check=False)
5052

5153
# Execute the cleanup function during test case tear down.
5254
self.addTearDownHook(cleanup)
@@ -97,3 +99,8 @@ def cleanup():
9799
'Show variables for the current',
98100
'stack frame.'],
99101
matching=True)
102+
103+
# Check that aliases can be created for raw input commands.
104+
self.expect('command alias two expr -- 2')
105+
self.expect('command alias add_two two +')
106+
self.expect('add_two 3', patterns=[' = 5$'])

0 commit comments

Comments
 (0)