summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectMultiword.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-12-01 01:04:22 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-12-01 01:04:22 +0000
commitce81496fab8cea588631dded376a88de347c58f0 (patch)
treed4d4e6de72e4fbccb57a795d13f612230adbc3aa /lldb/source/Commands/CommandObjectMultiword.cpp
parent19e302bc700d02913490537169ace6450b4913f4 (diff)
downloadbcm5719-llvm-ce81496fab8cea588631dded376a88de347c58f0.tar.gz
bcm5719-llvm-ce81496fab8cea588631dded376a88de347c58f0.zip
Make CommandObjectMultiword::GetSubcommandSP() more robust by appending the
exactly-matched sub_cmd to the passed in 'matches' string list. llvm-svn: 120516
Diffstat (limited to 'lldb/source/Commands/CommandObjectMultiword.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectMultiword.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp
index aafd0f8147d..db500a7f66c 100644
--- a/lldb/source/Commands/CommandObjectMultiword.cpp
+++ b/lldb/source/Commands/CommandObjectMultiword.cpp
@@ -49,8 +49,12 @@ CommandObjectMultiword::GetSubcommandSP (const char *sub_cmd, StringList *matche
if (!m_subcommand_dict.empty())
{
pos = m_subcommand_dict.find (sub_cmd);
- if (pos != m_subcommand_dict.end())
+ if (pos != m_subcommand_dict.end()) {
+ // An exact match; append the sub_cmd to the 'matches' string list.
+ if (matches)
+ matches->AppendString(sub_cmd);
return_cmd_sp = pos->second;
+ }
else
{
OpenPOWER on IntegriCloud