aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectSyntax.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-10-13 02:07:45 +0000
committerGreg Clayton <gclayton@apple.com>2012-10-13 02:07:45 +0000
commit998255bfe841a4191d458a56aae0267f673b1a72 (patch)
treeada5b24a203f1a24e041f9cce2188283d037de98 /lldb/source/Commands/CommandObjectSyntax.cpp
parent88db3171dd5dcc54e3890b6f823c60831fc520a5 (diff)
downloadllvm-998255bfe841a4191d458a56aae0267f673b1a72.zip
llvm-998255bfe841a4191d458a56aae0267f673b1a72.tar.gz
llvm-998255bfe841a4191d458a56aae0267f673b1a72.tar.bz2
<rdar://problem/12491387>
I added the ability for a process plug-in to implement custom commands. All the lldb_private::Process plug-in has to do is override: virtual CommandObject * GetPluginCommandObject(); This object returned should be a multi-word command that vends LLDB commands. There is a sample implementation in ProcessGDBRemote that is hollowed out. It is intended to be used for sending a custom packet, though the body of the command execute function has yet to be implemented! llvm-svn: 165861
Diffstat (limited to 'lldb/source/Commands/CommandObjectSyntax.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectSyntax.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lldb/source/Commands/CommandObjectSyntax.cpp b/lldb/source/Commands/CommandObjectSyntax.cpp
index d96542e..64308aa 100644
--- a/lldb/source/Commands/CommandObjectSyntax.cpp
+++ b/lldb/source/Commands/CommandObjectSyntax.cpp
@@ -66,14 +66,12 @@ CommandObjectSyntax::DoExecute (Args& command, CommandReturnObject &result)
for (int i = 1; i < argc; ++i)
{
std::string sub_command = command.GetArgumentAtIndex (i);
- if (! cmd_obj->IsMultiwordObject())
+ if (!cmd_obj->IsMultiwordObject())
all_okay = false;
else
{
- pos = ((CommandObjectMultiword *) cmd_obj)->m_subcommand_dict.find (sub_command);
- if (pos != ((CommandObjectMultiword *) cmd_obj)->m_subcommand_dict.end())
- cmd_obj = pos->second.get();
- else
+ cmd_obj = cmd_obj->GetSubcommandObject(sub_command.c_str());
+ if (!cmd_obj)
all_okay = false;
}
}