LLDB mainline
PluginManager.h
Go to the documentation of this file.
1//===-- PluginManager.h -----------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_CORE_PLUGINMANAGER_H
10#define LLDB_CORE_PLUGINMANAGER_H
11
18#include "lldb/Utility/Status.h"
20#include "lldb/lldb-forward.h"
22#include "llvm/ADT/ArrayRef.h"
23#include "llvm/ADT/StringRef.h"
24#include "llvm/Support/JSON.h"
25
26#include <cstddef>
27#include <cstdint>
28#include <functional>
29#include <vector>
30
31#define LLDB_PLUGIN_DEFINE_ADV(ClassName, PluginName) \
32 namespace lldb_private { \
33 void lldb_initialize_##PluginName() { ClassName::Initialize(); } \
34 void lldb_terminate_##PluginName() { ClassName::Terminate(); } \
35 }
36
37#define LLDB_PLUGIN_DEFINE(PluginName) \
38 LLDB_PLUGIN_DEFINE_ADV(PluginName, PluginName)
39
40// FIXME: Generate me with CMake
41#define LLDB_PLUGIN_DECLARE(PluginName) \
42 namespace lldb_private { \
43 extern void lldb_initialize_##PluginName(); \
44 extern void lldb_terminate_##PluginName(); \
45 }
46
47#define LLDB_PLUGIN_INITIALIZE(PluginName) lldb_initialize_##PluginName()
48#define LLDB_PLUGIN_TERMINATE(PluginName) lldb_terminate_##PluginName()
49
50namespace lldb_private {
51class CommandInterpreter;
52class Debugger;
53class StringList;
54
56 llvm::StringRef name = "";
57 llvm::StringRef description = "";
58 bool enabled = false;
59};
60
61// Define some data structures to describe known plugin "namespaces".
62// The PluginManager is organized into a series of static functions
63// that operate on different types of plugins. For example SystemRuntime
64// and ObjectFile plugins.
65//
66// The namespace name is used a prefix when matching plugin names. For example,
67// if we have an "macosx" plugin in the "system-runtime" namespace then we will
68// match a plugin name pattern against the "system-runtime.macosx" name.
69//
70// The plugin namespace here is used so we can operate on all the plugins
71// of a given type so it is easy to enable or disable them as a group.
72using GetPluginInfo = std::function<std::vector<RegisteredPluginInfo>()>;
73using SetPluginEnabled = std::function<bool(llvm::StringRef, bool)>;
79
81public:
82 static void Initialize();
83
84 static void Terminate();
85
86 // Support for enabling and disabling plugins.
87
88 // Return the plugins that can be enabled or disabled by the user.
89 static llvm::ArrayRef<PluginNamespace> GetPluginNamespaces();
90
91 // Generate a json object that describes the plugins that are available.
92 // This is a json representation of the plugin info returned by
93 // GetPluginNamespaces().
94 //
95 // {
96 // <plugin-namespace>: [
97 // {
98 // "enabled": <bool>,
99 // "name": <plugin-name>,
100 // },
101 // ...
102 // ],
103 // ...
104 // }
105 //
106 // If pattern is given it will be used to filter the plugins that are
107 // are returned. The pattern filters the plugin names using the
108 // PluginManager::MatchPluginName() function.
109 static llvm::json::Object GetJSON(llvm::StringRef pattern = "");
110
111 // Return true if the pattern matches the plugin name.
112 //
113 // The pattern matches the name if it is exactly equal to the namespace name
114 // or if it is equal to the qualified name, which is the namespace name
115 // followed by a dot and the plugin name (e.g. "system-runtime.foo").
116 //
117 // An empty pattern matches all plugins.
118 static bool MatchPluginName(llvm::StringRef pattern,
119 const PluginNamespace &plugin_ns,
121
122 // ABI
123 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
124 ABICreateInstance create_callback);
125
126 static bool UnregisterPlugin(ABICreateInstance create_callback);
127
129
130 // Architecture
131 static void RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
132 ArchitectureCreateInstance create_callback);
133
134 static void UnregisterPlugin(ArchitectureCreateInstance create_callback);
135
136 static std::unique_ptr<Architecture>
138
139 // Disassembler
140 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
141 DisassemblerCreateInstance create_callback);
142
143 static bool UnregisterPlugin(DisassemblerCreateInstance create_callback);
144
147
149 GetDisassemblerCreateCallbackForPluginName(llvm::StringRef name);
150
151 // DynamicLoader
152 static bool
153 RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
154 DynamicLoaderCreateInstance create_callback,
155 DebuggerInitializeCallback debugger_init_callback = nullptr);
156
157 static bool UnregisterPlugin(DynamicLoaderCreateInstance create_callback);
158
161
164
165 // JITLoader
166 static bool
167 RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
168 JITLoaderCreateInstance create_callback,
169 DebuggerInitializeCallback debugger_init_callback = nullptr);
170
171 static bool UnregisterPlugin(JITLoaderCreateInstance create_callback);
172
175
176 // EmulateInstruction
177 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
178 EmulateInstructionCreateInstance create_callback);
179
180 static bool
182
185
188
189 // OperatingSystem
190 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
191 OperatingSystemCreateInstance create_callback,
192 DebuggerInitializeCallback debugger_init_callback);
193
194 static bool UnregisterPlugin(OperatingSystemCreateInstance create_callback);
195
198
201
202 // Language
203 static bool
204 RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
205 LanguageCreateInstance create_callback,
206 DebuggerInitializeCallback debugger_init_callback = nullptr);
207
208 static bool UnregisterPlugin(LanguageCreateInstance create_callback);
209
211
212 // LanguageRuntime
213 static bool RegisterPlugin(
214 llvm::StringRef name, llvm::StringRef description,
215 LanguageRuntimeCreateInstance create_callback,
216 LanguageRuntimeGetCommandObject command_callback = nullptr,
217 LanguageRuntimeGetExceptionPrecondition precondition_callback = nullptr);
218
219 static bool UnregisterPlugin(LanguageRuntimeCreateInstance create_callback);
220
223
226
229
230 // SystemRuntime
231 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
232 SystemRuntimeCreateInstance create_callback);
233
234 static bool UnregisterPlugin(SystemRuntimeCreateInstance create_callback);
235
238
239 // ObjectFile
240 static bool
241 RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
242 ObjectFileCreateInstance create_callback,
243 ObjectFileCreateMemoryInstance create_memory_callback,
244 ObjectFileGetModuleSpecifications get_module_specifications,
245 ObjectFileSaveCore save_core = nullptr,
246 DebuggerInitializeCallback debugger_init_callback = nullptr);
247
248 static bool UnregisterPlugin(ObjectFileCreateInstance create_callback);
249
250 static bool IsRegisteredObjectFilePluginName(llvm::StringRef name);
251
254
257
260
263
264 static Status SaveCore(lldb_private::SaveCoreOptions &core_options);
265
266 static std::vector<llvm::StringRef> GetSaveCorePluginNames();
267
268 // ObjectContainer
269 static bool RegisterPlugin(
270 llvm::StringRef name, llvm::StringRef description,
271 ObjectContainerCreateInstance create_callback,
272 ObjectFileGetModuleSpecifications get_module_specifications,
273 ObjectContainerCreateMemoryInstance create_memory_callback = nullptr);
274
275 static bool UnregisterPlugin(ObjectContainerCreateInstance create_callback);
276
279
282
285
286 // Platform
287 static bool
288 RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
289 PlatformCreateInstance create_callback,
290 DebuggerInitializeCallback debugger_init_callback = nullptr);
291
292 static bool UnregisterPlugin(PlatformCreateInstance create_callback);
293
295
297 GetPlatformCreateCallbackForPluginName(llvm::StringRef name);
298
299 static llvm::StringRef GetPlatformPluginNameAtIndex(uint32_t idx);
300
301 static llvm::StringRef GetPlatformPluginDescriptionAtIndex(uint32_t idx);
302
303 static void AutoCompletePlatformName(llvm::StringRef partial_name,
304 CompletionRequest &request);
305 // Process
306 static bool
307 RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
308 ProcessCreateInstance create_callback,
309 DebuggerInitializeCallback debugger_init_callback = nullptr);
310
311 static bool UnregisterPlugin(ProcessCreateInstance create_callback);
312
314
316 GetProcessCreateCallbackForPluginName(llvm::StringRef name);
317
318 static llvm::StringRef GetProcessPluginNameAtIndex(uint32_t idx);
319
320 static llvm::StringRef GetProcessPluginDescriptionAtIndex(uint32_t idx);
321
322 static void AutoCompleteProcessName(llvm::StringRef partial_name,
323 CompletionRequest &request);
324
325 // Protocol
326 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
327 ProtocolServerCreateInstance create_callback);
328
329 static bool UnregisterPlugin(ProtocolServerCreateInstance create_callback);
330
331 static llvm::StringRef GetProtocolServerPluginNameAtIndex(uint32_t idx);
332
334 GetProtocolCreateCallbackForPluginName(llvm::StringRef name);
335
336 // Register Type Provider
337 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
338 RegisterTypeBuilderCreateInstance create_callback);
339
340 static bool
342
344
345 // ScriptInterpreter
346 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
347 lldb::ScriptLanguage script_lang,
348 ScriptInterpreterCreateInstance create_callback);
349
350 static bool UnregisterPlugin(ScriptInterpreterCreateInstance create_callback);
351
354
357 Debugger &debugger);
358
359 // StructuredDataPlugin
360
361 /// Register a StructuredDataPlugin class along with optional
362 /// callbacks for debugger initialization and Process launch info
363 /// filtering and manipulation.
364 ///
365 /// \param[in] name
366 /// The name of the plugin.
367 ///
368 /// \param[in] description
369 /// A description string for the plugin.
370 ///
371 /// \param[in] create_callback
372 /// The callback that will be invoked to create an instance of
373 /// the callback. This may not be nullptr.
374 ///
375 /// \param[in] debugger_init_callback
376 /// An optional callback that will be made when a Debugger
377 /// instance is initialized.
378 ///
379 /// \param[in] filter_callback
380 /// An optional callback that will be invoked before LLDB
381 /// launches a process for debugging. The callback must
382 /// do the following:
383 /// 1. Only do something if the plugin's behavior is enabled.
384 /// 2. Only make changes for processes that are relevant to the
385 /// plugin. The callback gets a pointer to the Target, which
386 /// can be inspected as needed. The ProcessLaunchInfo is
387 /// provided in read-write mode, and may be modified by the
388 /// plugin if, for instance, additional environment variables
389 /// are needed to support the feature when enabled.
390 ///
391 /// \return
392 /// Returns true upon success; otherwise, false.
393 static bool
394 RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
396 DebuggerInitializeCallback debugger_init_callback = nullptr,
397 StructuredDataFilterLaunchInfo filter_callback = nullptr);
398
399 static bool
401
404
407 bool &iteration_complete);
408
409 // SymbolFile
410 static bool
411 RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
412 SymbolFileCreateInstance create_callback,
413 DebuggerInitializeCallback debugger_init_callback = nullptr);
414
415 static bool UnregisterPlugin(SymbolFileCreateInstance create_callback);
416
419
420 // SymbolVendor
421 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
422 SymbolVendorCreateInstance create_callback);
423
424 static bool UnregisterPlugin(SymbolVendorCreateInstance create_callback);
425
428
429 // SymbolLocator
430 static bool RegisterPlugin(
431 llvm::StringRef name, llvm::StringRef description,
432 SymbolLocatorCreateInstance create_callback,
433 SymbolLocatorLocateExecutableObjectFile locate_executable_object_file =
434 nullptr,
435 SymbolLocatorLocateExecutableSymbolFile locate_executable_symbol_file =
436 nullptr,
437 SymbolLocatorDownloadObjectAndSymbolFile download_object_symbol_file =
438 nullptr,
439 SymbolLocatorFindSymbolFileInBundle find_symbol_file_in_bundle = nullptr,
440 DebuggerInitializeCallback debugger_init_callback = nullptr);
441
442 static bool UnregisterPlugin(SymbolLocatorCreateInstance create_callback);
443
446
447 static ModuleSpec LocateExecutableObjectFile(const ModuleSpec &module_spec,
448 StatisticsMap &map);
449
450 static FileSpec
451 LocateExecutableSymbolFile(const ModuleSpec &module_spec,
452 const FileSpecList &default_search_paths,
453 StatisticsMap &map);
454
455 static bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
456 Status &error,
457 bool force_lookup = true,
458 bool copy_executable = true);
459
460 static FileSpec FindSymbolFileInBundle(const FileSpec &dsym_bundle_fspec,
461 const UUID *uuid,
462 const ArchSpec *arch);
463
464 // Trace
465 static bool RegisterPlugin(
466 llvm::StringRef name, llvm::StringRef description,
467 TraceCreateInstanceFromBundle create_callback_from_bundle,
468 TraceCreateInstanceForLiveProcess create_callback_for_live_process,
469 llvm::StringRef schema,
470 DebuggerInitializeCallback debugger_init_callback);
471
472 static bool
474
476 GetTraceCreateCallback(llvm::StringRef plugin_name);
477
479 GetTraceCreateCallbackForLiveProcess(llvm::StringRef plugin_name);
480
481 /// Get the JSON schema for a trace bundle description file corresponding to
482 /// the given plugin.
483 ///
484 /// \param[in] plugin_name
485 /// The name of the plugin.
486 ///
487 /// \return
488 /// An empty \a StringRef if no plugin was found with that plugin name,
489 /// otherwise the actual schema is returned.
490 static llvm::StringRef GetTraceSchema(llvm::StringRef plugin_name);
491
492 /// Get the JSON schema for a trace bundle description file corresponding to
493 /// the plugin given by its index.
494 ///
495 /// \param[in] index
496 /// The index of the plugin to get the schema of.
497 ///
498 /// \return
499 /// An empty \a StringRef if the index is greater than or equal to the
500 /// number plugins, otherwise the actual schema is returned.
501 static llvm::StringRef GetTraceSchema(size_t index);
502
503 // TraceExporter
504
505 /// \param[in] create_thread_trace_export_command
506 /// This callback is used to create a CommandObject that will be listed
507 /// under "thread trace export". Can be \b null.
508 static bool RegisterPlugin(
509 llvm::StringRef name, llvm::StringRef description,
510 TraceExporterCreateInstance create_callback,
511 ThreadTraceExportCommandCreator create_thread_trace_export_command);
512
514 GetTraceExporterCreateCallback(llvm::StringRef plugin_name);
515
516 static bool UnregisterPlugin(TraceExporterCreateInstance create_callback);
517
518 static llvm::StringRef GetTraceExporterPluginNameAtIndex(uint32_t index);
519
520 /// Return the callback used to create the CommandObject that will be listed
521 /// under "thread trace export". Can be \b null.
524
525 // UnwindAssembly
526 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
527 UnwindAssemblyCreateInstance create_callback);
528
529 static bool UnregisterPlugin(UnwindAssemblyCreateInstance create_callback);
530
533
534 // MemoryHistory
535 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
536 MemoryHistoryCreateInstance create_callback);
537
538 static bool UnregisterPlugin(MemoryHistoryCreateInstance create_callback);
539
542
543 // InstrumentationRuntime
544 static bool
545 RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
547 InstrumentationRuntimeGetType get_type_callback);
548
549 static bool
551
554
557
558 // TypeSystem
559 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
560 TypeSystemCreateInstance create_callback,
561 LanguageSet supported_languages_for_types,
562 LanguageSet supported_languages_for_expressions);
563
564 static bool UnregisterPlugin(TypeSystemCreateInstance create_callback);
565
568
570
572
573 // Scripted Interface
574 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
575 ScriptedInterfaceCreateInstance create_callback,
576 lldb::ScriptLanguage language,
578
579 static bool UnregisterPlugin(ScriptedInterfaceCreateInstance create_callback);
580
581 static uint32_t GetNumScriptedInterfaces();
582
583 static llvm::StringRef GetScriptedInterfaceNameAtIndex(uint32_t idx);
584
585 static llvm::StringRef GetScriptedInterfaceDescriptionAtIndex(uint32_t idx);
586
588
591
592 // REPL
593 static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
594 REPLCreateInstance create_callback,
595 LanguageSet supported_languages);
596
597 static bool UnregisterPlugin(REPLCreateInstance create_callback);
598
600
602
604
605 // Some plug-ins might register a DebuggerInitializeCallback callback when
606 // registering the plug-in. After a new Debugger instance is created, this
607 // DebuggerInitialize function will get called. This allows plug-ins to
608 // install Properties and do any other initialization that requires a
609 // debugger instance.
610 static void DebuggerInitialize(Debugger &debugger);
611
614 llvm::StringRef setting_name);
615
617 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
618 llvm::StringRef description, bool is_global_property);
619
621 GetSettingForPlatformPlugin(Debugger &debugger, llvm::StringRef setting_name);
622
624 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
625 llvm::StringRef description, bool is_global_property);
626
628 GetSettingForProcessPlugin(Debugger &debugger, llvm::StringRef setting_name);
629
631 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
632 llvm::StringRef description, bool is_global_property);
633
636 llvm::StringRef setting_name);
637
639 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
640 llvm::StringRef description, bool is_global_property);
641
642 static bool CreateSettingForTracePlugin(
643 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
644 llvm::StringRef description, bool is_global_property);
645
648 llvm::StringRef setting_name);
649
651 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
652 llvm::StringRef description, bool is_global_property);
653
656 llvm::StringRef setting_name);
657
659 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
660 llvm::StringRef description, bool is_global_property);
661
664 llvm::StringRef setting_name);
665
667 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
668 llvm::StringRef description, bool is_global_property);
669
672 llvm::StringRef setting_name);
673
675 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
676 llvm::StringRef description, bool is_global_property);
677
680 llvm::StringRef setting_name);
681
683 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
684 llvm::StringRef description, bool is_global_property);
685
688 llvm::StringRef setting_name);
689
691 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
692 llvm::StringRef description, bool is_global_property);
693
694 //
695 // Plugin Info+Enable Declarations
696 //
697 static std::vector<RegisteredPluginInfo> GetABIPluginInfo();
698 static bool SetABIPluginEnabled(llvm::StringRef name, bool enable);
699
700 static std::vector<RegisteredPluginInfo> GetArchitecturePluginInfo();
701 static bool SetArchitecturePluginEnabled(llvm::StringRef name, bool enable);
702
703 static std::vector<RegisteredPluginInfo> GetDisassemblerPluginInfo();
704 static bool SetDisassemblerPluginEnabled(llvm::StringRef name, bool enable);
705
706 static std::vector<RegisteredPluginInfo> GetDynamicLoaderPluginInfo();
707 static bool SetDynamicLoaderPluginEnabled(llvm::StringRef name, bool enable);
708
709 static std::vector<RegisteredPluginInfo> GetEmulateInstructionPluginInfo();
710 static bool SetEmulateInstructionPluginEnabled(llvm::StringRef name,
711 bool enable);
712
713 static std::vector<RegisteredPluginInfo>
715 static bool SetInstrumentationRuntimePluginEnabled(llvm::StringRef name,
716 bool enable);
717
718 static std::vector<RegisteredPluginInfo> GetJITLoaderPluginInfo();
719 static bool SetJITLoaderPluginEnabled(llvm::StringRef name, bool enable);
720
721 static std::vector<RegisteredPluginInfo> GetLanguagePluginInfo();
722 static bool SetLanguagePluginEnabled(llvm::StringRef name, bool enable);
723
724 static std::vector<RegisteredPluginInfo> GetLanguageRuntimePluginInfo();
725 static bool SetLanguageRuntimePluginEnabled(llvm::StringRef name,
726 bool enable);
727
728 static std::vector<RegisteredPluginInfo> GetMemoryHistoryPluginInfo();
729 static bool SetMemoryHistoryPluginEnabled(llvm::StringRef name, bool enable);
730
731 static std::vector<RegisteredPluginInfo> GetObjectContainerPluginInfo();
732 static bool SetObjectContainerPluginEnabled(llvm::StringRef name,
733 bool enable);
734
735 static std::vector<RegisteredPluginInfo> GetObjectFilePluginInfo();
736 static bool SetObjectFilePluginEnabled(llvm::StringRef name, bool enable);
737
738 static std::vector<RegisteredPluginInfo> GetOperatingSystemPluginInfo();
739 static bool SetOperatingSystemPluginEnabled(llvm::StringRef name,
740 bool enable);
741
742 static std::vector<RegisteredPluginInfo> GetPlatformPluginInfo();
743 static bool SetPlatformPluginEnabled(llvm::StringRef name, bool enable);
744
745 static std::vector<RegisteredPluginInfo> GetProcessPluginInfo();
746 static bool SetProcessPluginEnabled(llvm::StringRef name, bool enable);
747
748 static std::vector<RegisteredPluginInfo> GetREPLPluginInfo();
749 static bool SetREPLPluginEnabled(llvm::StringRef name, bool enable);
750
751 static std::vector<RegisteredPluginInfo> GetRegisterTypeBuilderPluginInfo();
752 static bool SetRegisterTypeBuilderPluginEnabled(llvm::StringRef name,
753 bool enable);
754
755 static std::vector<RegisteredPluginInfo> GetScriptInterpreterPluginInfo();
756 static bool SetScriptInterpreterPluginEnabled(llvm::StringRef name,
757 bool enable);
758
759 static std::vector<RegisteredPluginInfo> GetScriptedInterfacePluginInfo();
760 static bool SetScriptedInterfacePluginEnabled(llvm::StringRef name,
761 bool enable);
762
763 static std::vector<RegisteredPluginInfo> GetStructuredDataPluginInfo();
764 static bool SetStructuredDataPluginEnabled(llvm::StringRef name, bool enable);
765
766 static std::vector<RegisteredPluginInfo> GetSymbolFilePluginInfo();
767 static bool SetSymbolFilePluginEnabled(llvm::StringRef name, bool enable);
768
769 static std::vector<RegisteredPluginInfo> GetSymbolLocatorPluginInfo();
770 static bool SetSymbolLocatorPluginEnabled(llvm::StringRef name, bool enable);
771
772 static std::vector<RegisteredPluginInfo> GetSymbolVendorPluginInfo();
773 static bool SetSymbolVendorPluginEnabled(llvm::StringRef name, bool enable);
774
775 static std::vector<RegisteredPluginInfo> GetSystemRuntimePluginInfo();
776 static bool SetSystemRuntimePluginEnabled(llvm::StringRef name, bool enable);
777
778 static std::vector<RegisteredPluginInfo> GetTracePluginInfo();
779 static bool SetTracePluginEnabled(llvm::StringRef name, bool enable);
780
781 static std::vector<RegisteredPluginInfo> GetTraceExporterPluginInfo();
782 static bool SetTraceExporterPluginEnabled(llvm::StringRef name, bool enable);
783
784 static std::vector<RegisteredPluginInfo> GetTypeSystemPluginInfo();
785 static bool SetTypeSystemPluginEnabled(llvm::StringRef name, bool enable);
786
787 static std::vector<RegisteredPluginInfo> GetUnwindAssemblyPluginInfo();
788 static bool SetUnwindAssemblyPluginEnabled(llvm::StringRef name, bool enable);
789
790 static void AutoCompletePluginName(llvm::StringRef partial_name,
791 CompletionRequest &request);
792};
793
794} // namespace lldb_private
795
796#endif // LLDB_CORE_PLUGINMANAGER_H
static llvm::raw_ostream & error(Stream &strm)
An architecture specification class.
Definition ArchSpec.h:31
"lldb/Utility/ArgCompletionRequest.h"
A class to manage flag bits.
Definition Debugger.h:80
A file collection class.
A file utility class.
Definition FileSpec.h:57
static bool SetArchitecturePluginEnabled(llvm::StringRef name, bool enable)
static llvm::StringRef GetPlatformPluginDescriptionAtIndex(uint32_t idx)
static bool SetPlatformPluginEnabled(llvm::StringRef name, bool enable)
static bool SetScriptInterpreterPluginEnabled(llvm::StringRef name, bool enable)
static bool MatchPluginName(llvm::StringRef pattern, const PluginNamespace &plugin_ns, const RegisteredPluginInfo &plugin)
static lldb::OptionValuePropertiesSP GetSettingForStructuredDataPlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool SetMemoryHistoryPluginEnabled(llvm::StringRef name, bool enable)
static std::vector< RegisteredPluginInfo > GetSystemRuntimePluginInfo()
static llvm::StringRef GetTraceExporterPluginNameAtIndex(uint32_t index)
static bool CreateSettingForJITLoaderPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static ProcessCreateInstance GetProcessCreateCallbackAtIndex(uint32_t idx)
static bool SetRegisterTypeBuilderPluginEnabled(llvm::StringRef name, bool enable)
static bool SetTraceExporterPluginEnabled(llvm::StringRef name, bool enable)
static JITLoaderCreateInstance GetJITLoaderCreateCallbackAtIndex(uint32_t idx)
static ABICreateInstance GetABICreateCallbackAtIndex(uint32_t idx)
static LanguageSet GetAllTypeSystemSupportedLanguagesForExpressions()
static bool SetInstrumentationRuntimePluginEnabled(llvm::StringRef name, bool enable)
static bool CreateSettingForOperatingSystemPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static lldb::OptionValuePropertiesSP GetSettingForObjectFilePlugin(Debugger &debugger, llvm::StringRef setting_name)
static void AutoCompletePlatformName(llvm::StringRef partial_name, CompletionRequest &request)
static TraceExporterCreateInstance GetTraceExporterCreateCallback(llvm::StringRef plugin_name)
static bool SetDynamicLoaderPluginEnabled(llvm::StringRef name, bool enable)
static llvm::json::Object GetJSON(llvm::StringRef pattern="")
static bool CreateSettingForObjectFilePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static bool SetScriptedInterfacePluginEnabled(llvm::StringRef name, bool enable)
static bool SetOperatingSystemPluginEnabled(llvm::StringRef name, bool enable)
static lldb::ScriptInterpreterSP GetScriptInterpreterForLanguage(lldb::ScriptLanguage script_lang, Debugger &debugger)
static void AutoCompleteProcessName(llvm::StringRef partial_name, CompletionRequest &request)
static ThreadTraceExportCommandCreator GetThreadTraceExportCommandCreatorAtIndex(uint32_t index)
Return the callback used to create the CommandObject that will be listed under "thread trace export".
static LanguageSet GetREPLAllTypeSystemSupportedLanguages()
static std::vector< RegisteredPluginInfo > GetMemoryHistoryPluginInfo()
static std::vector< RegisteredPluginInfo > GetLanguagePluginInfo()
static PlatformCreateInstance GetPlatformCreateCallbackAtIndex(uint32_t idx)
static bool CreateSettingForTracePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static std::vector< RegisteredPluginInfo > GetTraceExporterPluginInfo()
static UnwindAssemblyCreateInstance GetUnwindAssemblyCreateCallbackAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForOperatingSystemPlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec, Status &error, bool force_lookup=true, bool copy_executable=true)
static std::vector< RegisteredPluginInfo > GetLanguageRuntimePluginInfo()
static SymbolFileCreateInstance GetSymbolFileCreateCallbackAtIndex(uint32_t idx)
static bool SetLanguageRuntimePluginEnabled(llvm::StringRef name, bool enable)
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static lldb::ScriptLanguage GetScriptedInterfaceLanguageAtIndex(uint32_t idx)
static TypeSystemCreateInstance GetTypeSystemCreateCallbackAtIndex(uint32_t idx)
static InstrumentationRuntimeGetType GetInstrumentationRuntimeGetTypeCallbackAtIndex(uint32_t idx)
static llvm::StringRef GetTraceSchema(llvm::StringRef plugin_name)
Get the JSON schema for a trace bundle description file corresponding to the given plugin.
static std::vector< RegisteredPluginInfo > GetSymbolLocatorPluginInfo()
static std::vector< RegisteredPluginInfo > GetSymbolVendorPluginInfo()
static SymbolLocatorCreateInstance GetSymbolLocatorCreateCallbackAtIndex(uint32_t idx)
static bool SetUnwindAssemblyPluginEnabled(llvm::StringRef name, bool enable)
static lldb::OptionValuePropertiesSP GetSettingForCPlusPlusLanguagePlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool SetDisassemblerPluginEnabled(llvm::StringRef name, bool enable)
static bool SetSystemRuntimePluginEnabled(llvm::StringRef name, bool enable)
static TraceCreateInstanceForLiveProcess GetTraceCreateCallbackForLiveProcess(llvm::StringRef plugin_name)
static LanguageRuntimeCreateInstance GetLanguageRuntimeCreateCallbackAtIndex(uint32_t idx)
static std::vector< RegisteredPluginInfo > GetObjectFilePluginInfo()
static std::unique_ptr< Architecture > CreateArchitectureInstance(const ArchSpec &arch)
static SystemRuntimeCreateInstance GetSystemRuntimeCreateCallbackAtIndex(uint32_t idx)
static std::vector< RegisteredPluginInfo > GetArchitecturePluginInfo()
static lldb::OptionValuePropertiesSP GetSettingForSymbolLocatorPlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool SetStructuredDataPluginEnabled(llvm::StringRef name, bool enable)
static uint32_t GetNumScriptedInterfaces()
static bool SetObjectContainerPluginEnabled(llvm::StringRef name, bool enable)
static bool CreateSettingForProcessPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static SymbolVendorCreateInstance GetSymbolVendorCreateCallbackAtIndex(uint32_t idx)
static LanguageRuntimeGetCommandObject GetLanguageRuntimeGetCommandObjectAtIndex(uint32_t idx)
static OperatingSystemCreateInstance GetOperatingSystemCreateCallbackAtIndex(uint32_t idx)
static std::vector< RegisteredPluginInfo > GetJITLoaderPluginInfo()
static std::vector< RegisteredPluginInfo > GetREPLPluginInfo()
static lldb::OptionValuePropertiesSP GetSettingForPlatformPlugin(Debugger &debugger, llvm::StringRef setting_name)
static LanguageRuntimeGetExceptionPrecondition GetLanguageRuntimeGetExceptionPreconditionAtIndex(uint32_t idx)
static std::vector< RegisteredPluginInfo > GetOperatingSystemPluginInfo()
static REPLCreateInstance GetREPLCreateCallbackAtIndex(uint32_t idx)
static ObjectFileCreateMemoryInstance GetObjectFileCreateMemoryCallbackAtIndex(uint32_t idx)
static llvm::ArrayRef< PluginNamespace > GetPluginNamespaces()
static bool SetTypeSystemPluginEnabled(llvm::StringRef name, bool enable)
static bool SetTracePluginEnabled(llvm::StringRef name, bool enable)
static Status SaveCore(lldb_private::SaveCoreOptions &core_options)
static std::vector< RegisteredPluginInfo > GetStructuredDataPluginInfo()
static std::vector< RegisteredPluginInfo > GetPlatformPluginInfo()
static std::vector< RegisteredPluginInfo > GetTypeSystemPluginInfo()
static std::vector< RegisteredPluginInfo > GetObjectContainerPluginInfo()
static std::vector< RegisteredPluginInfo > GetTracePluginInfo()
static FileSpec LocateExecutableSymbolFile(const ModuleSpec &module_spec, const FileSpecList &default_search_paths, StatisticsMap &map)
static bool SetEmulateInstructionPluginEnabled(llvm::StringRef name, bool enable)
static lldb::OptionValuePropertiesSP GetSettingForJITLoaderPlugin(Debugger &debugger, llvm::StringRef setting_name)
static DisassemblerCreateInstance GetDisassemblerCreateCallbackForPluginName(llvm::StringRef name)
static bool SetJITLoaderPluginEnabled(llvm::StringRef name, bool enable)
static MemoryHistoryCreateInstance GetMemoryHistoryCreateCallbackAtIndex(uint32_t idx)
static bool CreateSettingForSymbolFilePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static bool CreateSettingForPlatformPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static OperatingSystemCreateInstance GetOperatingSystemCreateCallbackForPluginName(llvm::StringRef name)
static DisassemblerCreateInstance GetDisassemblerCreateCallbackAtIndex(uint32_t idx)
static ObjectContainerCreateInstance GetObjectContainerCreateCallbackAtIndex(uint32_t idx)
static ObjectFileCreateInstance GetObjectFileCreateCallbackAtIndex(uint32_t idx)
static std::vector< RegisteredPluginInfo > GetScriptInterpreterPluginInfo()
static bool SetSymbolFilePluginEnabled(llvm::StringRef name, bool enable)
static EmulateInstructionCreateInstance GetEmulateInstructionCreateCallbackForPluginName(llvm::StringRef name)
static lldb::OptionValuePropertiesSP GetSettingForSymbolFilePlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool CreateSettingForStructuredDataPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static std::vector< RegisteredPluginInfo > GetProcessPluginInfo()
static bool CreateSettingForCPlusPlusLanguagePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static DynamicLoaderCreateInstance GetDynamicLoaderCreateCallbackAtIndex(uint32_t idx)
static std::vector< llvm::StringRef > GetSaveCorePluginNames()
static ObjectFileGetModuleSpecifications GetObjectContainerGetModuleSpecificationsCallbackAtIndex(uint32_t idx)
static DynamicLoaderCreateInstance GetDynamicLoaderCreateCallbackForPluginName(llvm::StringRef name)
static PlatformCreateInstance GetPlatformCreateCallbackForPluginName(llvm::StringRef name)
static ScriptInterpreterCreateInstance GetScriptInterpreterCreateCallbackAtIndex(uint32_t idx)
static bool SetProcessPluginEnabled(llvm::StringRef name, bool enable)
static LanguageCreateInstance GetLanguageCreateCallbackAtIndex(uint32_t idx)
static bool SetABIPluginEnabled(llvm::StringRef name, bool enable)
static std::vector< RegisteredPluginInfo > GetRegisterTypeBuilderPluginInfo()
static lldb::OptionValuePropertiesSP GetSettingForProcessPlugin(Debugger &debugger, llvm::StringRef setting_name)
static std::vector< RegisteredPluginInfo > GetScriptedInterfacePluginInfo()
static std::vector< RegisteredPluginInfo > GetUnwindAssemblyPluginInfo()
static ProcessCreateInstance GetProcessCreateCallbackForPluginName(llvm::StringRef name)
static void AutoCompletePluginName(llvm::StringRef partial_name, CompletionRequest &request)
static llvm::StringRef GetScriptedInterfaceDescriptionAtIndex(uint32_t idx)
static llvm::StringRef GetProcessPluginDescriptionAtIndex(uint32_t idx)
static llvm::StringRef GetProtocolServerPluginNameAtIndex(uint32_t idx)
static bool IsRegisteredObjectFilePluginName(llvm::StringRef name)
static lldb::OptionValuePropertiesSP GetSettingForDynamicLoaderPlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool CreateSettingForDynamicLoaderPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static bool SetLanguagePluginEnabled(llvm::StringRef name, bool enable)
static bool SetREPLPluginEnabled(llvm::StringRef name, bool enable)
static StructuredDataPluginCreateInstance GetStructuredDataPluginCreateCallbackAtIndex(uint32_t idx)
static ObjectFileGetModuleSpecifications GetObjectFileGetModuleSpecificationsCallbackAtIndex(uint32_t idx)
static std::vector< RegisteredPluginInfo > GetABIPluginInfo()
static std::vector< RegisteredPluginInfo > GetSymbolFilePluginInfo()
static llvm::StringRef GetPlatformPluginNameAtIndex(uint32_t idx)
static bool SetSymbolVendorPluginEnabled(llvm::StringRef name, bool enable)
static TraceCreateInstanceFromBundle GetTraceCreateCallback(llvm::StringRef plugin_name)
static std::vector< RegisteredPluginInfo > GetDynamicLoaderPluginInfo()
static void DebuggerInitialize(Debugger &debugger)
static llvm::StringRef GetScriptedInterfaceNameAtIndex(uint32_t idx)
static llvm::StringRef GetProcessPluginNameAtIndex(uint32_t idx)
static ModuleSpec LocateExecutableObjectFile(const ModuleSpec &module_spec, StatisticsMap &map)
static LanguageSet GetAllTypeSystemSupportedLanguagesForTypes()
static bool UnregisterPlugin(ABICreateInstance create_callback)
static FileSpec FindSymbolFileInBundle(const FileSpec &dsym_bundle_fspec, const UUID *uuid, const ArchSpec *arch)
static bool SetSymbolLocatorPluginEnabled(llvm::StringRef name, bool enable)
static ProtocolServerCreateInstance GetProtocolCreateCallbackForPluginName(llvm::StringRef name)
static std::vector< RegisteredPluginInfo > GetDisassemblerPluginInfo()
static std::vector< RegisteredPluginInfo > GetInstrumentationRuntimePluginInfo()
static ObjectContainerCreateMemoryInstance GetObjectContainerCreateMemoryCallbackAtIndex(uint32_t idx)
static StructuredDataFilterLaunchInfo GetStructuredDataFilterCallbackAtIndex(uint32_t idx, bool &iteration_complete)
static InstrumentationRuntimeCreateInstance GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx)
static std::vector< RegisteredPluginInfo > GetEmulateInstructionPluginInfo()
static LanguageSet GetREPLSupportedLanguagesAtIndex(uint32_t idx)
static lldb::RegisterTypeBuilderSP GetRegisterTypeBuilder(Target &target)
static ScriptedInterfaceUsages GetScriptedInterfaceUsagesAtIndex(uint32_t idx)
static ObjectFileCreateMemoryInstance GetObjectFileCreateMemoryCallbackForPluginName(llvm::StringRef name)
static bool CreateSettingForSymbolLocatorPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static EmulateInstructionCreateInstance GetEmulateInstructionCreateCallbackAtIndex(uint32_t idx)
static bool SetObjectFilePluginEnabled(llvm::StringRef name, bool enable)
A class to count time for plugins.
Definition Statistics.h:94
An error handling class.
Definition Status.h:118
Represents UUID's of various sizes.
Definition UUID.h:27
A class that represents a running process on the host machine.
SymbolVendor *(* SymbolVendorCreateInstance)(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm)
bool(* ObjectFileSaveCore)(const lldb::ProcessSP &process_sp, lldb_private::SaveCoreOptions &options, Status &error)
llvm::Expected< lldb::TraceSP >(* TraceCreateInstanceForLiveProcess)(Process &process)
std::function< std::vector< RegisteredPluginInfo >()> GetPluginInfo
lldb::RegisterTypeBuilderSP(* RegisterTypeBuilderCreateInstance)(Target &target)
lldb::ProtocolServerUP(* ProtocolServerCreateInstance)()
LanguageRuntime *(* LanguageRuntimeCreateInstance)(Process *process, lldb::LanguageType language)
lldb::InstrumentationRuntimeType(* InstrumentationRuntimeGetType)()
llvm::Expected< lldb::TraceSP >(* TraceCreateInstanceFromBundle)(const llvm::json::Value &trace_bundle_description, llvm::StringRef session_file_dir, lldb_private::Debugger &debugger)
Trace.
lldb::DisassemblerSP(* DisassemblerCreateInstance)(const ArchSpec &arch, const char *flavor, const char *cpu, const char *features)
std::optional< FileSpec >(* SymbolLocatorLocateExecutableSymbolFile)(const ModuleSpec &module_spec, const FileSpecList &default_search_paths)
EmulateInstruction *(* EmulateInstructionCreateInstance)(const ArchSpec &arch, InstructionType inst_type)
ObjectContainer *(* ObjectContainerCreateMemoryInstance)(const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t offset)
size_t(* ObjectFileGetModuleSpecifications)(const FileSpec &file, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, lldb::offset_t file_offset, lldb::offset_t length, ModuleSpecList &module_specs)
void(* DebuggerInitializeCallback)(Debugger &debugger)
std::unique_ptr< Architecture >(* ArchitectureCreateInstance)(const ArchSpec &arch)
lldb::ScriptInterpreterSP(* ScriptInterpreterCreateInstance)(Debugger &debugger)
lldb::PlatformSP(* PlatformCreateInstance)(bool force, const ArchSpec *arch)
bool(* ScriptedInterfaceCreateInstance)(lldb::ScriptLanguage language, ScriptedInterfaceUsages usages)
SystemRuntime *(* SystemRuntimeCreateInstance)(Process *process)
lldb::ProcessSP(* ProcessCreateInstance)(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec *crash_file_path, bool can_connect)
UnwindAssembly *(* UnwindAssemblyCreateInstance)(const ArchSpec &arch)
lldb::TypeSystemSP(* TypeSystemCreateInstance)(lldb::LanguageType language, Module *module, Target *target)
lldb::BreakpointPreconditionSP(* LanguageRuntimeGetExceptionPrecondition)(lldb::LanguageType language, bool throw_bp)
ObjectContainer *(* ObjectContainerCreateInstance)(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, const FileSpec *file, lldb::offset_t offset, lldb::offset_t length)
lldb::MemoryHistorySP(* MemoryHistoryCreateInstance)(const lldb::ProcessSP &process_sp)
ObjectFile *(* ObjectFileCreateMemoryInstance)(const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t offset)
SymbolLocator *(* SymbolLocatorCreateInstance)()
std::optional< ModuleSpec >(* SymbolLocatorLocateExecutableObjectFile)(const ModuleSpec &module_spec)
lldb::CommandObjectSP(* LanguageRuntimeGetCommandObject)(CommandInterpreter &interpreter)
ObjectFile *(* ObjectFileCreateInstance)(const lldb::ModuleSP &module_sp, lldb::DataBufferSP data_sp, lldb::offset_t data_offset, const FileSpec *file, lldb::offset_t file_offset, lldb::offset_t length)
DynamicLoader *(* DynamicLoaderCreateInstance)(Process *process, bool force)
lldb::StructuredDataPluginSP(* StructuredDataPluginCreateInstance)(Process &process)
lldb::JITLoaderSP(* JITLoaderCreateInstance)(Process *process, bool force)
OperatingSystem *(* OperatingSystemCreateInstance)(Process *process, bool force)
lldb::REPLSP(* REPLCreateInstance)(Status &error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options)
SymbolFile *(* SymbolFileCreateInstance)(lldb::ObjectFileSP objfile_sp)
llvm::Expected< lldb::TraceExporterUP >(* TraceExporterCreateInstance)()
std::optional< FileSpec >(* SymbolLocatorFindSymbolFileInBundle)(const FileSpec &dsym_bundle_fspec, const UUID *uuid, const ArchSpec *arch)
bool(* SymbolLocatorDownloadObjectAndSymbolFile)(ModuleSpec &module_spec, Status &error, bool force_lookup, bool copy_executable)
Language *(* LanguageCreateInstance)(lldb::LanguageType language)
Status(* StructuredDataFilterLaunchInfo)(ProcessLaunchInfo &launch_info, Target *target)
std::function< bool(llvm::StringRef, bool)> SetPluginEnabled
lldb::ABISP(* ABICreateInstance)(lldb::ProcessSP process_sp, const ArchSpec &arch)
lldb::CommandObjectSP(* ThreadTraceExportCommandCreator)(CommandInterpreter &interpreter)
lldb::InstrumentationRuntimeSP(* InstrumentationRuntimeCreateInstance)(const lldb::ProcessSP &process_sp)
ScriptLanguage
Script interpreter types.
std::shared_ptr< lldb_private::OptionValueProperties > OptionValuePropertiesSP
std::shared_ptr< lldb_private::ScriptInterpreter > ScriptInterpreterSP
std::shared_ptr< lldb_private::RegisterTypeBuilder > RegisterTypeBuilderSP
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
Definition Type.h:38