summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/PluginManager.cpp
diff options
context:
space:
mode:
authorColin Riley <colin@codeplay.com>2015-05-04 18:39:38 +0000
committerColin Riley <colin@codeplay.com>2015-05-04 18:39:38 +0000
commitc9c55a26bd7fe1962ea1529ee0d0ccd0ea9f90da (patch)
treeac09f34d9dfecf32c8ca0e7c3528df34200e79af /lldb/source/Core/PluginManager.cpp
parentb61f06c9c252e11f633626555bb444f30eb2d8ec (diff)
downloadbcm5719-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/Core/PluginManager.cpp')
-rw-r--r--lldb/source/Core/PluginManager.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp
index 95574cb2dea..67581b58813 100644
--- a/lldb/source/Core/PluginManager.cpp
+++ b/lldb/source/Core/PluginManager.cpp
@@ -885,6 +885,7 @@ struct LanguageRuntimeInstance
ConstString name;
std::string description;
LanguageRuntimeCreateInstance create_callback;
+ LanguageRuntimeGetCommandObject command_callback;
};
typedef std::vector<LanguageRuntimeInstance> LanguageRuntimeInstances;
@@ -908,7 +909,8 @@ PluginManager::RegisterPlugin
(
const ConstString &name,
const char *description,
- LanguageRuntimeCreateInstance create_callback
+ LanguageRuntimeCreateInstance create_callback,
+ LanguageRuntimeGetCommandObject command_callback
)
{
if (create_callback)
@@ -919,6 +921,7 @@ PluginManager::RegisterPlugin
if (description && description[0])
instance.description = description;
instance.create_callback = create_callback;
+ instance.command_callback = command_callback;
Mutex::Locker locker (GetLanguageRuntimeMutex ());
GetLanguageRuntimeInstances ().push_back (instance);
}
@@ -956,6 +959,16 @@ PluginManager::GetLanguageRuntimeCreateCallbackAtIndex (uint32_t idx)
return NULL;
}
+LanguageRuntimeGetCommandObject
+PluginManager::GetLanguageRuntimeGetCommandObjectAtIndex (uint32_t idx)
+{
+ Mutex::Locker locker (GetLanguageRuntimeMutex ());
+ LanguageRuntimeInstances &instances = GetLanguageRuntimeInstances ();
+ if (idx < instances.size())
+ return instances[idx].command_callback;
+ return NULL;
+}
+
LanguageRuntimeCreateInstance
PluginManager::GetLanguageRuntimeCreateCallbackForPluginName (const ConstString &name)
{
OpenPOWER on IntegriCloud