diff options
author | Colin Riley <colin@codeplay.com> | 2015-05-04 18:39:38 +0000 |
---|---|---|
committer | Colin Riley <colin@codeplay.com> | 2015-05-04 18:39:38 +0000 |
commit | c9c55a26bd7fe1962ea1529ee0d0ccd0ea9f90da (patch) | |
tree | ac09f34d9dfecf32c8ca0e7c3528df34200e79af /lldb/source/Target/LanguageRuntime.cpp | |
parent | b61f06c9c252e11f633626555bb444f30eb2d8ec (diff) | |
download | bcm5719-llvm-c9c55a26bd7fe1962ea1529ee0d0ccd0ea9f90da.tar.gz bcm5719-llvm-c9c55a26bd7fe1962ea1529ee0d0ccd0ea9f90da.zip |
Add language command and LanguageRuntime plugin changes to allow vending of command objects.
Differential Revision: http://reviews.llvm.org/D9402
llvm-svn: 236443
Diffstat (limited to 'lldb/source/Target/LanguageRuntime.cpp')
-rw-r--r-- | lldb/source/Target/LanguageRuntime.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lldb/source/Target/LanguageRuntime.cpp b/lldb/source/Target/LanguageRuntime.cpp index 26e091e708f..6008cacd160 100644 --- a/lldb/source/Target/LanguageRuntime.cpp +++ b/lldb/source/Target/LanguageRuntime.cpp @@ -12,6 +12,7 @@ #include "lldb/Target/Target.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/SearchFilter.h" +#include "lldb/Interpreter/CommandInterpreter.h" using namespace lldb; using namespace lldb_private; @@ -418,6 +419,33 @@ LanguageRuntime::LanguageIsCPlusPlus (LanguageType language) } } +void +LanguageRuntime::InitializeCommands (CommandObject* parent) +{ + if (!parent) + return; + + if (!parent->IsMultiwordObject()) + return; + + LanguageRuntimeCreateInstance create_callback; + + for (uint32_t idx = 0; + (create_callback = PluginManager::GetLanguageRuntimeCreateCallbackAtIndex(idx)) != nullptr; + ++idx) + { + if (LanguageRuntimeGetCommandObject command_callback = + PluginManager::GetLanguageRuntimeGetCommandObjectAtIndex(idx)) + { + CommandObjectSP command = command_callback(parent->GetCommandInterpreter()); + if (command) + { + parent->LoadSubCommand(command->GetCommandName(), command); + } + } + } +} + lldb::SearchFilterSP LanguageRuntime::CreateExceptionSearchFilter () { |