1 //===-- PluginManager.cpp ---------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "lldb/lldb-python.h"
12 #include "lldb/Core/PluginManager.h"
19 #include "lldb/Core/Debugger.h"
20 #include "lldb/Core/Error.h"
21 #include "lldb/Host/FileSpec.h"
22 #include "lldb/Host/Host.h"
23 #include "lldb/Host/Mutex.h"
24 #include "lldb/Interpreter/OptionValueProperties.h"
26 #include "llvm/ADT/StringRef.h"
29 using namespace lldb_private;
33 ePluginRegisterInstance,
34 ePluginUnregisterInstance,
35 ePluginGetInstanceAtIndex
39 typedef bool (*PluginInitCallback) (void);
40 typedef void (*PluginTermCallback) (void);
45 PluginInitCallback plugin_init_callback;
46 PluginTermCallback plugin_term_callback;
49 typedef std::map<FileSpec, PluginInfo> PluginTerminateMap;
54 static Mutex g_plugin_map_mutex (Mutex::eMutexTypeRecursive);
55 return g_plugin_map_mutex;
58 static PluginTerminateMap &
61 static PluginTerminateMap g_plugin_map;
66 PluginIsLoaded (const FileSpec &plugin_file_spec)
68 Mutex::Locker locker (GetPluginMapMutex ());
69 PluginTerminateMap &plugin_map = GetPluginMap ();
70 return plugin_map.find (plugin_file_spec) != plugin_map.end();
74 SetPluginInfo (const FileSpec &plugin_file_spec, const PluginInfo &plugin_info)
76 Mutex::Locker locker (GetPluginMapMutex ());
77 PluginTerminateMap &plugin_map = GetPluginMap ();
78 assert (plugin_map.find (plugin_file_spec) == plugin_map.end());
79 plugin_map[plugin_file_spec] = plugin_info;
83 static FileSpec::EnumerateDirectoryResult
87 FileSpec::FileType file_type,
88 const FileSpec &file_spec
91 // PluginManager *plugin_manager = (PluginManager *)baton;
94 // If we have a regular file, a symbolic link or unknown file type, try
95 // and process the file. We must handle unknown as sometimes the directory
96 // enumeration might be enumerating a file system that doesn't have correct
97 // file type information.
98 if (file_type == FileSpec::eFileTypeRegular ||
99 file_type == FileSpec::eFileTypeSymbolicLink ||
100 file_type == FileSpec::eFileTypeUnknown )
102 FileSpec plugin_file_spec (file_spec);
103 plugin_file_spec.ResolvePath();
105 if (PluginIsLoaded (plugin_file_spec))
106 return FileSpec::eEnumerateDirectoryResultNext;
109 PluginInfo plugin_info = { NULL, NULL, NULL };
110 uint32_t flags = Host::eDynamicLibraryOpenOptionLazy |
111 Host::eDynamicLibraryOpenOptionLocal |
112 Host::eDynamicLibraryOpenOptionLimitGetSymbol;
114 plugin_info.plugin_handle = Host::DynamicLibraryOpen (plugin_file_spec, flags, error);
115 if (plugin_info.plugin_handle)
117 bool success = false;
118 plugin_info.plugin_init_callback = (PluginInitCallback)Host::DynamicLibraryGetSymbol (plugin_info.plugin_handle, "LLDBPluginInitialize", error);
119 if (plugin_info.plugin_init_callback)
121 // Call the plug-in "bool LLDBPluginInitialize(void)" function
122 success = plugin_info.plugin_init_callback();
127 // It is ok for the "LLDBPluginTerminate" symbol to be NULL
128 plugin_info.plugin_term_callback = (PluginTermCallback)Host::DynamicLibraryGetSymbol (plugin_info.plugin_handle, "LLDBPluginTerminate", error);
132 // The initialize function returned FALSE which means the
133 // plug-in might not be compatible, or might be too new or
134 // too old, or might not want to run on this machine.
135 Host::DynamicLibraryClose (plugin_info.plugin_handle);
136 plugin_info.plugin_handle = NULL;
137 plugin_info.plugin_init_callback = NULL;
140 // Regardless of success or failure, cache the plug-in load
141 // in our plug-in info so we don't try to load it again and
143 SetPluginInfo (plugin_file_spec, plugin_info);
145 return FileSpec::eEnumerateDirectoryResultNext;
150 if (file_type == FileSpec::eFileTypeUnknown ||
151 file_type == FileSpec::eFileTypeDirectory ||
152 file_type == FileSpec::eFileTypeSymbolicLink )
154 // Try and recurse into anything that a directory or symbolic link.
155 // We must also do this for unknown as sometimes the directory enumeration
156 // might be enurating a file system that doesn't have correct file type
158 return FileSpec::eEnumerateDirectoryResultEnter;
161 return FileSpec::eEnumerateDirectoryResultNext;
166 PluginManager::Initialize ()
170 const bool find_directories = true;
171 const bool find_files = true;
172 const bool find_other = true;
173 char dir_path[PATH_MAX];
174 if (Host::GetLLDBPath (ePathTypeLLDBSystemPlugins, dir_spec))
176 if (dir_spec.Exists() && dir_spec.GetPath(dir_path, sizeof(dir_path)))
178 FileSpec::EnumerateDirectory (dir_path,
187 if (Host::GetLLDBPath (ePathTypeLLDBUserPlugins, dir_spec))
189 if (dir_spec.Exists() && dir_spec.GetPath(dir_path, sizeof(dir_path)))
191 FileSpec::EnumerateDirectory (dir_path,
203 PluginManager::Terminate ()
205 Mutex::Locker locker (GetPluginMapMutex ());
206 PluginTerminateMap &plugin_map = GetPluginMap ();
208 PluginTerminateMap::const_iterator pos, end = plugin_map.end();
209 for (pos = plugin_map.begin(); pos != end; ++pos)
211 // Call the plug-in "void LLDBPluginTerminate (void)" function if there
212 // is one (if the symbol was not NULL).
213 if (pos->second.plugin_handle)
215 if (pos->second.plugin_term_callback)
216 pos->second.plugin_term_callback();
217 Host::DynamicLibraryClose (pos->second.plugin_handle);
232 create_callback(NULL)
237 std::string description;
238 ABICreateInstance create_callback;
241 typedef std::vector<ABIInstance> ABIInstances;
244 GetABIInstancesMutex ()
246 static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);
247 return g_instances_mutex;
250 static ABIInstances &
253 static ABIInstances g_instances;
258 PluginManager::RegisterPlugin
260 const ConstString &name,
261 const char *description,
262 ABICreateInstance create_callback
267 ABIInstance instance;
269 instance.name = name;
270 if (description && description[0])
271 instance.description = description;
272 instance.create_callback = create_callback;
273 Mutex::Locker locker (GetABIInstancesMutex ());
274 GetABIInstances ().push_back (instance);
281 PluginManager::UnregisterPlugin (ABICreateInstance create_callback)
285 Mutex::Locker locker (GetABIInstancesMutex ());
286 ABIInstances &instances = GetABIInstances ();
288 ABIInstances::iterator pos, end = instances.end();
289 for (pos = instances.begin(); pos != end; ++ pos)
291 if (pos->create_callback == create_callback)
293 instances.erase(pos);
302 PluginManager::GetABICreateCallbackAtIndex (uint32_t idx)
304 Mutex::Locker locker (GetABIInstancesMutex ());
305 ABIInstances &instances = GetABIInstances ();
306 if (idx < instances.size())
307 return instances[idx].create_callback;
312 PluginManager::GetABICreateCallbackForPluginName (const ConstString &name)
316 Mutex::Locker locker (GetABIInstancesMutex ());
317 ABIInstances &instances = GetABIInstances ();
319 ABIInstances::iterator pos, end = instances.end();
320 for (pos = instances.begin(); pos != end; ++ pos)
322 if (name == pos->name)
323 return pos->create_callback;
330 #pragma mark Disassembler
333 struct DisassemblerInstance
335 DisassemblerInstance() :
338 create_callback(NULL)
343 std::string description;
344 DisassemblerCreateInstance create_callback;
347 typedef std::vector<DisassemblerInstance> DisassemblerInstances;
350 GetDisassemblerMutex ()
352 static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);
353 return g_instances_mutex;
356 static DisassemblerInstances &
357 GetDisassemblerInstances ()
359 static DisassemblerInstances g_instances;
364 PluginManager::RegisterPlugin
366 const ConstString &name,
367 const char *description,
368 DisassemblerCreateInstance create_callback
373 DisassemblerInstance instance;
375 instance.name = name;
376 if (description && description[0])
377 instance.description = description;
378 instance.create_callback = create_callback;
379 Mutex::Locker locker (GetDisassemblerMutex ());
380 GetDisassemblerInstances ().push_back (instance);
387 PluginManager::UnregisterPlugin (DisassemblerCreateInstance create_callback)
391 Mutex::Locker locker (GetDisassemblerMutex ());
392 DisassemblerInstances &instances = GetDisassemblerInstances ();
394 DisassemblerInstances::iterator pos, end = instances.end();
395 for (pos = instances.begin(); pos != end; ++ pos)
397 if (pos->create_callback == create_callback)
399 instances.erase(pos);
407 DisassemblerCreateInstance
408 PluginManager::GetDisassemblerCreateCallbackAtIndex (uint32_t idx)
410 Mutex::Locker locker (GetDisassemblerMutex ());
411 DisassemblerInstances &instances = GetDisassemblerInstances ();
412 if (idx < instances.size())
413 return instances[idx].create_callback;
417 DisassemblerCreateInstance
418 PluginManager::GetDisassemblerCreateCallbackForPluginName (const ConstString &name)
422 Mutex::Locker locker (GetDisassemblerMutex ());
423 DisassemblerInstances &instances = GetDisassemblerInstances ();
425 DisassemblerInstances::iterator pos, end = instances.end();
426 for (pos = instances.begin(); pos != end; ++ pos)
428 if (name == pos->name)
429 return pos->create_callback;
437 #pragma mark DynamicLoader
440 struct DynamicLoaderInstance
442 DynamicLoaderInstance() :
445 create_callback(NULL),
446 debugger_init_callback (NULL)
451 std::string description;
452 DynamicLoaderCreateInstance create_callback;
453 DebuggerInitializeCallback debugger_init_callback;
456 typedef std::vector<DynamicLoaderInstance> DynamicLoaderInstances;
460 GetDynamicLoaderMutex ()
462 static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);
463 return g_instances_mutex;
466 static DynamicLoaderInstances &
467 GetDynamicLoaderInstances ()
469 static DynamicLoaderInstances g_instances;
475 PluginManager::RegisterPlugin
477 const ConstString &name,
478 const char *description,
479 DynamicLoaderCreateInstance create_callback,
480 DebuggerInitializeCallback debugger_init_callback
485 DynamicLoaderInstance instance;
487 instance.name = name;
488 if (description && description[0])
489 instance.description = description;
490 instance.create_callback = create_callback;
491 instance.debugger_init_callback = debugger_init_callback;
492 Mutex::Locker locker (GetDynamicLoaderMutex ());
493 GetDynamicLoaderInstances ().push_back (instance);
499 PluginManager::UnregisterPlugin (DynamicLoaderCreateInstance create_callback)
503 Mutex::Locker locker (GetDynamicLoaderMutex ());
504 DynamicLoaderInstances &instances = GetDynamicLoaderInstances ();
506 DynamicLoaderInstances::iterator pos, end = instances.end();
507 for (pos = instances.begin(); pos != end; ++ pos)
509 if (pos->create_callback == create_callback)
511 instances.erase(pos);
519 DynamicLoaderCreateInstance
520 PluginManager::GetDynamicLoaderCreateCallbackAtIndex (uint32_t idx)
522 Mutex::Locker locker (GetDynamicLoaderMutex ());
523 DynamicLoaderInstances &instances = GetDynamicLoaderInstances ();
524 if (idx < instances.size())
525 return instances[idx].create_callback;
529 DynamicLoaderCreateInstance
530 PluginManager::GetDynamicLoaderCreateCallbackForPluginName (const ConstString &name)
534 Mutex::Locker locker (GetDynamicLoaderMutex ());
535 DynamicLoaderInstances &instances = GetDynamicLoaderInstances ();
537 DynamicLoaderInstances::iterator pos, end = instances.end();
538 for (pos = instances.begin(); pos != end; ++ pos)
540 if (name == pos->name)
541 return pos->create_callback;
547 #pragma mark EmulateInstruction
550 struct EmulateInstructionInstance
552 EmulateInstructionInstance() :
555 create_callback(NULL)
560 std::string description;
561 EmulateInstructionCreateInstance create_callback;
564 typedef std::vector<EmulateInstructionInstance> EmulateInstructionInstances;
567 GetEmulateInstructionMutex ()
569 static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);
570 return g_instances_mutex;
573 static EmulateInstructionInstances &
574 GetEmulateInstructionInstances ()
576 static EmulateInstructionInstances g_instances;
582 PluginManager::RegisterPlugin
584 const ConstString &name,
585 const char *description,
586 EmulateInstructionCreateInstance create_callback
591 EmulateInstructionInstance instance;
593 instance.name = name;
594 if (description && description[0])
595 instance.description = description;
596 instance.create_callback = create_callback;
597 Mutex::Locker locker (GetEmulateInstructionMutex ());
598 GetEmulateInstructionInstances ().push_back (instance);
604 PluginManager::UnregisterPlugin (EmulateInstructionCreateInstance create_callback)
608 Mutex::Locker locker (GetEmulateInstructionMutex ());
609 EmulateInstructionInstances &instances = GetEmulateInstructionInstances ();
611 EmulateInstructionInstances::iterator pos, end = instances.end();
612 for (pos = instances.begin(); pos != end; ++ pos)
614 if (pos->create_callback == create_callback)
616 instances.erase(pos);
624 EmulateInstructionCreateInstance
625 PluginManager::GetEmulateInstructionCreateCallbackAtIndex (uint32_t idx)
627 Mutex::Locker locker (GetEmulateInstructionMutex ());
628 EmulateInstructionInstances &instances = GetEmulateInstructionInstances ();
629 if (idx < instances.size())
630 return instances[idx].create_callback;
634 EmulateInstructionCreateInstance
635 PluginManager::GetEmulateInstructionCreateCallbackForPluginName (const ConstString &name)
639 Mutex::Locker locker (GetEmulateInstructionMutex ());
640 EmulateInstructionInstances &instances = GetEmulateInstructionInstances ();
642 EmulateInstructionInstances::iterator pos, end = instances.end();
643 for (pos = instances.begin(); pos != end; ++ pos)
645 if (name == pos->name)
646 return pos->create_callback;
651 #pragma mark OperatingSystem
654 struct OperatingSystemInstance
656 OperatingSystemInstance() :
659 create_callback(NULL)
664 std::string description;
665 OperatingSystemCreateInstance create_callback;
668 typedef std::vector<OperatingSystemInstance> OperatingSystemInstances;
671 GetOperatingSystemMutex ()
673 static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);
674 return g_instances_mutex;
677 static OperatingSystemInstances &
678 GetOperatingSystemInstances ()
680 static OperatingSystemInstances g_instances;
685 PluginManager::RegisterPlugin (const ConstString &name,
686 const char *description,
687 OperatingSystemCreateInstance create_callback)
691 OperatingSystemInstance instance;
693 instance.name = name;
694 if (description && description[0])
695 instance.description = description;
696 instance.create_callback = create_callback;
697 Mutex::Locker locker (GetOperatingSystemMutex ());
698 GetOperatingSystemInstances ().push_back (instance);
704 PluginManager::UnregisterPlugin (OperatingSystemCreateInstance create_callback)
708 Mutex::Locker locker (GetOperatingSystemMutex ());
709 OperatingSystemInstances &instances = GetOperatingSystemInstances ();
711 OperatingSystemInstances::iterator pos, end = instances.end();
712 for (pos = instances.begin(); pos != end; ++ pos)
714 if (pos->create_callback == create_callback)
716 instances.erase(pos);
724 OperatingSystemCreateInstance
725 PluginManager::GetOperatingSystemCreateCallbackAtIndex (uint32_t idx)
727 Mutex::Locker locker (GetOperatingSystemMutex ());
728 OperatingSystemInstances &instances = GetOperatingSystemInstances ();
729 if (idx < instances.size())
730 return instances[idx].create_callback;
734 OperatingSystemCreateInstance
735 PluginManager::GetOperatingSystemCreateCallbackForPluginName (const ConstString &name)
739 Mutex::Locker locker (GetOperatingSystemMutex ());
740 OperatingSystemInstances &instances = GetOperatingSystemInstances ();
742 OperatingSystemInstances::iterator pos, end = instances.end();
743 for (pos = instances.begin(); pos != end; ++ pos)
745 if (name == pos->name)
746 return pos->create_callback;
753 #pragma mark LanguageRuntime
756 struct LanguageRuntimeInstance
758 LanguageRuntimeInstance() :
761 create_callback(NULL)
766 std::string description;
767 LanguageRuntimeCreateInstance create_callback;
770 typedef std::vector<LanguageRuntimeInstance> LanguageRuntimeInstances;
773 GetLanguageRuntimeMutex ()
775 static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);
776 return g_instances_mutex;
779 static LanguageRuntimeInstances &
780 GetLanguageRuntimeInstances ()
782 static LanguageRuntimeInstances g_instances;
787 PluginManager::RegisterPlugin
789 const ConstString &name,
790 const char *description,
791 LanguageRuntimeCreateInstance create_callback
796 LanguageRuntimeInstance instance;
798 instance.name = name;
799 if (description && description[0])
800 instance.description = description;
801 instance.create_callback = create_callback;
802 Mutex::Locker locker (GetLanguageRuntimeMutex ());
803 GetLanguageRuntimeInstances ().push_back (instance);
809 PluginManager::UnregisterPlugin (LanguageRuntimeCreateInstance create_callback)
813 Mutex::Locker locker (GetLanguageRuntimeMutex ());
814 LanguageRuntimeInstances &instances = GetLanguageRuntimeInstances ();
816 LanguageRuntimeInstances::iterator pos, end = instances.end();
817 for (pos = instances.begin(); pos != end; ++ pos)
819 if (pos->create_callback == create_callback)
821 instances.erase(pos);
829 LanguageRuntimeCreateInstance
830 PluginManager::GetLanguageRuntimeCreateCallbackAtIndex (uint32_t idx)
832 Mutex::Locker locker (GetLanguageRuntimeMutex ());
833 LanguageRuntimeInstances &instances = GetLanguageRuntimeInstances ();
834 if (idx < instances.size())
835 return instances[idx].create_callback;
839 LanguageRuntimeCreateInstance
840 PluginManager::GetLanguageRuntimeCreateCallbackForPluginName (const ConstString &name)
844 Mutex::Locker locker (GetLanguageRuntimeMutex ());
845 LanguageRuntimeInstances &instances = GetLanguageRuntimeInstances ();
847 LanguageRuntimeInstances::iterator pos, end = instances.end();
848 for (pos = instances.begin(); pos != end; ++ pos)
850 if (name == pos->name)
851 return pos->create_callback;
857 #pragma mark ObjectFile
859 struct ObjectFileInstance
861 ObjectFileInstance() :
864 create_callback(NULL),
865 create_memory_callback (NULL),
866 get_module_specifications (NULL)
871 std::string description;
872 ObjectFileCreateInstance create_callback;
873 ObjectFileCreateMemoryInstance create_memory_callback;
874 ObjectFileGetModuleSpecifications get_module_specifications;
877 typedef std::vector<ObjectFileInstance> ObjectFileInstances;
880 GetObjectFileMutex ()
882 static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);
883 return g_instances_mutex;
886 static ObjectFileInstances &
887 GetObjectFileInstances ()
889 static ObjectFileInstances g_instances;
895 PluginManager::RegisterPlugin (const ConstString &name,
896 const char *description,
897 ObjectFileCreateInstance create_callback,
898 ObjectFileCreateMemoryInstance create_memory_callback,
899 ObjectFileGetModuleSpecifications get_module_specifications)
903 ObjectFileInstance instance;
905 instance.name = name;
906 if (description && description[0])
907 instance.description = description;
908 instance.create_callback = create_callback;
909 instance.create_memory_callback = create_memory_callback;
910 instance.get_module_specifications = get_module_specifications;
911 Mutex::Locker locker (GetObjectFileMutex ());
912 GetObjectFileInstances ().push_back (instance);
918 PluginManager::UnregisterPlugin (ObjectFileCreateInstance create_callback)
922 Mutex::Locker locker (GetObjectFileMutex ());
923 ObjectFileInstances &instances = GetObjectFileInstances ();
925 ObjectFileInstances::iterator pos, end = instances.end();
926 for (pos = instances.begin(); pos != end; ++ pos)
928 if (pos->create_callback == create_callback)
930 instances.erase(pos);
938 ObjectFileCreateInstance
939 PluginManager::GetObjectFileCreateCallbackAtIndex (uint32_t idx)
941 Mutex::Locker locker (GetObjectFileMutex ());
942 ObjectFileInstances &instances = GetObjectFileInstances ();
943 if (idx < instances.size())
944 return instances[idx].create_callback;
949 ObjectFileCreateMemoryInstance
950 PluginManager::GetObjectFileCreateMemoryCallbackAtIndex (uint32_t idx)
952 Mutex::Locker locker (GetObjectFileMutex ());
953 ObjectFileInstances &instances = GetObjectFileInstances ();
954 if (idx < instances.size())
955 return instances[idx].create_memory_callback;
959 ObjectFileGetModuleSpecifications
960 PluginManager::GetObjectFileGetModuleSpecificationsCallbackAtIndex (uint32_t idx)
962 Mutex::Locker locker (GetObjectFileMutex ());
963 ObjectFileInstances &instances = GetObjectFileInstances ();
964 if (idx < instances.size())
965 return instances[idx].get_module_specifications;
969 ObjectFileCreateInstance
970 PluginManager::GetObjectFileCreateCallbackForPluginName (const ConstString &name)
974 Mutex::Locker locker (GetObjectFileMutex ());
975 ObjectFileInstances &instances = GetObjectFileInstances ();
977 ObjectFileInstances::iterator pos, end = instances.end();
978 for (pos = instances.begin(); pos != end; ++ pos)
980 if (name == pos->name)
981 return pos->create_callback;
988 ObjectFileCreateMemoryInstance
989 PluginManager::GetObjectFileCreateMemoryCallbackForPluginName (const ConstString &name)
993 Mutex::Locker locker (GetObjectFileMutex ());
994 ObjectFileInstances &instances = GetObjectFileInstances ();
996 ObjectFileInstances::iterator pos, end = instances.end();
997 for (pos = instances.begin(); pos != end; ++ pos)
999 if (name == pos->name)
1000 return pos->create_memory_callback;
1008 #pragma mark ObjectContainer
1010 struct ObjectContainerInstance
1012 ObjectContainerInstance() :
1015 create_callback (NULL),
1016 get_module_specifications (NULL)
1021 std::string description;
1022 ObjectContainerCreateInstance create_callback;
1023 ObjectFileGetModuleSpecifications get_module_specifications;
1027 typedef std::vector<ObjectContainerInstance> ObjectContainerInstances;
1030 GetObjectContainerMutex ()
1032 static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);
1033 return g_instances_mutex;
1036 static ObjectContainerInstances &
1037 GetObjectContainerInstances ()
1039 static ObjectContainerInstances g_instances;
1044 PluginManager::RegisterPlugin (const ConstString &name,
1045 const char *description,
1046 ObjectContainerCreateInstance create_callback,
1047 ObjectFileGetModuleSpecifications get_module_specifications)
1049 if (create_callback)
1051 ObjectContainerInstance instance;
1052 assert ((bool)name);
1053 instance.name = name;
1054 if (description && description[0])
1055 instance.description = description;
1056 instance.create_callback = create_callback;
1057 instance.get_module_specifications = get_module_specifications;
1058 Mutex::Locker locker (GetObjectContainerMutex ());
1059 GetObjectContainerInstances ().push_back (instance);
1065 PluginManager::UnregisterPlugin (ObjectContainerCreateInstance create_callback)
1067 if (create_callback)
1069 Mutex::Locker locker (GetObjectContainerMutex ());
1070 ObjectContainerInstances &instances = GetObjectContainerInstances ();
1072 ObjectContainerInstances::iterator pos, end = instances.end();
1073 for (pos = instances.begin(); pos != end; ++ pos)
1075 if (pos->create_callback == create_callback)
1077 instances.erase(pos);
1085 ObjectContainerCreateInstance
1086 PluginManager::GetObjectContainerCreateCallbackAtIndex (uint32_t idx)
1088 Mutex::Locker locker (GetObjectContainerMutex ());
1089 ObjectContainerInstances &instances = GetObjectContainerInstances ();
1090 if (idx < instances.size())
1091 return instances[idx].create_callback;
1095 ObjectContainerCreateInstance
1096 PluginManager::GetObjectContainerCreateCallbackForPluginName (const ConstString &name)
1100 Mutex::Locker locker (GetObjectContainerMutex ());
1101 ObjectContainerInstances &instances = GetObjectContainerInstances ();
1103 ObjectContainerInstances::iterator pos, end = instances.end();
1104 for (pos = instances.begin(); pos != end; ++ pos)
1106 if (name == pos->name)
1107 return pos->create_callback;
1113 ObjectFileGetModuleSpecifications
1114 PluginManager::GetObjectContainerGetModuleSpecificationsCallbackAtIndex (uint32_t idx)
1116 Mutex::Locker locker (GetObjectContainerMutex ());
1117 ObjectContainerInstances &instances = GetObjectContainerInstances ();
1118 if (idx < instances.size())
1119 return instances[idx].get_module_specifications;
1123 #pragma mark LogChannel
1130 create_callback(NULL)
1135 std::string description;
1136 LogChannelCreateInstance create_callback;
1139 typedef std::vector<LogInstance> LogInstances;
1144 static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);
1145 return g_instances_mutex;
1148 static LogInstances &
1151 static LogInstances g_instances;
1158 PluginManager::RegisterPlugin
1160 const ConstString &name,
1161 const char *description,
1162 LogChannelCreateInstance create_callback
1165 if (create_callback)
1167 LogInstance instance;
1168 assert ((bool)name);
1169 instance.name = name;
1170 if (description && description[0])
1171 instance.description = description;
1172 instance.create_callback = create_callback;
1173 Mutex::Locker locker (GetLogMutex ());
1174 GetLogInstances ().push_back (instance);
1180 PluginManager::UnregisterPlugin (LogChannelCreateInstance create_callback)
1182 if (create_callback)
1184 Mutex::Locker locker (GetLogMutex ());
1185 LogInstances &instances = GetLogInstances ();
1187 LogInstances::iterator pos, end = instances.end();
1188 for (pos = instances.begin(); pos != end; ++ pos)
1190 if (pos->create_callback == create_callback)
1192 instances.erase(pos);
1201 PluginManager::GetLogChannelCreateNameAtIndex (uint32_t idx)
1203 Mutex::Locker locker (GetLogMutex ());
1204 LogInstances &instances = GetLogInstances ();
1205 if (idx < instances.size())
1206 return instances[idx].name.GetCString();
1211 LogChannelCreateInstance
1212 PluginManager::GetLogChannelCreateCallbackAtIndex (uint32_t idx)
1214 Mutex::Locker locker (GetLogMutex ());
1215 LogInstances &instances = GetLogInstances ();
1216 if (idx < instances.size())
1217 return instances[idx].create_callback;
1221 LogChannelCreateInstance
1222 PluginManager::GetLogChannelCreateCallbackForPluginName (const ConstString &name)
1226 Mutex::Locker locker (GetLogMutex ());
1227 LogInstances &instances = GetLogInstances ();
1229 LogInstances::iterator pos, end = instances.end();
1230 for (pos = instances.begin(); pos != end; ++ pos)
1232 if (name == pos->name)
1233 return pos->create_callback;
1239 #pragma mark Platform
1241 struct PlatformInstance
1243 PlatformInstance() :
1246 create_callback(NULL),
1247 debugger_init_callback (NULL)
1252 std::string description;
1253 PlatformCreateInstance create_callback;
1254 DebuggerInitializeCallback debugger_init_callback;
1257 typedef std::vector<PlatformInstance> PlatformInstances;
1260 GetPlatformInstancesMutex ()
1262 static Mutex g_platform_instances_mutex (Mutex::eMutexTypeRecursive);
1263 return g_platform_instances_mutex;
1266 static PlatformInstances &
1267 GetPlatformInstances ()
1269 static PlatformInstances g_platform_instances;
1270 return g_platform_instances;
1275 PluginManager::RegisterPlugin (const ConstString &name,
1276 const char *description,
1277 PlatformCreateInstance create_callback,
1278 DebuggerInitializeCallback debugger_init_callback)
1280 if (create_callback)
1282 Mutex::Locker locker (GetPlatformInstancesMutex ());
1284 PlatformInstance instance;
1285 assert ((bool)name);
1286 instance.name = name;
1287 if (description && description[0])
1288 instance.description = description;
1289 instance.create_callback = create_callback;
1290 instance.debugger_init_callback = debugger_init_callback;
1291 GetPlatformInstances ().push_back (instance);
1299 PluginManager::GetPlatformPluginNameAtIndex (uint32_t idx)
1301 Mutex::Locker locker (GetPlatformInstancesMutex ());
1302 PlatformInstances &instances = GetPlatformInstances ();
1303 if (idx < instances.size())
1304 return instances[idx].name.GetCString();
1309 PluginManager::GetPlatformPluginDescriptionAtIndex (uint32_t idx)
1311 Mutex::Locker locker (GetPlatformInstancesMutex ());
1312 PlatformInstances &instances = GetPlatformInstances ();
1313 if (idx < instances.size())
1314 return instances[idx].description.c_str();
1319 PluginManager::UnregisterPlugin (PlatformCreateInstance create_callback)
1321 if (create_callback)
1323 Mutex::Locker locker (GetPlatformInstancesMutex ());
1324 PlatformInstances &instances = GetPlatformInstances ();
1326 PlatformInstances::iterator pos, end = instances.end();
1327 for (pos = instances.begin(); pos != end; ++ pos)
1329 if (pos->create_callback == create_callback)
1331 instances.erase(pos);
1339 PlatformCreateInstance
1340 PluginManager::GetPlatformCreateCallbackAtIndex (uint32_t idx)
1342 Mutex::Locker locker (GetPlatformInstancesMutex ());
1343 PlatformInstances &instances = GetPlatformInstances ();
1344 if (idx < instances.size())
1345 return instances[idx].create_callback;
1349 PlatformCreateInstance
1350 PluginManager::GetPlatformCreateCallbackForPluginName (const ConstString &name)
1354 Mutex::Locker locker (GetPlatformInstancesMutex ());
1355 PlatformInstances &instances = GetPlatformInstances ();
1357 PlatformInstances::iterator pos, end = instances.end();
1358 for (pos = instances.begin(); pos != end; ++ pos)
1360 if (name == pos->name)
1361 return pos->create_callback;
1368 PluginManager::AutoCompletePlatformName (const char *name, StringList &matches)
1372 Mutex::Locker locker (GetPlatformInstancesMutex ());
1373 PlatformInstances &instances = GetPlatformInstances ();
1374 llvm::StringRef name_sref(name);
1376 PlatformInstances::iterator pos, end = instances.end();
1377 for (pos = instances.begin(); pos != end; ++ pos)
1379 llvm::StringRef plugin_name (pos->name.GetCString());
1380 if (plugin_name.startswith(name_sref))
1381 matches.AppendString (plugin_name.data());
1384 return matches.GetSize();
1386 #pragma mark Process
1388 struct ProcessInstance
1393 create_callback(NULL),
1394 debugger_init_callback(NULL)
1399 std::string description;
1400 ProcessCreateInstance create_callback;
1401 DebuggerInitializeCallback debugger_init_callback;
1404 typedef std::vector<ProcessInstance> ProcessInstances;
1409 static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);
1410 return g_instances_mutex;
1413 static ProcessInstances &
1414 GetProcessInstances ()
1416 static ProcessInstances g_instances;
1422 PluginManager::RegisterPlugin (const ConstString &name,
1423 const char *description,
1424 ProcessCreateInstance create_callback,
1425 DebuggerInitializeCallback debugger_init_callback)
1427 if (create_callback)
1429 ProcessInstance instance;
1430 assert ((bool)name);
1431 instance.name = name;
1432 if (description && description[0])
1433 instance.description = description;
1434 instance.create_callback = create_callback;
1435 instance.debugger_init_callback = debugger_init_callback;
1436 Mutex::Locker locker (GetProcessMutex ());
1437 GetProcessInstances ().push_back (instance);
1443 PluginManager::GetProcessPluginNameAtIndex (uint32_t idx)
1445 Mutex::Locker locker (GetProcessMutex ());
1446 ProcessInstances &instances = GetProcessInstances ();
1447 if (idx < instances.size())
1448 return instances[idx].name.GetCString();
1453 PluginManager::GetProcessPluginDescriptionAtIndex (uint32_t idx)
1455 Mutex::Locker locker (GetProcessMutex ());
1456 ProcessInstances &instances = GetProcessInstances ();
1457 if (idx < instances.size())
1458 return instances[idx].description.c_str();
1463 PluginManager::UnregisterPlugin (ProcessCreateInstance create_callback)
1465 if (create_callback)
1467 Mutex::Locker locker (GetProcessMutex ());
1468 ProcessInstances &instances = GetProcessInstances ();
1470 ProcessInstances::iterator pos, end = instances.end();
1471 for (pos = instances.begin(); pos != end; ++ pos)
1473 if (pos->create_callback == create_callback)
1475 instances.erase(pos);
1483 ProcessCreateInstance
1484 PluginManager::GetProcessCreateCallbackAtIndex (uint32_t idx)
1486 Mutex::Locker locker (GetProcessMutex ());
1487 ProcessInstances &instances = GetProcessInstances ();
1488 if (idx < instances.size())
1489 return instances[idx].create_callback;
1494 ProcessCreateInstance
1495 PluginManager::GetProcessCreateCallbackForPluginName (const ConstString &name)
1499 Mutex::Locker locker (GetProcessMutex ());
1500 ProcessInstances &instances = GetProcessInstances ();
1502 ProcessInstances::iterator pos, end = instances.end();
1503 for (pos = instances.begin(); pos != end; ++ pos)
1505 if (name == pos->name)
1506 return pos->create_callback;
1512 #pragma mark SymbolFile
1514 struct SymbolFileInstance
1516 SymbolFileInstance() :
1519 create_callback(NULL)
1524 std::string description;
1525 SymbolFileCreateInstance create_callback;
1528 typedef std::vector<SymbolFileInstance> SymbolFileInstances;
1531 GetSymbolFileMutex ()
1533 static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);
1534 return g_instances_mutex;
1537 static SymbolFileInstances &
1538 GetSymbolFileInstances ()
1540 static SymbolFileInstances g_instances;
1546 PluginManager::RegisterPlugin
1548 const ConstString &name,
1549 const char *description,
1550 SymbolFileCreateInstance create_callback
1553 if (create_callback)
1555 SymbolFileInstance instance;
1556 assert ((bool)name);
1557 instance.name = name;
1558 if (description && description[0])
1559 instance.description = description;
1560 instance.create_callback = create_callback;
1561 Mutex::Locker locker (GetSymbolFileMutex ());
1562 GetSymbolFileInstances ().push_back (instance);
1568 PluginManager::UnregisterPlugin (SymbolFileCreateInstance create_callback)
1570 if (create_callback)
1572 Mutex::Locker locker (GetSymbolFileMutex ());
1573 SymbolFileInstances &instances = GetSymbolFileInstances ();
1575 SymbolFileInstances::iterator pos, end = instances.end();
1576 for (pos = instances.begin(); pos != end; ++ pos)
1578 if (pos->create_callback == create_callback)
1580 instances.erase(pos);
1588 SymbolFileCreateInstance
1589 PluginManager::GetSymbolFileCreateCallbackAtIndex (uint32_t idx)
1591 Mutex::Locker locker (GetSymbolFileMutex ());
1592 SymbolFileInstances &instances = GetSymbolFileInstances ();
1593 if (idx < instances.size())
1594 return instances[idx].create_callback;
1598 SymbolFileCreateInstance
1599 PluginManager::GetSymbolFileCreateCallbackForPluginName (const ConstString &name)
1603 Mutex::Locker locker (GetSymbolFileMutex ());
1604 SymbolFileInstances &instances = GetSymbolFileInstances ();
1606 SymbolFileInstances::iterator pos, end = instances.end();
1607 for (pos = instances.begin(); pos != end; ++ pos)
1609 if (name == pos->name)
1610 return pos->create_callback;
1618 #pragma mark SymbolVendor
1620 struct SymbolVendorInstance
1622 SymbolVendorInstance() :
1625 create_callback(NULL)
1630 std::string description;
1631 SymbolVendorCreateInstance create_callback;
1634 typedef std::vector<SymbolVendorInstance> SymbolVendorInstances;
1637 GetSymbolVendorMutex ()
1639 static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);
1640 return g_instances_mutex;
1643 static SymbolVendorInstances &
1644 GetSymbolVendorInstances ()
1646 static SymbolVendorInstances g_instances;
1651 PluginManager::RegisterPlugin
1653 const ConstString &name,
1654 const char *description,
1655 SymbolVendorCreateInstance create_callback
1658 if (create_callback)
1660 SymbolVendorInstance instance;
1661 assert ((bool)name);
1662 instance.name = name;
1663 if (description && description[0])
1664 instance.description = description;
1665 instance.create_callback = create_callback;
1666 Mutex::Locker locker (GetSymbolVendorMutex ());
1667 GetSymbolVendorInstances ().push_back (instance);
1673 PluginManager::UnregisterPlugin (SymbolVendorCreateInstance create_callback)
1675 if (create_callback)
1677 Mutex::Locker locker (GetSymbolVendorMutex ());
1678 SymbolVendorInstances &instances = GetSymbolVendorInstances ();
1680 SymbolVendorInstances::iterator pos, end = instances.end();
1681 for (pos = instances.begin(); pos != end; ++ pos)
1683 if (pos->create_callback == create_callback)
1685 instances.erase(pos);
1693 SymbolVendorCreateInstance
1694 PluginManager::GetSymbolVendorCreateCallbackAtIndex (uint32_t idx)
1696 Mutex::Locker locker (GetSymbolVendorMutex ());
1697 SymbolVendorInstances &instances = GetSymbolVendorInstances ();
1698 if (idx < instances.size())
1699 return instances[idx].create_callback;
1704 SymbolVendorCreateInstance
1705 PluginManager::GetSymbolVendorCreateCallbackForPluginName (const ConstString &name)
1709 Mutex::Locker locker (GetSymbolVendorMutex ());
1710 SymbolVendorInstances &instances = GetSymbolVendorInstances ();
1712 SymbolVendorInstances::iterator pos, end = instances.end();
1713 for (pos = instances.begin(); pos != end; ++ pos)
1715 if (name == pos->name)
1716 return pos->create_callback;
1723 #pragma mark UnwindAssembly
1725 struct UnwindAssemblyInstance
1727 UnwindAssemblyInstance() :
1730 create_callback(NULL)
1735 std::string description;
1736 UnwindAssemblyCreateInstance create_callback;
1739 typedef std::vector<UnwindAssemblyInstance> UnwindAssemblyInstances;
1742 GetUnwindAssemblyMutex ()
1744 static Mutex g_instances_mutex (Mutex::eMutexTypeRecursive);
1745 return g_instances_mutex;
1748 static UnwindAssemblyInstances &
1749 GetUnwindAssemblyInstances ()
1751 static UnwindAssemblyInstances g_instances;
1756 PluginManager::RegisterPlugin
1758 const ConstString &name,
1759 const char *description,
1760 UnwindAssemblyCreateInstance create_callback
1763 if (create_callback)
1765 UnwindAssemblyInstance instance;
1766 assert ((bool)name);
1767 instance.name = name;
1768 if (description && description[0])
1769 instance.description = description;
1770 instance.create_callback = create_callback;
1771 Mutex::Locker locker (GetUnwindAssemblyMutex ());
1772 GetUnwindAssemblyInstances ().push_back (instance);
1778 PluginManager::UnregisterPlugin (UnwindAssemblyCreateInstance create_callback)
1780 if (create_callback)
1782 Mutex::Locker locker (GetUnwindAssemblyMutex ());
1783 UnwindAssemblyInstances &instances = GetUnwindAssemblyInstances ();
1785 UnwindAssemblyInstances::iterator pos, end = instances.end();
1786 for (pos = instances.begin(); pos != end; ++ pos)
1788 if (pos->create_callback == create_callback)
1790 instances.erase(pos);
1798 UnwindAssemblyCreateInstance
1799 PluginManager::GetUnwindAssemblyCreateCallbackAtIndex (uint32_t idx)
1801 Mutex::Locker locker (GetUnwindAssemblyMutex ());
1802 UnwindAssemblyInstances &instances = GetUnwindAssemblyInstances ();
1803 if (idx < instances.size())
1804 return instances[idx].create_callback;
1809 UnwindAssemblyCreateInstance
1810 PluginManager::GetUnwindAssemblyCreateCallbackForPluginName (const ConstString &name)
1814 Mutex::Locker locker (GetUnwindAssemblyMutex ());
1815 UnwindAssemblyInstances &instances = GetUnwindAssemblyInstances ();
1817 UnwindAssemblyInstances::iterator pos, end = instances.end();
1818 for (pos = instances.begin(); pos != end; ++ pos)
1820 if (name == pos->name)
1821 return pos->create_callback;
1828 PluginManager::DebuggerInitialize (Debugger &debugger)
1830 // Initialize the DynamicLoader plugins
1832 Mutex::Locker locker (GetDynamicLoaderMutex ());
1833 DynamicLoaderInstances &instances = GetDynamicLoaderInstances ();
1835 DynamicLoaderInstances::iterator pos, end = instances.end();
1836 for (pos = instances.begin(); pos != end; ++ pos)
1838 if (pos->debugger_init_callback)
1839 pos->debugger_init_callback (debugger);
1843 // Initialize the Platform plugins
1845 Mutex::Locker locker (GetPlatformInstancesMutex ());
1846 PlatformInstances &instances = GetPlatformInstances ();
1848 PlatformInstances::iterator pos, end = instances.end();
1849 for (pos = instances.begin(); pos != end; ++ pos)
1851 if (pos->debugger_init_callback)
1852 pos->debugger_init_callback (debugger);
1856 // Initialize the Process plugins
1858 Mutex::Locker locker (GetProcessMutex());
1859 ProcessInstances &instances = GetProcessInstances();
1861 ProcessInstances::iterator pos, end = instances.end();
1862 for (pos = instances.begin(); pos != end; ++ pos)
1864 if (pos->debugger_init_callback)
1865 pos->debugger_init_callback (debugger);
1871 // This is the preferred new way to register plugin specific settings. e.g.
1872 // This will put a plugin's settings under e.g. "plugin.<plugin_type_name>.<plugin_type_desc>.SETTINGNAME".
1873 static lldb::OptionValuePropertiesSP
1874 GetDebuggerPropertyForPlugins (Debugger &debugger,
1875 const ConstString &plugin_type_name,
1876 const ConstString &plugin_type_desc,
1879 lldb::OptionValuePropertiesSP parent_properties_sp (debugger.GetValueProperties());
1880 if (parent_properties_sp)
1882 static ConstString g_property_name("plugin");
1884 OptionValuePropertiesSP plugin_properties_sp = parent_properties_sp->GetSubProperty (NULL, g_property_name);
1885 if (!plugin_properties_sp && can_create)
1887 plugin_properties_sp.reset (new OptionValueProperties (g_property_name));
1888 parent_properties_sp->AppendProperty (g_property_name,
1889 ConstString("Settings specify to plugins."),
1891 plugin_properties_sp);
1894 if (plugin_properties_sp)
1896 lldb::OptionValuePropertiesSP plugin_type_properties_sp = plugin_properties_sp->GetSubProperty (NULL, plugin_type_name);
1897 if (!plugin_type_properties_sp && can_create)
1899 plugin_type_properties_sp.reset (new OptionValueProperties (plugin_type_name));
1900 plugin_properties_sp->AppendProperty (plugin_type_name,
1903 plugin_type_properties_sp);
1905 return plugin_type_properties_sp;
1908 return lldb::OptionValuePropertiesSP();
1911 // This is deprecated way to register plugin specific settings. e.g.
1912 // "<plugin_type_name>.plugin.<plugin_type_desc>.SETTINGNAME"
1913 // and Platform generic settings would be under "platform.SETTINGNAME".
1914 static lldb::OptionValuePropertiesSP
1915 GetDebuggerPropertyForPluginsOldStyle (Debugger &debugger,
1916 const ConstString &plugin_type_name,
1917 const ConstString &plugin_type_desc,
1920 static ConstString g_property_name("plugin");
1921 lldb::OptionValuePropertiesSP parent_properties_sp (debugger.GetValueProperties());
1922 if (parent_properties_sp)
1924 OptionValuePropertiesSP plugin_properties_sp = parent_properties_sp->GetSubProperty (NULL, plugin_type_name);
1925 if (!plugin_properties_sp && can_create)
1927 plugin_properties_sp.reset (new OptionValueProperties (plugin_type_name));
1928 parent_properties_sp->AppendProperty (plugin_type_name,
1931 plugin_properties_sp);
1934 if (plugin_properties_sp)
1936 lldb::OptionValuePropertiesSP plugin_type_properties_sp = plugin_properties_sp->GetSubProperty (NULL, g_property_name);
1937 if (!plugin_type_properties_sp && can_create)
1939 plugin_type_properties_sp.reset (new OptionValueProperties (g_property_name));
1940 plugin_properties_sp->AppendProperty (g_property_name,
1941 ConstString("Settings specific to plugins"),
1943 plugin_type_properties_sp);
1945 return plugin_type_properties_sp;
1948 return lldb::OptionValuePropertiesSP();
1952 lldb::OptionValuePropertiesSP
1953 PluginManager::GetSettingForDynamicLoaderPlugin (Debugger &debugger, const ConstString &setting_name)
1955 lldb::OptionValuePropertiesSP properties_sp;
1956 lldb::OptionValuePropertiesSP plugin_type_properties_sp (GetDebuggerPropertyForPlugins (debugger,
1957 ConstString("dynamic-loader"),
1958 ConstString(), // not creating to so we don't need the description
1960 if (plugin_type_properties_sp)
1961 properties_sp = plugin_type_properties_sp->GetSubProperty (NULL, setting_name);
1962 return properties_sp;
1966 PluginManager::CreateSettingForDynamicLoaderPlugin (Debugger &debugger,
1967 const lldb::OptionValuePropertiesSP &properties_sp,
1968 const ConstString &description,
1969 bool is_global_property)
1973 lldb::OptionValuePropertiesSP plugin_type_properties_sp (GetDebuggerPropertyForPlugins (debugger,
1974 ConstString("dynamic-loader"),
1975 ConstString("Settings for dynamic loader plug-ins"),
1977 if (plugin_type_properties_sp)
1979 plugin_type_properties_sp->AppendProperty (properties_sp->GetName(),
1990 lldb::OptionValuePropertiesSP
1991 PluginManager::GetSettingForPlatformPlugin (Debugger &debugger, const ConstString &setting_name)
1993 lldb::OptionValuePropertiesSP properties_sp;
1994 lldb::OptionValuePropertiesSP plugin_type_properties_sp (GetDebuggerPropertyForPluginsOldStyle (debugger,
1995 ConstString("platform"),
1996 ConstString(), // not creating to so we don't need the description
1998 if (plugin_type_properties_sp)
1999 properties_sp = plugin_type_properties_sp->GetSubProperty (NULL, setting_name);
2000 return properties_sp;
2004 PluginManager::CreateSettingForPlatformPlugin (Debugger &debugger,
2005 const lldb::OptionValuePropertiesSP &properties_sp,
2006 const ConstString &description,
2007 bool is_global_property)
2011 lldb::OptionValuePropertiesSP plugin_type_properties_sp (GetDebuggerPropertyForPluginsOldStyle (debugger,
2012 ConstString("platform"),
2013 ConstString("Settings for platform plug-ins"),
2015 if (plugin_type_properties_sp)
2017 plugin_type_properties_sp->AppendProperty (properties_sp->GetName(),
2028 lldb::OptionValuePropertiesSP
2029 PluginManager::GetSettingForProcessPlugin (Debugger &debugger, const ConstString &setting_name)
2031 lldb::OptionValuePropertiesSP properties_sp;
2032 lldb::OptionValuePropertiesSP plugin_type_properties_sp (GetDebuggerPropertyForPlugins (debugger,
2033 ConstString("process"),
2034 ConstString(), // not creating to so we don't need the description
2036 if (plugin_type_properties_sp)
2037 properties_sp = plugin_type_properties_sp->GetSubProperty (NULL, setting_name);
2038 return properties_sp;
2042 PluginManager::CreateSettingForProcessPlugin (Debugger &debugger,
2043 const lldb::OptionValuePropertiesSP &properties_sp,
2044 const ConstString &description,
2045 bool is_global_property)
2049 lldb::OptionValuePropertiesSP plugin_type_properties_sp (GetDebuggerPropertyForPlugins (debugger,
2050 ConstString("process"),
2051 ConstString("Settings for process plug-ins"),
2053 if (plugin_type_properties_sp)
2055 plugin_type_properties_sp->AppendProperty (properties_sp->GetName(),