aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectCommands.cpp
diff options
context:
space:
mode:
authorDave Lee <davelee.com@gmail.com>2022-01-13 16:02:45 -0800
committerDave Lee <davelee.com@gmail.com>2022-01-21 17:57:34 -0800
commitb95150418fb6e2d22a0bd84abcdc1f3cc7e5a0bf (patch)
treea4f1f42f81f81512cb4ac39af8936eee9989ade9 /lldb/source/Commands/CommandObjectCommands.cpp
parent3726626a26ec7bfccfd526e02f89c1ac5fe3520a (diff)
downloadllvm-b95150418fb6e2d22a0bd84abcdc1f3cc7e5a0bf.zip
llvm-b95150418fb6e2d22a0bd84abcdc1f3cc7e5a0bf.tar.gz
llvm-b95150418fb6e2d22a0bd84abcdc1f3cc7e5a0bf.tar.bz2
[lldb] Allow aliases to aliases of raw input commands
Allow users to create aliases for aliases to raw input commands. That probably sounds convoluted, so here's an example: ``` command alias some-setup env SOMEVAR=SOMEVALUE ``` This an alias based on `env`, which itself is an alias for `_regex-env`. `_regex-env` is a `command regex` command, which takes raw input. The above `some-setup` alias fails with: ``` error: Unable to create requested alias. ``` This change allows such aliases to be created. lldb already supports aliases to aliases for parsed commands. Differential Revision: https://reviews.llvm.org/D117259
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index 1ec54cf..defa21a 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -485,8 +485,9 @@ protected:
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(