]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/PluginManager.h
Merge OpenSSL 1.0.2g.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / PluginManager.h
1 //===-- PluginManager.h -----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10
11 #ifndef liblldb_PluginManager_h_
12 #define liblldb_PluginManager_h_
13
14 #include "lldb/lldb-private.h"
15 #include "lldb/Host/FileSpec.h"
16
17 namespace lldb_private {
18
19 class PluginManager
20 {
21 public:
22     static void
23     Initialize ();
24     
25     static void
26     Terminate ();
27
28     //------------------------------------------------------------------
29     // ABI
30     //------------------------------------------------------------------
31     static bool
32     RegisterPlugin (const ConstString &name,
33                     const char *description,
34                     ABICreateInstance create_callback);
35
36     static bool
37     UnregisterPlugin (ABICreateInstance create_callback);
38
39     static ABICreateInstance
40     GetABICreateCallbackAtIndex (uint32_t idx);
41
42     static ABICreateInstance
43     GetABICreateCallbackForPluginName (const ConstString &name);
44
45
46     //------------------------------------------------------------------
47     // Disassembler
48     //------------------------------------------------------------------
49     static bool
50     RegisterPlugin (const ConstString &name,
51                     const char *description,
52                     DisassemblerCreateInstance create_callback);
53
54     static bool
55     UnregisterPlugin (DisassemblerCreateInstance create_callback);
56
57     static DisassemblerCreateInstance
58     GetDisassemblerCreateCallbackAtIndex (uint32_t idx);
59
60     static DisassemblerCreateInstance
61     GetDisassemblerCreateCallbackForPluginName (const ConstString &name);
62
63
64     //------------------------------------------------------------------
65     // DynamicLoader
66     //------------------------------------------------------------------
67     static bool
68     RegisterPlugin (const ConstString &name,
69                     const char *description,
70                     DynamicLoaderCreateInstance create_callback,
71                     DebuggerInitializeCallback debugger_init_callback = NULL);
72
73     static bool
74     UnregisterPlugin (DynamicLoaderCreateInstance create_callback);
75
76     static DynamicLoaderCreateInstance
77     GetDynamicLoaderCreateCallbackAtIndex (uint32_t idx);
78
79     static DynamicLoaderCreateInstance
80     GetDynamicLoaderCreateCallbackForPluginName (const ConstString &name);
81
82     //------------------------------------------------------------------
83     // JITLoader
84     //------------------------------------------------------------------
85     static bool
86     RegisterPlugin (const ConstString &name,
87                     const char *description,
88                     JITLoaderCreateInstance create_callback,
89                     DebuggerInitializeCallback debugger_init_callback = NULL);
90
91     static bool
92     UnregisterPlugin (JITLoaderCreateInstance create_callback);
93
94     static JITLoaderCreateInstance
95     GetJITLoaderCreateCallbackAtIndex (uint32_t idx);
96
97     static JITLoaderCreateInstance
98     GetJITLoaderCreateCallbackForPluginName (const ConstString &name);
99
100     //------------------------------------------------------------------
101     // EmulateInstruction
102     //------------------------------------------------------------------
103     static bool
104     RegisterPlugin (const ConstString &name,
105                     const char *description,
106                     EmulateInstructionCreateInstance create_callback);
107     
108     static bool
109     UnregisterPlugin (EmulateInstructionCreateInstance create_callback);
110     
111     static EmulateInstructionCreateInstance
112     GetEmulateInstructionCreateCallbackAtIndex (uint32_t idx);
113     
114     static EmulateInstructionCreateInstance
115     GetEmulateInstructionCreateCallbackForPluginName (const ConstString &name);
116
117     //------------------------------------------------------------------
118     // OperatingSystem
119     //------------------------------------------------------------------
120     static bool
121     RegisterPlugin (const ConstString &name,
122                     const char *description,
123                     OperatingSystemCreateInstance create_callback);
124     
125     static bool
126     UnregisterPlugin (OperatingSystemCreateInstance create_callback);
127     
128     static OperatingSystemCreateInstance
129     GetOperatingSystemCreateCallbackAtIndex (uint32_t idx);
130     
131     static OperatingSystemCreateInstance
132     GetOperatingSystemCreateCallbackForPluginName (const ConstString &name);
133
134     //------------------------------------------------------------------
135     // LanguageRuntime
136     //------------------------------------------------------------------
137     static bool
138     RegisterPlugin (const ConstString &name,
139                     const char *description,
140                     LanguageRuntimeCreateInstance create_callback,
141                     LanguageRuntimeGetCommandObject command_callback = nullptr);
142
143     static bool
144     UnregisterPlugin (LanguageRuntimeCreateInstance create_callback);
145
146     static LanguageRuntimeCreateInstance
147     GetLanguageRuntimeCreateCallbackAtIndex (uint32_t idx);
148
149     static LanguageRuntimeGetCommandObject
150     GetLanguageRuntimeGetCommandObjectAtIndex (uint32_t idx);
151
152     static LanguageRuntimeCreateInstance
153     GetLanguageRuntimeCreateCallbackForPluginName (const ConstString &name);
154
155
156     //------------------------------------------------------------------
157     // SystemRuntime
158     //------------------------------------------------------------------
159     static bool
160     RegisterPlugin (const ConstString &name,
161                     const char *description,
162                     SystemRuntimeCreateInstance create_callback);
163
164     static bool
165     UnregisterPlugin (SystemRuntimeCreateInstance create_callback);
166
167     static SystemRuntimeCreateInstance
168     GetSystemRuntimeCreateCallbackAtIndex (uint32_t idx);
169
170     static SystemRuntimeCreateInstance
171     GetSystemRuntimeCreateCallbackForPluginName (const ConstString &name);
172
173
174     //------------------------------------------------------------------
175     // ObjectFile
176     //------------------------------------------------------------------
177     static bool
178     RegisterPlugin (const ConstString &name,
179                     const char *description,
180                     ObjectFileCreateInstance create_callback,
181                     ObjectFileCreateMemoryInstance create_memory_callback,
182                     ObjectFileGetModuleSpecifications get_module_specifications,
183                     ObjectFileSaveCore save_core = NULL);
184
185     static bool
186     UnregisterPlugin (ObjectFileCreateInstance create_callback);
187
188     static ObjectFileCreateInstance
189     GetObjectFileCreateCallbackAtIndex (uint32_t idx);
190     
191     static ObjectFileCreateMemoryInstance
192     GetObjectFileCreateMemoryCallbackAtIndex (uint32_t idx);
193
194     static ObjectFileGetModuleSpecifications
195     GetObjectFileGetModuleSpecificationsCallbackAtIndex (uint32_t idx);
196
197     static ObjectFileCreateInstance
198     GetObjectFileCreateCallbackForPluginName (const ConstString &name);
199
200     static ObjectFileCreateMemoryInstance
201     GetObjectFileCreateMemoryCallbackForPluginName (const ConstString &name);
202
203     static Error
204     SaveCore (const lldb::ProcessSP &process_sp, const FileSpec &outfile);
205
206     //------------------------------------------------------------------
207     // ObjectContainer
208     //------------------------------------------------------------------
209     static bool
210     RegisterPlugin (const ConstString &name,
211                     const char *description,
212                     ObjectContainerCreateInstance create_callback,
213                     ObjectFileGetModuleSpecifications get_module_specifications);
214
215     static bool
216     UnregisterPlugin (ObjectContainerCreateInstance create_callback);
217
218     static ObjectContainerCreateInstance
219     GetObjectContainerCreateCallbackAtIndex (uint32_t idx);
220
221     static ObjectContainerCreateInstance
222     GetObjectContainerCreateCallbackForPluginName (const ConstString &name);
223
224     static ObjectFileGetModuleSpecifications
225     GetObjectContainerGetModuleSpecificationsCallbackAtIndex (uint32_t idx);
226
227     //------------------------------------------------------------------
228     // LogChannel
229     //------------------------------------------------------------------
230     static bool
231     RegisterPlugin (const ConstString &name,
232                     const char *description,
233                     LogChannelCreateInstance create_callback);
234
235     static bool
236     UnregisterPlugin (LogChannelCreateInstance create_callback);
237
238     static LogChannelCreateInstance
239     GetLogChannelCreateCallbackAtIndex (uint32_t idx);
240
241     static LogChannelCreateInstance
242     GetLogChannelCreateCallbackForPluginName (const ConstString &name);
243
244     static const char *
245     GetLogChannelCreateNameAtIndex (uint32_t idx);
246
247     //------------------------------------------------------------------
248     // Platform
249     //------------------------------------------------------------------
250     static bool
251     RegisterPlugin (const ConstString &name,
252                     const char *description,
253                     PlatformCreateInstance create_callback,
254                     DebuggerInitializeCallback debugger_init_callback = NULL);
255
256     static bool
257     UnregisterPlugin (PlatformCreateInstance create_callback);
258
259     static PlatformCreateInstance
260     GetPlatformCreateCallbackAtIndex (uint32_t idx);
261
262     static PlatformCreateInstance
263     GetPlatformCreateCallbackForPluginName (const ConstString &name);
264     
265     static const char *
266     GetPlatformPluginNameAtIndex (uint32_t idx);
267
268     static const char *
269     GetPlatformPluginDescriptionAtIndex (uint32_t idx);
270
271     static size_t
272     AutoCompletePlatformName (const char *partial_name, 
273                               StringList &matches);
274     //------------------------------------------------------------------
275     // Process
276     //------------------------------------------------------------------
277     static bool
278     RegisterPlugin (const ConstString &name,
279                     const char *description,
280                     ProcessCreateInstance create_callback,
281                     DebuggerInitializeCallback debugger_init_callback = NULL);
282     
283     static bool
284     UnregisterPlugin (ProcessCreateInstance create_callback);
285     
286     static ProcessCreateInstance
287     GetProcessCreateCallbackAtIndex (uint32_t idx);
288     
289     static ProcessCreateInstance
290     GetProcessCreateCallbackForPluginName (const ConstString &name);
291     
292     static const char *
293     GetProcessPluginNameAtIndex (uint32_t idx);
294     
295     static const char *
296     GetProcessPluginDescriptionAtIndex (uint32_t idx);
297
298     //------------------------------------------------------------------
299     // SymbolFile
300     //------------------------------------------------------------------
301     static bool
302     RegisterPlugin (const ConstString &name,
303                     const char *description,
304                     SymbolFileCreateInstance create_callback);
305
306     static bool
307     UnregisterPlugin (SymbolFileCreateInstance create_callback);
308
309     static SymbolFileCreateInstance
310     GetSymbolFileCreateCallbackAtIndex (uint32_t idx);
311
312     static SymbolFileCreateInstance
313     GetSymbolFileCreateCallbackForPluginName (const ConstString &name);
314
315
316     //------------------------------------------------------------------
317     // SymbolVendor
318     //------------------------------------------------------------------
319     static bool
320     RegisterPlugin (const ConstString &name,
321                     const char *description,
322                     SymbolVendorCreateInstance create_callback);
323
324     static bool
325     UnregisterPlugin (SymbolVendorCreateInstance create_callback);
326
327     static SymbolVendorCreateInstance
328     GetSymbolVendorCreateCallbackAtIndex (uint32_t idx);
329
330     static SymbolVendorCreateInstance
331     GetSymbolVendorCreateCallbackForPluginName (const ConstString &name);
332
333     //------------------------------------------------------------------
334     // UnwindAssembly
335     //------------------------------------------------------------------
336     static bool
337     RegisterPlugin (const ConstString &name,
338                     const char *description,
339                     UnwindAssemblyCreateInstance create_callback);
340
341     static bool
342     UnregisterPlugin (UnwindAssemblyCreateInstance create_callback);
343
344     static UnwindAssemblyCreateInstance
345     GetUnwindAssemblyCreateCallbackAtIndex (uint32_t idx);
346
347     static UnwindAssemblyCreateInstance
348     GetUnwindAssemblyCreateCallbackForPluginName (const ConstString &name);
349     
350     //------------------------------------------------------------------
351     // MemoryHistory
352     //------------------------------------------------------------------
353     static bool
354     RegisterPlugin (const ConstString &name,
355                     const char *description,
356                     MemoryHistoryCreateInstance create_callback);
357     
358     static bool
359     UnregisterPlugin (MemoryHistoryCreateInstance create_callback);
360     
361     static MemoryHistoryCreateInstance
362     GetMemoryHistoryCreateCallbackAtIndex (uint32_t idx);
363     
364     static MemoryHistoryCreateInstance
365     GetMemoryHistoryCreateCallbackForPluginName (const ConstString &name);
366
367     //------------------------------------------------------------------
368     // InstrumentationRuntime
369     //------------------------------------------------------------------
370     static bool
371     RegisterPlugin (const ConstString &name,
372                     const char *description,
373                     InstrumentationRuntimeCreateInstance create_callback,
374                     InstrumentationRuntimeGetType get_type_callback);
375     
376     static bool
377     UnregisterPlugin (InstrumentationRuntimeCreateInstance create_callback);
378
379     static InstrumentationRuntimeGetType
380     GetInstrumentationRuntimeGetTypeCallbackAtIndex (uint32_t idx);
381     
382     static InstrumentationRuntimeCreateInstance
383     GetInstrumentationRuntimeCreateCallbackAtIndex (uint32_t idx);
384     
385     static InstrumentationRuntimeCreateInstance
386     GetInstrumentationRuntimeCreateCallbackForPluginName (const ConstString &name);
387
388     
389     //------------------------------------------------------------------
390     // Some plug-ins might register a DebuggerInitializeCallback
391     // callback when registering the plug-in. After a new Debugger
392     // instance is created, this DebuggerInitialize function will get
393     // called. This allows plug-ins to install Properties and do any
394     // other initialization that requires a debugger instance.
395     //------------------------------------------------------------------
396     static void
397     DebuggerInitialize (Debugger &debugger);
398     
399     static lldb::OptionValuePropertiesSP
400     GetSettingForDynamicLoaderPlugin (Debugger &debugger,
401                                       const ConstString &setting_name);
402     
403     static bool
404     CreateSettingForDynamicLoaderPlugin (Debugger &debugger,
405                                          const lldb::OptionValuePropertiesSP &properties_sp,
406                                          const ConstString &description,
407                                          bool is_global_property);
408     
409     static lldb::OptionValuePropertiesSP
410     GetSettingForPlatformPlugin (Debugger &debugger,
411                                        const ConstString &setting_name);
412     
413     static bool
414     CreateSettingForPlatformPlugin (Debugger &debugger,
415                                          const lldb::OptionValuePropertiesSP &properties_sp,
416                                          const ConstString &description,
417                                          bool is_global_property);
418
419     static lldb::OptionValuePropertiesSP
420     GetSettingForProcessPlugin (Debugger &debugger,
421                                 const ConstString &setting_name);
422     
423     static bool
424     CreateSettingForProcessPlugin (Debugger &debugger,
425                                    const lldb::OptionValuePropertiesSP &properties_sp,
426                                    const ConstString &description,
427                                    bool is_global_property);
428
429 };
430
431
432 } // namespace lldb_private
433
434 #endif  // liblldb_PluginManager_h_