diff options
Diffstat (limited to 'source/Core/PluginManager.cpp')
-rw-r--r-- | source/Core/PluginManager.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source/Core/PluginManager.cpp b/source/Core/PluginManager.cpp index 95574cb..e34b7fc 100644 --- a/source/Core/PluginManager.cpp +++ b/source/Core/PluginManager.cpp @@ -7,8 +7,6 @@ // //===----------------------------------------------------------------------===// -#include "lldb/lldb-python.h" - #include "lldb/Core/PluginManager.h" #include <limits.h> @@ -885,6 +883,7 @@ struct LanguageRuntimeInstance ConstString name; std::string description; LanguageRuntimeCreateInstance create_callback; + LanguageRuntimeGetCommandObject command_callback; }; typedef std::vector<LanguageRuntimeInstance> LanguageRuntimeInstances; @@ -908,7 +907,8 @@ PluginManager::RegisterPlugin ( const ConstString &name, const char *description, - LanguageRuntimeCreateInstance create_callback + LanguageRuntimeCreateInstance create_callback, + LanguageRuntimeGetCommandObject command_callback ) { if (create_callback) @@ -919,6 +919,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 +957,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) { |