This revision was automatically updated to reflect the committed changes. Closed by commit rGb95150418fb6: [lldb] Allow aliases to aliases of raw input commands (authored by kastiglione).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117259/new/ https://reviews.llvm.org/D117259 Files: lldb/source/Commands/CommandObjectCommands.cpp lldb/test/API/commands/command/nested_alias/TestNestedAlias.py Index: lldb/test/API/commands/command/nested_alias/TestNestedAlias.py =================================================================== --- lldb/test/API/commands/command/nested_alias/TestNestedAlias.py +++ lldb/test/API/commands/command/nested_alias/TestNestedAlias.py @@ -46,6 +46,8 @@ 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) @@ -96,3 +98,8 @@ '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$']) Index: lldb/source/Commands/CommandObjectCommands.cpp =================================================================== --- lldb/source/Commands/CommandObjectCommands.cpp +++ lldb/source/Commands/CommandObjectCommands.cpp @@ -485,8 +485,9 @@ 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(
Index: lldb/test/API/commands/command/nested_alias/TestNestedAlias.py =================================================================== --- lldb/test/API/commands/command/nested_alias/TestNestedAlias.py +++ lldb/test/API/commands/command/nested_alias/TestNestedAlias.py @@ -46,6 +46,8 @@ 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) @@ -96,3 +98,8 @@ '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$']) Index: lldb/source/Commands/CommandObjectCommands.cpp =================================================================== --- lldb/source/Commands/CommandObjectCommands.cpp +++ lldb/source/Commands/CommandObjectCommands.cpp @@ -485,8 +485,9 @@ 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(
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits