1 //===-- PluginManager.h -----------------------------------------*- 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 //===----------------------------------------------------------------------===//
11 #ifndef liblldb_PluginManager_h_
12 #define liblldb_PluginManager_h_
14 #include "lldb/lldb-private.h"
15 #include "lldb/Host/FileSpec.h"
17 namespace lldb_private {
28 //------------------------------------------------------------------
30 //------------------------------------------------------------------
32 RegisterPlugin (const ConstString &name,
33 const char *description,
34 ABICreateInstance create_callback);
37 UnregisterPlugin (ABICreateInstance create_callback);
39 static ABICreateInstance
40 GetABICreateCallbackAtIndex (uint32_t idx);
42 static ABICreateInstance
43 GetABICreateCallbackForPluginName (const ConstString &name);
46 //------------------------------------------------------------------
48 //------------------------------------------------------------------
50 RegisterPlugin (const ConstString &name,
51 const char *description,
52 DisassemblerCreateInstance create_callback);
55 UnregisterPlugin (DisassemblerCreateInstance create_callback);
57 static DisassemblerCreateInstance
58 GetDisassemblerCreateCallbackAtIndex (uint32_t idx);
60 static DisassemblerCreateInstance
61 GetDisassemblerCreateCallbackForPluginName (const ConstString &name);
64 //------------------------------------------------------------------
66 //------------------------------------------------------------------
68 RegisterPlugin (const ConstString &name,
69 const char *description,
70 DynamicLoaderCreateInstance create_callback,
71 DebuggerInitializeCallback debugger_init_callback = NULL);
74 UnregisterPlugin (DynamicLoaderCreateInstance create_callback);
76 static DynamicLoaderCreateInstance
77 GetDynamicLoaderCreateCallbackAtIndex (uint32_t idx);
79 static DynamicLoaderCreateInstance
80 GetDynamicLoaderCreateCallbackForPluginName (const ConstString &name);
82 //------------------------------------------------------------------
84 //------------------------------------------------------------------
86 RegisterPlugin (const ConstString &name,
87 const char *description,
88 EmulateInstructionCreateInstance create_callback);
91 UnregisterPlugin (EmulateInstructionCreateInstance create_callback);
93 static EmulateInstructionCreateInstance
94 GetEmulateInstructionCreateCallbackAtIndex (uint32_t idx);
96 static EmulateInstructionCreateInstance
97 GetEmulateInstructionCreateCallbackForPluginName (const ConstString &name);
99 //------------------------------------------------------------------
101 //------------------------------------------------------------------
103 RegisterPlugin (const ConstString &name,
104 const char *description,
105 OperatingSystemCreateInstance create_callback);
108 UnregisterPlugin (OperatingSystemCreateInstance create_callback);
110 static OperatingSystemCreateInstance
111 GetOperatingSystemCreateCallbackAtIndex (uint32_t idx);
113 static OperatingSystemCreateInstance
114 GetOperatingSystemCreateCallbackForPluginName (const ConstString &name);
116 //------------------------------------------------------------------
118 //------------------------------------------------------------------
120 RegisterPlugin (const ConstString &name,
121 const char *description,
122 LanguageRuntimeCreateInstance create_callback);
125 UnregisterPlugin (LanguageRuntimeCreateInstance create_callback);
127 static LanguageRuntimeCreateInstance
128 GetLanguageRuntimeCreateCallbackAtIndex (uint32_t idx);
130 static LanguageRuntimeCreateInstance
131 GetLanguageRuntimeCreateCallbackForPluginName (const ConstString &name);
134 //------------------------------------------------------------------
136 //------------------------------------------------------------------
138 RegisterPlugin (const ConstString &name,
139 const char *description,
140 SystemRuntimeCreateInstance create_callback);
143 UnregisterPlugin (SystemRuntimeCreateInstance create_callback);
145 static SystemRuntimeCreateInstance
146 GetSystemRuntimeCreateCallbackAtIndex (uint32_t idx);
148 static SystemRuntimeCreateInstance
149 GetSystemRuntimeCreateCallbackForPluginName (const ConstString &name);
152 //------------------------------------------------------------------
154 //------------------------------------------------------------------
156 RegisterPlugin (const ConstString &name,
157 const char *description,
158 ObjectFileCreateInstance create_callback,
159 ObjectFileCreateMemoryInstance create_memory_callback,
160 ObjectFileGetModuleSpecifications get_module_specifications);
163 UnregisterPlugin (ObjectFileCreateInstance create_callback);
165 static ObjectFileCreateInstance
166 GetObjectFileCreateCallbackAtIndex (uint32_t idx);
168 static ObjectFileCreateMemoryInstance
169 GetObjectFileCreateMemoryCallbackAtIndex (uint32_t idx);
171 static ObjectFileGetModuleSpecifications
172 GetObjectFileGetModuleSpecificationsCallbackAtIndex (uint32_t idx);
174 static ObjectFileCreateInstance
175 GetObjectFileCreateCallbackForPluginName (const ConstString &name);
177 static ObjectFileCreateMemoryInstance
178 GetObjectFileCreateMemoryCallbackForPluginName (const ConstString &name);
181 //------------------------------------------------------------------
183 //------------------------------------------------------------------
185 RegisterPlugin (const ConstString &name,
186 const char *description,
187 ObjectContainerCreateInstance create_callback,
188 ObjectFileGetModuleSpecifications get_module_specifications);
191 UnregisterPlugin (ObjectContainerCreateInstance create_callback);
193 static ObjectContainerCreateInstance
194 GetObjectContainerCreateCallbackAtIndex (uint32_t idx);
196 static ObjectContainerCreateInstance
197 GetObjectContainerCreateCallbackForPluginName (const ConstString &name);
199 static ObjectFileGetModuleSpecifications
200 GetObjectContainerGetModuleSpecificationsCallbackAtIndex (uint32_t idx);
202 //------------------------------------------------------------------
204 //------------------------------------------------------------------
206 RegisterPlugin (const ConstString &name,
207 const char *description,
208 LogChannelCreateInstance create_callback);
211 UnregisterPlugin (LogChannelCreateInstance create_callback);
213 static LogChannelCreateInstance
214 GetLogChannelCreateCallbackAtIndex (uint32_t idx);
216 static LogChannelCreateInstance
217 GetLogChannelCreateCallbackForPluginName (const ConstString &name);
220 GetLogChannelCreateNameAtIndex (uint32_t idx);
222 //------------------------------------------------------------------
224 //------------------------------------------------------------------
226 RegisterPlugin (const ConstString &name,
227 const char *description,
228 PlatformCreateInstance create_callback,
229 DebuggerInitializeCallback debugger_init_callback = NULL);
232 UnregisterPlugin (PlatformCreateInstance create_callback);
234 static PlatformCreateInstance
235 GetPlatformCreateCallbackAtIndex (uint32_t idx);
237 static PlatformCreateInstance
238 GetPlatformCreateCallbackForPluginName (const ConstString &name);
241 GetPlatformPluginNameAtIndex (uint32_t idx);
244 GetPlatformPluginDescriptionAtIndex (uint32_t idx);
247 AutoCompletePlatformName (const char *partial_name,
248 StringList &matches);
249 //------------------------------------------------------------------
251 //------------------------------------------------------------------
253 RegisterPlugin (const ConstString &name,
254 const char *description,
255 ProcessCreateInstance create_callback,
256 DebuggerInitializeCallback debugger_init_callback = NULL);
259 UnregisterPlugin (ProcessCreateInstance create_callback);
261 static ProcessCreateInstance
262 GetProcessCreateCallbackAtIndex (uint32_t idx);
264 static ProcessCreateInstance
265 GetProcessCreateCallbackForPluginName (const ConstString &name);
268 GetProcessPluginNameAtIndex (uint32_t idx);
271 GetProcessPluginDescriptionAtIndex (uint32_t idx);
273 //------------------------------------------------------------------
275 //------------------------------------------------------------------
277 RegisterPlugin (const ConstString &name,
278 const char *description,
279 SymbolFileCreateInstance create_callback);
282 UnregisterPlugin (SymbolFileCreateInstance create_callback);
284 static SymbolFileCreateInstance
285 GetSymbolFileCreateCallbackAtIndex (uint32_t idx);
287 static SymbolFileCreateInstance
288 GetSymbolFileCreateCallbackForPluginName (const ConstString &name);
291 //------------------------------------------------------------------
293 //------------------------------------------------------------------
295 RegisterPlugin (const ConstString &name,
296 const char *description,
297 SymbolVendorCreateInstance create_callback);
300 UnregisterPlugin (SymbolVendorCreateInstance create_callback);
302 static SymbolVendorCreateInstance
303 GetSymbolVendorCreateCallbackAtIndex (uint32_t idx);
305 static SymbolVendorCreateInstance
306 GetSymbolVendorCreateCallbackForPluginName (const ConstString &name);
308 //------------------------------------------------------------------
310 //------------------------------------------------------------------
312 RegisterPlugin (const ConstString &name,
313 const char *description,
314 UnwindAssemblyCreateInstance create_callback);
317 UnregisterPlugin (UnwindAssemblyCreateInstance create_callback);
319 static UnwindAssemblyCreateInstance
320 GetUnwindAssemblyCreateCallbackAtIndex (uint32_t idx);
322 static UnwindAssemblyCreateInstance
323 GetUnwindAssemblyCreateCallbackForPluginName (const ConstString &name);
325 //------------------------------------------------------------------
326 // Some plug-ins might register a DebuggerInitializeCallback
327 // callback when registering the plug-in. After a new Debugger
328 // instance is created, this DebuggerInitialize function will get
329 // called. This allows plug-ins to install Properties and do any
330 // other initialization that requires a debugger instance.
331 //------------------------------------------------------------------
333 DebuggerInitialize (Debugger &debugger);
335 static lldb::OptionValuePropertiesSP
336 GetSettingForDynamicLoaderPlugin (Debugger &debugger,
337 const ConstString &setting_name);
340 CreateSettingForDynamicLoaderPlugin (Debugger &debugger,
341 const lldb::OptionValuePropertiesSP &properties_sp,
342 const ConstString &description,
343 bool is_global_property);
345 static lldb::OptionValuePropertiesSP
346 GetSettingForPlatformPlugin (Debugger &debugger,
347 const ConstString &setting_name);
350 CreateSettingForPlatformPlugin (Debugger &debugger,
351 const lldb::OptionValuePropertiesSP &properties_sp,
352 const ConstString &description,
353 bool is_global_property);
355 static lldb::OptionValuePropertiesSP
356 GetSettingForProcessPlugin (Debugger &debugger,
357 const ConstString &setting_name);
360 CreateSettingForProcessPlugin (Debugger &debugger,
361 const lldb::OptionValuePropertiesSP &properties_sp,
362 const ConstString &description,
363 bool is_global_property);
368 } // namespace lldb_private
370 #endif // liblldb_PluginManager_h_