kastiglione created this revision.
kastiglione added a reviewer: jingham.
Herald added a subscriber: jeroen.dobbelaere.
kastiglione requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
Allow users to create aliases which invoke aliases to command-regex. That
probably sounds convoluted, so here's an example:
command alias some-setup env SOMEVAR=SOMEVALUE
This an alias that invokes `env`, which is an alias for `_regex-env`, and
`_regex-env` is a `command regex`.
The above command fails with:
error: Unable to create requested alias.
This change allows such aliases to be created.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D117259
Files:
lldb/source/Commands/CommandObjectCommands.cpp
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/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
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits