summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/PluginManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core/PluginManager.cpp')
-rw-r--r--lldb/source/Core/PluginManager.cpp55
1 files changed, 39 insertions, 16 deletions
diff --git a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp
index 4498182e754..0cc916b115d 100644
--- a/lldb/source/Core/PluginManager.cpp
+++ b/lldb/source/Core/PluginManager.cpp
@@ -870,7 +870,9 @@ struct ObjectFileInstance
ObjectFileInstance() :
name(),
description(),
- create_callback(NULL)
+ create_callback(NULL),
+ create_memory_callback (NULL),
+ get_module_specifications (NULL)
{
}
@@ -878,7 +880,7 @@ struct ObjectFileInstance
std::string description;
ObjectFileCreateInstance create_callback;
ObjectFileCreateMemoryInstance create_memory_callback;
-
+ ObjectFileGetModuleSpecifications get_module_specifications;
};
typedef std::vector<ObjectFileInstance> ObjectFileInstances;
@@ -899,13 +901,11 @@ GetObjectFileInstances ()
bool
-PluginManager::RegisterPlugin
-(
- const char *name,
- const char *description,
- ObjectFileCreateInstance create_callback,
- ObjectFileCreateMemoryInstance create_memory_callback
-)
+PluginManager::RegisterPlugin (const char *name,
+ const char *description,
+ ObjectFileCreateInstance create_callback,
+ ObjectFileCreateMemoryInstance create_memory_callback,
+ ObjectFileGetModuleSpecifications get_module_specifications)
{
if (create_callback)
{
@@ -916,6 +916,7 @@ PluginManager::RegisterPlugin
instance.description = description;
instance.create_callback = create_callback;
instance.create_memory_callback = create_memory_callback;
+ instance.get_module_specifications = get_module_specifications;
Mutex::Locker locker (GetObjectFileMutex ());
GetObjectFileInstances ().push_back (instance);
}
@@ -964,6 +965,16 @@ PluginManager::GetObjectFileCreateMemoryCallbackAtIndex (uint32_t idx)
return NULL;
}
+ObjectFileGetModuleSpecifications
+PluginManager::GetObjectFileGetModuleSpecificationsCallbackAtIndex (uint32_t idx)
+{
+ Mutex::Locker locker (GetObjectFileMutex ());
+ ObjectFileInstances &instances = GetObjectFileInstances ();
+ if (idx < instances.size())
+ return instances[idx].get_module_specifications;
+ return NULL;
+}
+
ObjectFileCreateInstance
PluginManager::GetObjectFileCreateCallbackForPluginName (const char *name)
{
@@ -1012,13 +1023,16 @@ struct ObjectContainerInstance
ObjectContainerInstance() :
name(),
description(),
- create_callback(NULL)
+ create_callback (NULL),
+ get_module_specifications (NULL)
{
}
std::string name;
std::string description;
ObjectContainerCreateInstance create_callback;
+ ObjectFileGetModuleSpecifications get_module_specifications;
+
};
typedef std::vector<ObjectContainerInstance> ObjectContainerInstances;
@@ -1038,12 +1052,10 @@ GetObjectContainerInstances ()
}
bool
-PluginManager::RegisterPlugin
-(
- const char *name,
- const char *description,
- ObjectContainerCreateInstance create_callback
-)
+PluginManager::RegisterPlugin (const char *name,
+ const char *description,
+ ObjectContainerCreateInstance create_callback,
+ ObjectFileGetModuleSpecifications get_module_specifications)
{
if (create_callback)
{
@@ -1053,6 +1065,7 @@ PluginManager::RegisterPlugin
if (description && description[0])
instance.description = description;
instance.create_callback = create_callback;
+ instance.get_module_specifications = get_module_specifications;
Mutex::Locker locker (GetObjectContainerMutex ());
GetObjectContainerInstances ().push_back (instance);
}
@@ -1109,6 +1122,16 @@ PluginManager::GetObjectContainerCreateCallbackForPluginName (const char *name)
return NULL;
}
+ObjectFileGetModuleSpecifications
+PluginManager::GetObjectContainerGetModuleSpecificationsCallbackAtIndex (uint32_t idx)
+{
+ Mutex::Locker locker (GetObjectContainerMutex ());
+ ObjectContainerInstances &instances = GetObjectContainerInstances ();
+ if (idx < instances.size())
+ return instances[idx].get_module_specifications;
+ return NULL;
+}
+
#pragma mark LogChannel
struct LogInstance
OpenPOWER on IntegriCloud