summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 34574d46853..6eba2124942 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -3172,8 +3172,12 @@ CommandInterpreter::ResolveCommandImpl(std::string &command_line, CommandReturnO
if (cmd_obj == nullptr)
{
std::string full_name;
- if (GetAliasFullName(next_word.c_str(), full_name))
+ bool is_alias = GetAliasFullName(next_word.c_str(), full_name);
+ cmd_obj = GetCommandObject(next_word.c_str(), &matches);
+ bool is_real_command = (is_alias == false) || (cmd_obj != nullptr && cmd_obj->IsAlias() == false);
+ if (!is_real_command)
{
+ matches.Clear();
std::string alias_result;
cmd_obj = BuildAliasResult(full_name.c_str(), scratch_command, alias_result, result);
revised_command_line.Printf("%s", alias_result.c_str());
@@ -3185,7 +3189,8 @@ CommandInterpreter::ResolveCommandImpl(std::string &command_line, CommandReturnO
}
else
{
- cmd_obj = GetCommandObject(next_word.c_str(), &matches);
+ if (!cmd_obj)
+ cmd_obj = GetCommandObject(next_word.c_str(), &matches);
if (cmd_obj)
{
actual_cmd_name_len += strlen(cmd_obj->GetCommandName());
OpenPOWER on IntegriCloud