LLDB mainline
PluginManager.cpp
Go to the documentation of this file.
1//===-- PluginManager.cpp -------------------------------------------------===//
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
10
11#include "lldb/Core/Debugger.h"
13#include "lldb/Host/HostInfo.h"
16#include "lldb/Target/Process.h"
18#include "lldb/Utility/Status.h"
20#include "llvm/ADT/StringRef.h"
21#include "llvm/Support/DynamicLibrary.h"
22#include "llvm/Support/FileSystem.h"
23#include "llvm/Support/raw_ostream.h"
24#include <cassert>
25#include <map>
26#include <memory>
27#include <mutex>
28#include <string>
29#include <utility>
30#include <vector>
31#if defined(_WIN32)
33#endif
34
35using namespace lldb;
36using namespace lldb_private;
37
38typedef bool (*PluginInitCallback)();
39typedef void (*PluginTermCallback)();
40
41struct PluginInfo {
42 PluginInfo() = default;
43
44 llvm::sys::DynamicLibrary library;
47};
48
49typedef std::map<FileSpec, PluginInfo> PluginTerminateMap;
50
51static std::recursive_mutex &GetPluginMapMutex() {
52 static std::recursive_mutex g_plugin_map_mutex;
53 return g_plugin_map_mutex;
54}
55
57 static PluginTerminateMap g_plugin_map;
58 return g_plugin_map;
59}
60
61static bool PluginIsLoaded(const FileSpec &plugin_file_spec) {
62 std::lock_guard<std::recursive_mutex> guard(GetPluginMapMutex());
63 PluginTerminateMap &plugin_map = GetPluginMap();
64 return plugin_map.find(plugin_file_spec) != plugin_map.end();
65}
66
67static void SetPluginInfo(const FileSpec &plugin_file_spec,
68 const PluginInfo &plugin_info) {
69 std::lock_guard<std::recursive_mutex> guard(GetPluginMapMutex());
70 PluginTerminateMap &plugin_map = GetPluginMap();
71 assert(plugin_map.find(plugin_file_spec) == plugin_map.end());
72 plugin_map[plugin_file_spec] = plugin_info;
73}
74
75template <typename FPtrTy> static FPtrTy CastToFPtr(void *VPtr) {
76 return reinterpret_cast<FPtrTy>(VPtr);
77}
78
80LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,
81 llvm::StringRef path) {
83
84 namespace fs = llvm::sys::fs;
85 // If we have a regular file, a symbolic link or unknown file type, try and
86 // process the file. We must handle unknown as sometimes the directory
87 // enumeration might be enumerating a file system that doesn't have correct
88 // file type information.
89 if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||
90 ft == fs::file_type::type_unknown) {
91 FileSpec plugin_file_spec(path);
92 FileSystem::Instance().Resolve(plugin_file_spec);
93
94 if (PluginIsLoaded(plugin_file_spec))
96 else {
97 PluginInfo plugin_info;
98
99 std::string pluginLoadError;
100 plugin_info.library = llvm::sys::DynamicLibrary::getPermanentLibrary(
101 plugin_file_spec.GetPath().c_str(), &pluginLoadError);
102 if (plugin_info.library.isValid()) {
103 bool success = false;
104 plugin_info.plugin_init_callback = CastToFPtr<PluginInitCallback>(
105 plugin_info.library.getAddressOfSymbol("LLDBPluginInitialize"));
106 if (plugin_info.plugin_init_callback) {
107 // Call the plug-in "bool LLDBPluginInitialize(void)" function
108 success = plugin_info.plugin_init_callback();
109 }
110
111 if (success) {
112 // It is ok for the "LLDBPluginTerminate" symbol to be nullptr
113 plugin_info.plugin_term_callback = CastToFPtr<PluginTermCallback>(
114 plugin_info.library.getAddressOfSymbol("LLDBPluginTerminate"));
115 } else {
116 // The initialize function returned FALSE which means the plug-in
117 // might not be compatible, or might be too new or too old, or might
118 // not want to run on this machine. Set it to a default-constructed
119 // instance to invalidate it.
120 plugin_info = PluginInfo();
121 }
122
123 // Regardless of success or failure, cache the plug-in load in our
124 // plug-in info so we don't try to load it again and again.
125 SetPluginInfo(plugin_file_spec, plugin_info);
126
128 }
129 }
130 }
131
132 if (ft == fs::file_type::directory_file ||
133 ft == fs::file_type::symlink_file || ft == fs::file_type::type_unknown) {
134 // Try and recurse into anything that a directory or symbolic link. We must
135 // also do this for unknown as sometimes the directory enumeration might be
136 // enumerating a file system that doesn't have correct file type
137 // information.
139 }
140
142}
143
145 const bool find_directories = true;
146 const bool find_files = true;
147 const bool find_other = true;
148 char dir_path[PATH_MAX];
149 if (FileSpec dir_spec = HostInfo::GetSystemPluginDir()) {
150 if (FileSystem::Instance().Exists(dir_spec) &&
151 dir_spec.GetPath(dir_path, sizeof(dir_path))) {
152 FileSystem::Instance().EnumerateDirectory(dir_path, find_directories,
153 find_files, find_other,
154 LoadPluginCallback, nullptr);
155 }
156 }
157
158 if (FileSpec dir_spec = HostInfo::GetUserPluginDir()) {
159 if (FileSystem::Instance().Exists(dir_spec) &&
160 dir_spec.GetPath(dir_path, sizeof(dir_path))) {
161 FileSystem::Instance().EnumerateDirectory(dir_path, find_directories,
162 find_files, find_other,
163 LoadPluginCallback, nullptr);
164 }
165 }
166}
167
169 std::lock_guard<std::recursive_mutex> guard(GetPluginMapMutex());
170 PluginTerminateMap &plugin_map = GetPluginMap();
171
172 PluginTerminateMap::const_iterator pos, end = plugin_map.end();
173 for (pos = plugin_map.begin(); pos != end; ++pos) {
174 // Call the plug-in "void LLDBPluginTerminate (void)" function if there is
175 // one (if the symbol was not nullptr).
176 if (pos->second.library.isValid()) {
177 if (pos->second.plugin_term_callback)
178 pos->second.plugin_term_callback();
179 }
180 }
181 plugin_map.clear();
182}
183
184template <typename Callback> struct PluginInstance {
185 typedef Callback CallbackType;
186
187 PluginInstance() = default;
188 PluginInstance(llvm::StringRef name, llvm::StringRef description,
189 Callback create_callback,
190 DebuggerInitializeCallback debugger_init_callback = nullptr)
191 : name(name), description(description), create_callback(create_callback),
192 debugger_init_callback(debugger_init_callback) {}
193
194 llvm::StringRef name;
195 llvm::StringRef description;
198};
199
200template <typename Instance> class PluginInstances {
201public:
202 template <typename... Args>
203 bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
204 typename Instance::CallbackType callback,
205 Args &&...args) {
206 if (!callback)
207 return false;
208 assert(!name.empty());
209 Instance instance =
210 Instance(name, description, callback, std::forward<Args>(args)...);
211 m_instances.push_back(instance);
212 return false;
213 }
214
215 bool UnregisterPlugin(typename Instance::CallbackType callback) {
216 if (!callback)
217 return false;
218 auto pos = m_instances.begin();
219 auto end = m_instances.end();
220 for (; pos != end; ++pos) {
221 if (pos->create_callback == callback) {
222 m_instances.erase(pos);
223 return true;
224 }
225 }
226 return false;
227 }
228
229 typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
230 if (Instance *instance = GetInstanceAtIndex(idx))
231 return instance->create_callback;
232 return nullptr;
233 }
234
235 llvm::StringRef GetDescriptionAtIndex(uint32_t idx) {
236 if (Instance *instance = GetInstanceAtIndex(idx))
237 return instance->description;
238 return "";
239 }
240
241 llvm::StringRef GetNameAtIndex(uint32_t idx) {
242 if (Instance *instance = GetInstanceAtIndex(idx))
243 return instance->name;
244 return "";
245 }
246
247 typename Instance::CallbackType GetCallbackForName(llvm::StringRef name) {
248 if (name.empty())
249 return nullptr;
250 for (auto &instance : m_instances) {
251 if (name == instance.name)
252 return instance.create_callback;
253 }
254 return nullptr;
255 }
256
258 for (auto &instance : m_instances) {
259 if (instance.debugger_init_callback)
260 instance.debugger_init_callback(debugger);
261 }
262 }
263
264 const std::vector<Instance> &GetInstances() const { return m_instances; }
265 std::vector<Instance> &GetInstances() { return m_instances; }
266
267 Instance *GetInstanceAtIndex(uint32_t idx) {
268 if (idx < m_instances.size())
269 return &m_instances[idx];
270 return nullptr;
271 }
272
273private:
274 std::vector<Instance> m_instances;
275};
276
277#pragma mark ABI
278
281
283 static ABIInstances g_instances;
284 return g_instances;
285}
286
287bool PluginManager::RegisterPlugin(llvm::StringRef name,
288 llvm::StringRef description,
289 ABICreateInstance create_callback) {
290 return GetABIInstances().RegisterPlugin(name, description, create_callback);
291}
292
294 return GetABIInstances().UnregisterPlugin(create_callback);
295}
296
299}
300
301#pragma mark Architecture
302
304typedef std::vector<ArchitectureInstance> ArchitectureInstances;
305
307 static ArchitectureInstances g_instances;
308 return g_instances;
309}
310
311void PluginManager::RegisterPlugin(llvm::StringRef name,
312 llvm::StringRef description,
313 ArchitectureCreateInstance create_callback) {
314 GetArchitectureInstances().push_back({name, description, create_callback});
315}
316
318 ArchitectureCreateInstance create_callback) {
319 auto &instances = GetArchitectureInstances();
320
321 for (auto pos = instances.begin(), end = instances.end(); pos != end; ++pos) {
322 if (pos->create_callback == create_callback) {
323 instances.erase(pos);
324 return;
325 }
326 }
327 llvm_unreachable("Plugin not found");
328}
329
330std::unique_ptr<Architecture>
332 for (const auto &instances : GetArchitectureInstances()) {
333 if (auto plugin_up = instances.create_callback(arch))
334 return plugin_up;
335 }
336 return nullptr;
337}
338
339#pragma mark Disassembler
340
343
345 static DisassemblerInstances g_instances;
346 return g_instances;
347}
348
349bool PluginManager::RegisterPlugin(llvm::StringRef name,
350 llvm::StringRef description,
351 DisassemblerCreateInstance create_callback) {
352 return GetDisassemblerInstances().RegisterPlugin(name, description,
353 create_callback);
354}
355
357 DisassemblerCreateInstance create_callback) {
358 return GetDisassemblerInstances().UnregisterPlugin(create_callback);
359}
360
364}
365
368 llvm::StringRef name) {
370}
371
372#pragma mark DynamicLoader
373
376
378 static DynamicLoaderInstances g_instances;
379 return g_instances;
380}
381
383 llvm::StringRef name, llvm::StringRef description,
384 DynamicLoaderCreateInstance create_callback,
385 DebuggerInitializeCallback debugger_init_callback) {
387 name, description, create_callback, debugger_init_callback);
388}
389
391 DynamicLoaderCreateInstance create_callback) {
392 return GetDynamicLoaderInstances().UnregisterPlugin(create_callback);
393}
394
398}
399
402 llvm::StringRef name) {
404}
405
406#pragma mark JITLoader
407
410
412 static JITLoaderInstances g_instances;
413 return g_instances;
414}
415
417 llvm::StringRef name, llvm::StringRef description,
418 JITLoaderCreateInstance create_callback,
419 DebuggerInitializeCallback debugger_init_callback) {
421 name, description, create_callback, debugger_init_callback);
422}
423
425 return GetJITLoaderInstances().UnregisterPlugin(create_callback);
426}
427
431}
432
433#pragma mark EmulateInstruction
434
438
440 static EmulateInstructionInstances g_instances;
441 return g_instances;
442}
443
445 llvm::StringRef name, llvm::StringRef description,
446 EmulateInstructionCreateInstance create_callback) {
447 return GetEmulateInstructionInstances().RegisterPlugin(name, description,
448 create_callback);
449}
450
452 EmulateInstructionCreateInstance create_callback) {
453 return GetEmulateInstructionInstances().UnregisterPlugin(create_callback);
454}
455
459}
460
463 llvm::StringRef name) {
465}
466
467#pragma mark OperatingSystem
468
471
473 static OperatingSystemInstances g_instances;
474 return g_instances;
475}
476
478 llvm::StringRef name, llvm::StringRef description,
479 OperatingSystemCreateInstance create_callback,
480 DebuggerInitializeCallback debugger_init_callback) {
482 name, description, create_callback, debugger_init_callback);
483}
484
486 OperatingSystemCreateInstance create_callback) {
487 return GetOperatingSystemInstances().UnregisterPlugin(create_callback);
488}
489
493}
494
497 llvm::StringRef name) {
499}
500
501#pragma mark Language
502
505
507 static LanguageInstances g_instances;
508 return g_instances;
509}
510
511bool PluginManager::RegisterPlugin(llvm::StringRef name,
512 llvm::StringRef description,
513 LanguageCreateInstance create_callback) {
514 return GetLanguageInstances().RegisterPlugin(name, description,
515 create_callback);
516}
517
519 return GetLanguageInstances().UnregisterPlugin(create_callback);
520}
521
525}
526
527#pragma mark LanguageRuntime
528
530 : public PluginInstance<LanguageRuntimeCreateInstance> {
532 llvm::StringRef name, llvm::StringRef description,
533 CallbackType create_callback,
534 DebuggerInitializeCallback debugger_init_callback,
535 LanguageRuntimeGetCommandObject command_callback,
536 LanguageRuntimeGetExceptionPrecondition precondition_callback)
538 name, description, create_callback, debugger_init_callback),
539 command_callback(command_callback),
540 precondition_callback(precondition_callback) {}
541
544};
545
547
549 static LanguageRuntimeInstances g_instances;
550 return g_instances;
551}
552
554 llvm::StringRef name, llvm::StringRef description,
555 LanguageRuntimeCreateInstance create_callback,
556 LanguageRuntimeGetCommandObject command_callback,
557 LanguageRuntimeGetExceptionPrecondition precondition_callback) {
559 name, description, create_callback, nullptr, command_callback,
560 precondition_callback);
561}
562
564 LanguageRuntimeCreateInstance create_callback) {
565 return GetLanguageRuntimeInstances().UnregisterPlugin(create_callback);
566}
567
571}
572
575 const auto &instances = GetLanguageRuntimeInstances().GetInstances();
576 if (idx < instances.size())
577 return instances[idx].command_callback;
578 return nullptr;
579}
580
583 const auto &instances = GetLanguageRuntimeInstances().GetInstances();
584 if (idx < instances.size())
585 return instances[idx].precondition_callback;
586 return nullptr;
587}
588
589#pragma mark SystemRuntime
590
593
595 static SystemRuntimeInstances g_instances;
596 return g_instances;
597}
598
600 llvm::StringRef name, llvm::StringRef description,
601 SystemRuntimeCreateInstance create_callback) {
602 return GetSystemRuntimeInstances().RegisterPlugin(name, description,
603 create_callback);
604}
605
607 SystemRuntimeCreateInstance create_callback) {
608 return GetSystemRuntimeInstances().UnregisterPlugin(create_callback);
609}
610
614}
615
616#pragma mark ObjectFile
617
618struct ObjectFileInstance : public PluginInstance<ObjectFileCreateInstance> {
620 llvm::StringRef name, llvm::StringRef description,
621 CallbackType create_callback,
622 ObjectFileCreateMemoryInstance create_memory_callback,
623 ObjectFileGetModuleSpecifications get_module_specifications,
624 ObjectFileSaveCore save_core,
625 DebuggerInitializeCallback debugger_init_callback)
627 name, description, create_callback, debugger_init_callback),
628 create_memory_callback(create_memory_callback),
629 get_module_specifications(get_module_specifications),
630 save_core(save_core) {}
631
635};
637
639 static ObjectFileInstances g_instances;
640 return g_instances;
641}
642
644 if (name.empty())
645 return false;
646
647 const auto &instances = GetObjectFileInstances().GetInstances();
648 for (auto &instance : instances) {
649 if (instance.name == name)
650 return true;
651 }
652 return false;
653}
654
656 llvm::StringRef name, llvm::StringRef description,
657 ObjectFileCreateInstance create_callback,
658 ObjectFileCreateMemoryInstance create_memory_callback,
659 ObjectFileGetModuleSpecifications get_module_specifications,
660 ObjectFileSaveCore save_core,
661 DebuggerInitializeCallback debugger_init_callback) {
663 name, description, create_callback, create_memory_callback,
664 get_module_specifications, save_core, debugger_init_callback);
665}
666
668 return GetObjectFileInstances().UnregisterPlugin(create_callback);
669}
670
674}
675
678 const auto &instances = GetObjectFileInstances().GetInstances();
679 if (idx < instances.size())
680 return instances[idx].create_memory_callback;
681 return nullptr;
682}
683
686 uint32_t idx) {
687 const auto &instances = GetObjectFileInstances().GetInstances();
688 if (idx < instances.size())
689 return instances[idx].get_module_specifications;
690 return nullptr;
691}
692
695 llvm::StringRef name) {
696 const auto &instances = GetObjectFileInstances().GetInstances();
697 for (auto &instance : instances) {
698 if (instance.name == name)
699 return instance.create_memory_callback;
700 }
701 return nullptr;
702}
703
705 const lldb_private::SaveCoreOptions &options) {
707 if (!options.GetOutputFile()) {
708 error.SetErrorString("No output file specified");
709 return error;
710 }
711
712 if (!process_sp) {
713 error.SetErrorString("Invalid process");
714 return error;
715 }
716
717 if (!options.GetPluginName().has_value()) {
718 // Try saving core directly from the process plugin first.
719 llvm::Expected<bool> ret =
720 process_sp->SaveCore(options.GetOutputFile()->GetPath());
721 if (!ret)
722 return Status(ret.takeError());
723 if (ret.get())
724 return Status();
725 }
726
727 // Fall back to object plugins.
728 const auto &plugin_name = options.GetPluginName().value_or("");
729 auto &instances = GetObjectFileInstances().GetInstances();
730 for (auto &instance : instances) {
731 if (plugin_name.empty() || instance.name == plugin_name) {
732 if (instance.save_core && instance.save_core(process_sp, options, error))
733 return error;
734 }
735 }
736
737 // Check to see if any of the object file plugins tried and failed to save.
738 // If none ran, set the error message.
739 if (error.Success())
740 error.SetErrorString(
741 "no ObjectFile plugins were able to save a core for this process");
742 return error;
743}
744
745#pragma mark ObjectContainer
746
748 : public PluginInstance<ObjectContainerCreateInstance> {
750 llvm::StringRef name, llvm::StringRef description,
751 CallbackType create_callback,
752 ObjectContainerCreateMemoryInstance create_memory_callback,
753 ObjectFileGetModuleSpecifications get_module_specifications)
755 create_callback),
756 create_memory_callback(create_memory_callback),
757 get_module_specifications(get_module_specifications) {}
758
761};
763
765 static ObjectContainerInstances g_instances;
766 return g_instances;
767}
768
770 llvm::StringRef name, llvm::StringRef description,
771 ObjectContainerCreateInstance create_callback,
772 ObjectFileGetModuleSpecifications get_module_specifications,
773 ObjectContainerCreateMemoryInstance create_memory_callback) {
775 name, description, create_callback, create_memory_callback,
776 get_module_specifications);
777}
778
780 ObjectContainerCreateInstance create_callback) {
781 return GetObjectContainerInstances().UnregisterPlugin(create_callback);
782}
783
787}
788
791 const auto &instances = GetObjectContainerInstances().GetInstances();
792 if (idx < instances.size())
793 return instances[idx].create_memory_callback;
794 return nullptr;
795}
796
799 uint32_t idx) {
800 const auto &instances = GetObjectContainerInstances().GetInstances();
801 if (idx < instances.size())
802 return instances[idx].get_module_specifications;
803 return nullptr;
804}
805
806#pragma mark Platform
807
810
812 static PlatformInstances g_platform_instances;
813 return g_platform_instances;
814}
815
817 llvm::StringRef name, llvm::StringRef description,
818 PlatformCreateInstance create_callback,
819 DebuggerInitializeCallback debugger_init_callback) {
821 name, description, create_callback, debugger_init_callback);
822}
823
825 return GetPlatformInstances().UnregisterPlugin(create_callback);
826}
827
828llvm::StringRef PluginManager::GetPlatformPluginNameAtIndex(uint32_t idx) {
830}
831
832llvm::StringRef
835}
836
840}
841
845}
846
848 CompletionRequest &request) {
849 for (const auto &instance : GetPlatformInstances().GetInstances()) {
850 if (instance.name.starts_with(name))
851 request.AddCompletion(instance.name);
852 }
853}
854
855#pragma mark Process
856
859
861 static ProcessInstances g_instances;
862 return g_instances;
863}
864
866 llvm::StringRef name, llvm::StringRef description,
867 ProcessCreateInstance create_callback,
868 DebuggerInitializeCallback debugger_init_callback) {
870 name, description, create_callback, debugger_init_callback);
871}
872
874 return GetProcessInstances().UnregisterPlugin(create_callback);
875}
876
877llvm::StringRef PluginManager::GetProcessPluginNameAtIndex(uint32_t idx) {
879}
880
883}
884
888}
889
893}
894
896 CompletionRequest &request) {
897 for (const auto &instance : GetProcessInstances().GetInstances()) {
898 if (instance.name.starts_with(name))
899 request.AddCompletion(instance.name, instance.description);
900 }
901}
902
903#pragma mark RegisterTypeBuilder
904
906 : public PluginInstance<RegisterTypeBuilderCreateInstance> {
907 RegisterTypeBuilderInstance(llvm::StringRef name, llvm::StringRef description,
908 CallbackType create_callback)
910 create_callback) {}
911};
912
915
917 static RegisterTypeBuilderInstances g_instances;
918 return g_instances;
919}
920
922 llvm::StringRef name, llvm::StringRef description,
923 RegisterTypeBuilderCreateInstance create_callback) {
924 return GetRegisterTypeBuilderInstances().RegisterPlugin(name, description,
925 create_callback);
926}
927
929 RegisterTypeBuilderCreateInstance create_callback) {
930 return GetRegisterTypeBuilderInstances().UnregisterPlugin(create_callback);
931}
932
935 const auto &instances = GetRegisterTypeBuilderInstances().GetInstances();
936 // We assume that RegisterTypeBuilderClang is the only instance of this plugin
937 // type and is always present.
938 assert(instances.size());
939 return instances[0].create_callback(target);
940}
941
942#pragma mark ScriptInterpreter
943
945 : public PluginInstance<ScriptInterpreterCreateInstance> {
946 ScriptInterpreterInstance(llvm::StringRef name, llvm::StringRef description,
947 CallbackType create_callback,
948 lldb::ScriptLanguage language)
950 create_callback),
951 language(language) {}
952
954};
955
957
959 static ScriptInterpreterInstances g_instances;
960 return g_instances;
961}
962
964 llvm::StringRef name, llvm::StringRef description,
965 lldb::ScriptLanguage script_language,
966 ScriptInterpreterCreateInstance create_callback) {
968 name, description, create_callback, script_language);
969}
970
972 ScriptInterpreterCreateInstance create_callback) {
973 return GetScriptInterpreterInstances().UnregisterPlugin(create_callback);
974}
975
979}
980
983 Debugger &debugger) {
984 const auto &instances = GetScriptInterpreterInstances().GetInstances();
985 ScriptInterpreterCreateInstance none_instance = nullptr;
986 for (const auto &instance : instances) {
987 if (instance.language == lldb::eScriptLanguageNone)
988 none_instance = instance.create_callback;
989
990 if (script_lang == instance.language)
991 return instance.create_callback(debugger);
992 }
993
994 // If we didn't find one, return the ScriptInterpreter for the null language.
995 assert(none_instance != nullptr);
996 return none_instance(debugger);
997}
998
999#pragma mark StructuredDataPlugin
1000
1002 : public PluginInstance<StructuredDataPluginCreateInstance> {
1004 llvm::StringRef name, llvm::StringRef description,
1005 CallbackType create_callback,
1006 DebuggerInitializeCallback debugger_init_callback,
1007 StructuredDataFilterLaunchInfo filter_callback)
1009 name, description, create_callback, debugger_init_callback),
1010 filter_callback(filter_callback) {}
1011
1012 StructuredDataFilterLaunchInfo filter_callback = nullptr;
1013};
1014
1017
1019 static StructuredDataPluginInstances g_instances;
1020 return g_instances;
1021}
1022
1024 llvm::StringRef name, llvm::StringRef description,
1025 StructuredDataPluginCreateInstance create_callback,
1026 DebuggerInitializeCallback debugger_init_callback,
1027 StructuredDataFilterLaunchInfo filter_callback) {
1029 name, description, create_callback, debugger_init_callback,
1030 filter_callback);
1031}
1032
1034 StructuredDataPluginCreateInstance create_callback) {
1035 return GetStructuredDataPluginInstances().UnregisterPlugin(create_callback);
1036}
1037
1041}
1042
1045 uint32_t idx, bool &iteration_complete) {
1046 const auto &instances = GetStructuredDataPluginInstances().GetInstances();
1047 if (idx < instances.size()) {
1048 iteration_complete = false;
1049 return instances[idx].filter_callback;
1050 } else {
1051 iteration_complete = true;
1052 }
1053 return nullptr;
1054}
1055
1056#pragma mark SymbolFile
1057
1060
1062 static SymbolFileInstances g_instances;
1063 return g_instances;
1064}
1065
1067 llvm::StringRef name, llvm::StringRef description,
1068 SymbolFileCreateInstance create_callback,
1069 DebuggerInitializeCallback debugger_init_callback) {
1071 name, description, create_callback, debugger_init_callback);
1072}
1073
1075 return GetSymbolFileInstances().UnregisterPlugin(create_callback);
1076}
1077
1081}
1082
1083#pragma mark SymbolVendor
1084
1087
1089 static SymbolVendorInstances g_instances;
1090 return g_instances;
1091}
1092
1093bool PluginManager::RegisterPlugin(llvm::StringRef name,
1094 llvm::StringRef description,
1095 SymbolVendorCreateInstance create_callback) {
1096 return GetSymbolVendorInstances().RegisterPlugin(name, description,
1097 create_callback);
1098}
1099
1101 SymbolVendorCreateInstance create_callback) {
1102 return GetSymbolVendorInstances().UnregisterPlugin(create_callback);
1103}
1104
1108}
1109
1110#pragma mark SymbolLocator
1111
1113 : public PluginInstance<SymbolLocatorCreateInstance> {
1115 llvm::StringRef name, llvm::StringRef description,
1116 CallbackType create_callback,
1117 SymbolLocatorLocateExecutableObjectFile locate_executable_object_file,
1118 SymbolLocatorLocateExecutableSymbolFile locate_executable_symbol_file,
1119 SymbolLocatorDownloadObjectAndSymbolFile download_object_symbol_file,
1120 SymbolLocatorFindSymbolFileInBundle find_symbol_file_in_bundle,
1121 DebuggerInitializeCallback debugger_init_callback)
1123 name, description, create_callback, debugger_init_callback),
1124 locate_executable_object_file(locate_executable_object_file),
1125 locate_executable_symbol_file(locate_executable_symbol_file),
1126 download_object_symbol_file(download_object_symbol_file),
1127 find_symbol_file_in_bundle(find_symbol_file_in_bundle) {}
1128
1133};
1135
1137 static SymbolLocatorInstances g_instances;
1138 return g_instances;
1139}
1140
1142 llvm::StringRef name, llvm::StringRef description,
1143 SymbolLocatorCreateInstance create_callback,
1144 SymbolLocatorLocateExecutableObjectFile locate_executable_object_file,
1145 SymbolLocatorLocateExecutableSymbolFile locate_executable_symbol_file,
1146 SymbolLocatorDownloadObjectAndSymbolFile download_object_symbol_file,
1147 SymbolLocatorFindSymbolFileInBundle find_symbol_file_in_bundle,
1148 DebuggerInitializeCallback debugger_init_callback) {
1150 name, description, create_callback, locate_executable_object_file,
1151 locate_executable_symbol_file, download_object_symbol_file,
1152 find_symbol_file_in_bundle, debugger_init_callback);
1153}
1154
1156 SymbolLocatorCreateInstance create_callback) {
1157 return GetSymbolLocatorInstances().UnregisterPlugin(create_callback);
1158}
1159
1163}
1164
1167 auto &instances = GetSymbolLocatorInstances().GetInstances();
1168 for (auto &instance : instances) {
1169 if (instance.locate_executable_object_file) {
1170 std::optional<ModuleSpec> result =
1171 instance.locate_executable_object_file(module_spec);
1172 if (result)
1173 return *result;
1174 }
1175 }
1176 return {};
1177}
1178
1180 const ModuleSpec &module_spec, const FileSpecList &default_search_paths) {
1181 auto &instances = GetSymbolLocatorInstances().GetInstances();
1182 for (auto &instance : instances) {
1183 if (instance.locate_executable_symbol_file) {
1184 std::optional<FileSpec> result = instance.locate_executable_symbol_file(
1185 module_spec, default_search_paths);
1186 if (result)
1187 return *result;
1188 }
1189 }
1190 return {};
1191}
1192
1194 Status &error,
1195 bool force_lookup,
1196 bool copy_executable) {
1197 auto &instances = GetSymbolLocatorInstances().GetInstances();
1198 for (auto &instance : instances) {
1199 if (instance.download_object_symbol_file) {
1200 if (instance.download_object_symbol_file(module_spec, error, force_lookup,
1201 copy_executable))
1202 return true;
1203 }
1204 }
1205 return false;
1206}
1207
1209 const UUID *uuid,
1210 const ArchSpec *arch) {
1211 auto &instances = GetSymbolLocatorInstances().GetInstances();
1212 for (auto &instance : instances) {
1213 if (instance.find_symbol_file_in_bundle) {
1214 std::optional<FileSpec> result =
1215 instance.find_symbol_file_in_bundle(symfile_bundle, uuid, arch);
1216 if (result)
1217 return *result;
1218 }
1219 }
1220 return {};
1221}
1222
1223#pragma mark Trace
1224
1226 : public PluginInstance<TraceCreateInstanceFromBundle> {
1228 llvm::StringRef name, llvm::StringRef description,
1229 CallbackType create_callback_from_bundle,
1230 TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1231 llvm::StringRef schema, DebuggerInitializeCallback debugger_init_callback)
1233 name, description, create_callback_from_bundle,
1234 debugger_init_callback),
1235 schema(schema),
1236 create_callback_for_live_process(create_callback_for_live_process) {}
1237
1238 llvm::StringRef schema;
1240};
1241
1243
1245 static TraceInstances g_instances;
1246 return g_instances;
1247}
1248
1250 llvm::StringRef name, llvm::StringRef description,
1251 TraceCreateInstanceFromBundle create_callback_from_bundle,
1252 TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1253 llvm::StringRef schema, DebuggerInitializeCallback debugger_init_callback) {
1255 name, description, create_callback_from_bundle,
1256 create_callback_for_live_process, schema, debugger_init_callback);
1257}
1258
1260 TraceCreateInstanceFromBundle create_callback_from_bundle) {
1262 create_callback_from_bundle);
1263}
1264
1266PluginManager::GetTraceCreateCallback(llvm::StringRef plugin_name) {
1267 return GetTracePluginInstances().GetCallbackForName(plugin_name);
1268}
1269
1272 for (const TraceInstance &instance : GetTracePluginInstances().GetInstances())
1273 if (instance.name == plugin_name)
1274 return instance.create_callback_for_live_process;
1275 return nullptr;
1276}
1277
1278llvm::StringRef PluginManager::GetTraceSchema(llvm::StringRef plugin_name) {
1279 for (const TraceInstance &instance : GetTracePluginInstances().GetInstances())
1280 if (instance.name == plugin_name)
1281 return instance.schema;
1282 return llvm::StringRef();
1283}
1284
1285llvm::StringRef PluginManager::GetTraceSchema(size_t index) {
1286 if (TraceInstance *instance =
1287 GetTracePluginInstances().GetInstanceAtIndex(index))
1288 return instance->schema;
1289 return llvm::StringRef();
1290}
1291
1292#pragma mark TraceExporter
1293
1295 : public PluginInstance<TraceExporterCreateInstance> {
1297 llvm::StringRef name, llvm::StringRef description,
1298 TraceExporterCreateInstance create_instance,
1299 ThreadTraceExportCommandCreator create_thread_trace_export_command)
1300 : PluginInstance<TraceExporterCreateInstance>(name, description,
1301 create_instance),
1302 create_thread_trace_export_command(create_thread_trace_export_command) {
1303 }
1304
1306};
1307
1309
1311 static TraceExporterInstances g_instances;
1312 return g_instances;
1313}
1314
1316 llvm::StringRef name, llvm::StringRef description,
1317 TraceExporterCreateInstance create_callback,
1318 ThreadTraceExportCommandCreator create_thread_trace_export_command) {
1320 name, description, create_callback, create_thread_trace_export_command);
1321}
1322
1325 return GetTraceExporterInstances().GetCallbackForName(plugin_name);
1326}
1327
1329 TraceExporterCreateInstance create_callback) {
1330 return GetTraceExporterInstances().UnregisterPlugin(create_callback);
1331}
1332
1335 if (TraceExporterInstance *instance =
1336 GetTraceExporterInstances().GetInstanceAtIndex(index))
1337 return instance->create_thread_trace_export_command;
1338 return nullptr;
1339}
1340
1341llvm::StringRef
1344}
1345
1346#pragma mark UnwindAssembly
1347
1350
1352 static UnwindAssemblyInstances g_instances;
1353 return g_instances;
1354}
1355
1357 llvm::StringRef name, llvm::StringRef description,
1358 UnwindAssemblyCreateInstance create_callback) {
1359 return GetUnwindAssemblyInstances().RegisterPlugin(name, description,
1360 create_callback);
1361}
1362
1364 UnwindAssemblyCreateInstance create_callback) {
1365 return GetUnwindAssemblyInstances().UnregisterPlugin(create_callback);
1366}
1367
1371}
1372
1373#pragma mark MemoryHistory
1374
1377
1379 static MemoryHistoryInstances g_instances;
1380 return g_instances;
1381}
1382
1384 llvm::StringRef name, llvm::StringRef description,
1385 MemoryHistoryCreateInstance create_callback) {
1386 return GetMemoryHistoryInstances().RegisterPlugin(name, description,
1387 create_callback);
1388}
1389
1391 MemoryHistoryCreateInstance create_callback) {
1392 return GetMemoryHistoryInstances().UnregisterPlugin(create_callback);
1393}
1394
1398}
1399
1400#pragma mark InstrumentationRuntime
1401
1403 : public PluginInstance<InstrumentationRuntimeCreateInstance> {
1405 llvm::StringRef name, llvm::StringRef description,
1406 CallbackType create_callback,
1407 InstrumentationRuntimeGetType get_type_callback)
1409 create_callback),
1410 get_type_callback(get_type_callback) {}
1411
1412 InstrumentationRuntimeGetType get_type_callback = nullptr;
1413};
1414
1417
1419 static InstrumentationRuntimeInstances g_instances;
1420 return g_instances;
1421}
1422
1424 llvm::StringRef name, llvm::StringRef description,
1426 InstrumentationRuntimeGetType get_type_callback) {
1428 name, description, create_callback, get_type_callback);
1429}
1430
1432 InstrumentationRuntimeCreateInstance create_callback) {
1433 return GetInstrumentationRuntimeInstances().UnregisterPlugin(create_callback);
1434}
1435
1438 const auto &instances = GetInstrumentationRuntimeInstances().GetInstances();
1439 if (idx < instances.size())
1440 return instances[idx].get_type_callback;
1441 return nullptr;
1442}
1443
1447}
1448
1449#pragma mark TypeSystem
1450
1451struct TypeSystemInstance : public PluginInstance<TypeSystemCreateInstance> {
1452 TypeSystemInstance(llvm::StringRef name, llvm::StringRef description,
1453 CallbackType create_callback,
1454 LanguageSet supported_languages_for_types,
1455 LanguageSet supported_languages_for_expressions)
1456 : PluginInstance<TypeSystemCreateInstance>(name, description,
1457 create_callback),
1458 supported_languages_for_types(supported_languages_for_types),
1459 supported_languages_for_expressions(
1460 supported_languages_for_expressions) {}
1461
1464};
1465
1467
1469 static TypeSystemInstances g_instances;
1470 return g_instances;
1471}
1472
1474 llvm::StringRef name, llvm::StringRef description,
1475 TypeSystemCreateInstance create_callback,
1476 LanguageSet supported_languages_for_types,
1477 LanguageSet supported_languages_for_expressions) {
1479 name, description, create_callback, supported_languages_for_types,
1480 supported_languages_for_expressions);
1481}
1482
1484 return GetTypeSystemInstances().UnregisterPlugin(create_callback);
1485}
1486
1490}
1491
1493 const auto &instances = GetTypeSystemInstances().GetInstances();
1494 LanguageSet all;
1495 for (unsigned i = 0; i < instances.size(); ++i)
1496 all.bitvector |= instances[i].supported_languages_for_types.bitvector;
1497 return all;
1498}
1499
1501 const auto &instances = GetTypeSystemInstances().GetInstances();
1502 LanguageSet all;
1503 for (unsigned i = 0; i < instances.size(); ++i)
1504 all.bitvector |= instances[i].supported_languages_for_expressions.bitvector;
1505 return all;
1506}
1507
1508#pragma mark ScriptedInterfaces
1509
1511 : public PluginInstance<ScriptedInterfaceCreateInstance> {
1512 ScriptedInterfaceInstance(llvm::StringRef name, llvm::StringRef description,
1513 ScriptedInterfaceCreateInstance create_callback,
1514 lldb::ScriptLanguage language,
1517 create_callback),
1518 language(language), usages(usages) {}
1519
1522};
1523
1525
1527 static ScriptedInterfaceInstances g_instances;
1528 return g_instances;
1529}
1530
1532 llvm::StringRef name, llvm::StringRef description,
1533 ScriptedInterfaceCreateInstance create_callback,
1536 name, description, create_callback, language, usages);
1537}
1538
1540 ScriptedInterfaceCreateInstance create_callback) {
1541 return GetScriptedInterfaceInstances().UnregisterPlugin(create_callback);
1542}
1543
1546}
1547
1548llvm::StringRef PluginManager::GetScriptedInterfaceNameAtIndex(uint32_t index) {
1550}
1551
1552llvm::StringRef
1555}
1556
1559 const auto &instances = GetScriptedInterfaceInstances().GetInstances();
1560 return idx < instances.size() ? instances[idx].language
1561 : ScriptLanguage::eScriptLanguageNone;
1562}
1563
1566 const auto &instances = GetScriptedInterfaceInstances().GetInstances();
1567 if (idx >= instances.size())
1568 return {};
1569 return instances[idx].usages;
1570}
1571
1572#pragma mark REPL
1573
1574struct REPLInstance : public PluginInstance<REPLCreateInstance> {
1575 REPLInstance(llvm::StringRef name, llvm::StringRef description,
1576 CallbackType create_callback, LanguageSet supported_languages)
1577 : PluginInstance<REPLCreateInstance>(name, description, create_callback),
1578 supported_languages(supported_languages) {}
1579
1581};
1582
1584
1586 static REPLInstances g_instances;
1587 return g_instances;
1588}
1589
1590bool PluginManager::RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
1591 REPLCreateInstance create_callback,
1592 LanguageSet supported_languages) {
1593 return GetREPLInstances().RegisterPlugin(name, description, create_callback,
1594 supported_languages);
1595}
1596
1598 return GetREPLInstances().UnregisterPlugin(create_callback);
1599}
1600
1603}
1604
1606 const auto &instances = GetREPLInstances().GetInstances();
1607 return idx < instances.size() ? instances[idx].supported_languages
1608 : LanguageSet();
1609}
1610
1612 const auto &instances = GetREPLInstances().GetInstances();
1613 LanguageSet all;
1614 for (unsigned i = 0; i < instances.size(); ++i)
1615 all.bitvector |= instances[i].supported_languages.bitvector;
1616 return all;
1617}
1618
1619#pragma mark PluginManager
1620
1633}
1634
1635// This is the preferred new way to register plugin specific settings. e.g.
1636// This will put a plugin's settings under e.g.
1637// "plugin.<plugin_type_name>.<plugin_type_desc>.SETTINGNAME".
1639GetDebuggerPropertyForPlugins(Debugger &debugger, llvm::StringRef plugin_type_name,
1640 llvm::StringRef plugin_type_desc,
1641 bool can_create) {
1642 lldb::OptionValuePropertiesSP parent_properties_sp(
1643 debugger.GetValueProperties());
1644 if (parent_properties_sp) {
1645 static constexpr llvm::StringLiteral g_property_name("plugin");
1646
1647 OptionValuePropertiesSP plugin_properties_sp =
1648 parent_properties_sp->GetSubProperty(nullptr, g_property_name);
1649 if (!plugin_properties_sp && can_create) {
1650 plugin_properties_sp =
1651 std::make_shared<OptionValueProperties>(g_property_name);
1652 parent_properties_sp->AppendProperty(g_property_name,
1653 "Settings specify to plugins.", true,
1654 plugin_properties_sp);
1655 }
1656
1657 if (plugin_properties_sp) {
1658 lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1659 plugin_properties_sp->GetSubProperty(nullptr, plugin_type_name);
1660 if (!plugin_type_properties_sp && can_create) {
1661 plugin_type_properties_sp =
1662 std::make_shared<OptionValueProperties>(plugin_type_name);
1663 plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1664 true, plugin_type_properties_sp);
1665 }
1666 return plugin_type_properties_sp;
1667 }
1668 }
1670}
1671
1672// This is deprecated way to register plugin specific settings. e.g.
1673// "<plugin_type_name>.plugin.<plugin_type_desc>.SETTINGNAME" and Platform
1674// generic settings would be under "platform.SETTINGNAME".
1676 Debugger &debugger, llvm::StringRef plugin_type_name,
1677 llvm::StringRef plugin_type_desc, bool can_create) {
1678 static constexpr llvm::StringLiteral g_property_name("plugin");
1679 lldb::OptionValuePropertiesSP parent_properties_sp(
1680 debugger.GetValueProperties());
1681 if (parent_properties_sp) {
1682 OptionValuePropertiesSP plugin_properties_sp =
1683 parent_properties_sp->GetSubProperty(nullptr, plugin_type_name);
1684 if (!plugin_properties_sp && can_create) {
1685 plugin_properties_sp =
1686 std::make_shared<OptionValueProperties>(plugin_type_name);
1687 parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1688 true, plugin_properties_sp);
1689 }
1690
1691 if (plugin_properties_sp) {
1692 lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1693 plugin_properties_sp->GetSubProperty(nullptr, g_property_name);
1694 if (!plugin_type_properties_sp && can_create) {
1695 plugin_type_properties_sp =
1696 std::make_shared<OptionValueProperties>(g_property_name);
1697 plugin_properties_sp->AppendProperty(g_property_name,
1698 "Settings specific to plugins",
1699 true, plugin_type_properties_sp);
1700 }
1701 return plugin_type_properties_sp;
1702 }
1703 }
1705}
1706
1707namespace {
1708
1710GetDebuggerPropertyForPluginsPtr(Debugger &, llvm::StringRef, llvm::StringRef,
1711 bool can_create);
1712}
1713
1715GetSettingForPlugin(Debugger &debugger, llvm::StringRef setting_name,
1716 llvm::StringRef plugin_type_name,
1717 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1719 lldb::OptionValuePropertiesSP properties_sp;
1720 lldb::OptionValuePropertiesSP plugin_type_properties_sp(get_debugger_property(
1721 debugger, plugin_type_name,
1722 "", // not creating to so we don't need the description
1723 false));
1724 if (plugin_type_properties_sp)
1725 properties_sp =
1726 plugin_type_properties_sp->GetSubProperty(nullptr, setting_name);
1727 return properties_sp;
1728}
1729
1730static bool
1731CreateSettingForPlugin(Debugger &debugger, llvm::StringRef plugin_type_name,
1732 llvm::StringRef plugin_type_desc,
1733 const lldb::OptionValuePropertiesSP &properties_sp,
1734 llvm::StringRef description, bool is_global_property,
1735 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1737 if (properties_sp) {
1738 lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1739 get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
1740 true));
1741 if (plugin_type_properties_sp) {
1742 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1743 description, is_global_property,
1744 properties_sp);
1745 return true;
1746 }
1747 }
1748 return false;
1749}
1750
1751static constexpr llvm::StringLiteral kDynamicLoaderPluginName("dynamic-loader");
1752static constexpr llvm::StringLiteral kPlatformPluginName("platform");
1753static constexpr llvm::StringLiteral kProcessPluginName("process");
1754static constexpr llvm::StringLiteral kTracePluginName("trace");
1755static constexpr llvm::StringLiteral kObjectFilePluginName("object-file");
1756static constexpr llvm::StringLiteral kSymbolFilePluginName("symbol-file");
1757static constexpr llvm::StringLiteral kSymbolLocatorPluginName("symbol-locator");
1758static constexpr llvm::StringLiteral kJITLoaderPluginName("jit-loader");
1759static constexpr llvm::StringLiteral
1760 kStructuredDataPluginName("structured-data");
1761
1764 llvm::StringRef setting_name) {
1765 return GetSettingForPlugin(debugger, setting_name, kDynamicLoaderPluginName);
1766}
1767
1769 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1770 llvm::StringRef description, bool is_global_property) {
1772 "Settings for dynamic loader plug-ins",
1773 properties_sp, description, is_global_property);
1774}
1775
1778 llvm::StringRef setting_name) {
1779 return GetSettingForPlugin(debugger, setting_name, kPlatformPluginName,
1781}
1782
1784 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1785 llvm::StringRef description, bool is_global_property) {
1787 "Settings for platform plug-ins", properties_sp,
1788 description, is_global_property,
1790}
1791
1794 llvm::StringRef setting_name) {
1795 return GetSettingForPlugin(debugger, setting_name, kProcessPluginName);
1796}
1797
1799 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1800 llvm::StringRef description, bool is_global_property) {
1802 "Settings for process plug-ins", properties_sp,
1803 description, is_global_property);
1804}
1805
1808 llvm::StringRef setting_name) {
1809 return GetSettingForPlugin(debugger, setting_name, kSymbolLocatorPluginName);
1810}
1811
1813 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1814 llvm::StringRef description, bool is_global_property) {
1816 "Settings for symbol locator plug-ins",
1817 properties_sp, description, is_global_property);
1818}
1819
1821 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1822 llvm::StringRef description, bool is_global_property) {
1824 "Settings for trace plug-ins", properties_sp,
1825 description, is_global_property);
1826}
1827
1830 llvm::StringRef setting_name) {
1831 return GetSettingForPlugin(debugger, setting_name, kObjectFilePluginName);
1832}
1833
1835 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1836 llvm::StringRef description, bool is_global_property) {
1838 "Settings for object file plug-ins",
1839 properties_sp, description, is_global_property);
1840}
1841
1844 llvm::StringRef setting_name) {
1845 return GetSettingForPlugin(debugger, setting_name, kSymbolFilePluginName);
1846}
1847
1849 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1850 llvm::StringRef description, bool is_global_property) {
1852 "Settings for symbol file plug-ins",
1853 properties_sp, description, is_global_property);
1854}
1855
1858 llvm::StringRef setting_name) {
1859 return GetSettingForPlugin(debugger, setting_name, kJITLoaderPluginName);
1860}
1861
1863 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1864 llvm::StringRef description, bool is_global_property) {
1866 "Settings for JIT loader plug-ins",
1867 properties_sp, description, is_global_property);
1868}
1869
1870static const char *kOperatingSystemPluginName("os");
1871
1874 llvm::StringRef setting_name) {
1875 lldb::OptionValuePropertiesSP properties_sp;
1876 lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1879 "", // not creating to so we don't need the description
1880 false));
1881 if (plugin_type_properties_sp)
1882 properties_sp =
1883 plugin_type_properties_sp->GetSubProperty(nullptr, setting_name);
1884 return properties_sp;
1885}
1886
1888 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1889 llvm::StringRef description, bool is_global_property) {
1890 if (properties_sp) {
1891 lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1893 "Settings for operating system plug-ins",
1894 true));
1895 if (plugin_type_properties_sp) {
1896 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1897 description, is_global_property,
1898 properties_sp);
1899 return true;
1900 }
1901 }
1902 return false;
1903}
1904
1907 llvm::StringRef setting_name) {
1908 return GetSettingForPlugin(debugger, setting_name, kStructuredDataPluginName);
1909}
1910
1912 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1913 llvm::StringRef description, bool is_global_property) {
1915 "Settings for structured data plug-ins",
1916 properties_sp, description, is_global_property);
1917}
static llvm::raw_ostream & error(Stream &strm)
static FileSystem::EnumerateDirectoryResult LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft, llvm::StringRef path)
Definition: Debugger.cpp:664
static DisassemblerInstances & GetDisassemblerInstances()
static TraceInstances & GetTracePluginInstances()
static ObjectContainerInstances & GetObjectContainerInstances()
PluginInstances< JITLoaderInstance > JITLoaderInstances
static MemoryHistoryInstances & GetMemoryHistoryInstances()
PluginInstance< PlatformCreateInstance > PlatformInstance
PluginInstances< InstrumentationRuntimeInstance > InstrumentationRuntimeInstances
static DynamicLoaderInstances & GetDynamicLoaderInstances()
PluginInstances< SymbolFileInstance > SymbolFileInstances
std::map< FileSpec, PluginInfo > PluginTerminateMap
PluginInstances< TypeSystemInstance > TypeSystemInstances
PluginInstance< ABICreateInstance > ABIInstance
static SystemRuntimeInstances & GetSystemRuntimeInstances()
PluginInstances< TraceExporterInstance > TraceExporterInstances
static constexpr llvm::StringLiteral kPlatformPluginName("platform")
PluginInstance< EmulateInstructionCreateInstance > EmulateInstructionInstance
static ABIInstances & GetABIInstances()
static constexpr llvm::StringLiteral kProcessPluginName("process")
PluginInstances< SymbolVendorInstance > SymbolVendorInstances
static constexpr llvm::StringLiteral kDynamicLoaderPluginName("dynamic-loader")
static lldb::OptionValuePropertiesSP GetSettingForPlugin(Debugger &debugger, llvm::StringRef setting_name, llvm::StringRef plugin_type_name, GetDebuggerPropertyForPluginsPtr get_debugger_property=GetDebuggerPropertyForPlugins)
static ScriptInterpreterInstances & GetScriptInterpreterInstances()
PluginInstance< DynamicLoaderCreateInstance > DynamicLoaderInstance
PluginInstances< PlatformInstance > PlatformInstances
PluginInstance< JITLoaderCreateInstance > JITLoaderInstance
PluginInstance< ArchitectureCreateInstance > ArchitectureInstance
PluginInstances< SystemRuntimeInstance > SystemRuntimeInstances
static TraceExporterInstances & GetTraceExporterInstances()
static void SetPluginInfo(const FileSpec &plugin_file_spec, const PluginInfo &plugin_info)
static PluginTerminateMap & GetPluginMap()
PluginInstance< LanguageCreateInstance > LanguageInstance
PluginInstance< SymbolFileCreateInstance > SymbolFileInstance
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPlugins(Debugger &debugger, llvm::StringRef plugin_type_name, llvm::StringRef plugin_type_desc, bool can_create)
static constexpr llvm::StringLiteral kSymbolLocatorPluginName("symbol-locator")
PluginInstances< ObjectFileInstance > ObjectFileInstances
void(* PluginTermCallback)()
static StructuredDataPluginInstances & GetStructuredDataPluginInstances()
static constexpr llvm::StringLiteral kObjectFilePluginName("object-file")
PluginInstances< MemoryHistoryInstance > MemoryHistoryInstances
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPluginsOldStyle(Debugger &debugger, llvm::StringRef plugin_type_name, llvm::StringRef plugin_type_desc, bool can_create)
PluginInstances< DynamicLoaderInstance > DynamicLoaderInstances
PluginInstances< LanguageInstance > LanguageInstances
PluginInstances< TraceInstance > TraceInstances
PluginInstances< StructuredDataPluginInstance > StructuredDataPluginInstances
static constexpr llvm::StringLiteral kStructuredDataPluginName("structured-data")
PluginInstance< MemoryHistoryCreateInstance > MemoryHistoryInstance
static const char * kOperatingSystemPluginName("os")
static SymbolLocatorInstances & GetSymbolLocatorInstances()
PluginInstance< OperatingSystemCreateInstance > OperatingSystemInstance
static ObjectFileInstances & GetObjectFileInstances()
static constexpr llvm::StringLiteral kSymbolFilePluginName("symbol-file")
PluginInstances< SymbolLocatorInstance > SymbolLocatorInstances
PluginInstance< SystemRuntimeCreateInstance > SystemRuntimeInstance
PluginInstance< SymbolVendorCreateInstance > SymbolVendorInstance
static EmulateInstructionInstances & GetEmulateInstructionInstances()
PluginInstance< UnwindAssemblyCreateInstance > UnwindAssemblyInstance
static LanguageInstances & GetLanguageInstances()
static constexpr llvm::StringLiteral kJITLoaderPluginName("jit-loader")
PluginInstances< OperatingSystemInstance > OperatingSystemInstances
static LanguageRuntimeInstances & GetLanguageRuntimeInstances()
PluginInstances< LanguageRuntimeInstance > LanguageRuntimeInstances
static InstrumentationRuntimeInstances & GetInstrumentationRuntimeInstances()
PluginInstances< ProcessInstance > ProcessInstances
PluginInstances< REPLInstance > REPLInstances
std::vector< ArchitectureInstance > ArchitectureInstances
static ArchitectureInstances & GetArchitectureInstances()
static RegisterTypeBuilderInstances & GetRegisterTypeBuilderInstances()
static std::recursive_mutex & GetPluginMapMutex()
static TypeSystemInstances & GetTypeSystemInstances()
static PlatformInstances & GetPlatformInstances()
static ScriptedInterfaceInstances & GetScriptedInterfaceInstances()
static FileSystem::EnumerateDirectoryResult LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft, llvm::StringRef path)
PluginInstances< EmulateInstructionInstance > EmulateInstructionInstances
static JITLoaderInstances & GetJITLoaderInstances()
PluginInstances< DisassemblerInstance > DisassemblerInstances
PluginInstance< ProcessCreateInstance > ProcessInstance
static UnwindAssemblyInstances & GetUnwindAssemblyInstances()
PluginInstances< ScriptedInterfaceInstance > ScriptedInterfaceInstances
PluginInstances< UnwindAssemblyInstance > UnwindAssemblyInstances
static SymbolFileInstances & GetSymbolFileInstances()
static bool CreateSettingForPlugin(Debugger &debugger, llvm::StringRef plugin_type_name, llvm::StringRef plugin_type_desc, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property, GetDebuggerPropertyForPluginsPtr get_debugger_property=GetDebuggerPropertyForPlugins)
PluginInstances< ABIInstance > ABIInstances
static FPtrTy CastToFPtr(void *VPtr)
static ProcessInstances & GetProcessInstances()
static bool PluginIsLoaded(const FileSpec &plugin_file_spec)
static OperatingSystemInstances & GetOperatingSystemInstances()
static constexpr llvm::StringLiteral kTracePluginName("trace")
PluginInstances< ScriptInterpreterInstance > ScriptInterpreterInstances
bool(* PluginInitCallback)()
PluginInstance< DisassemblerCreateInstance > DisassemblerInstance
static SymbolVendorInstances & GetSymbolVendorInstances()
PluginInstances< ObjectContainerInstance > ObjectContainerInstances
PluginInstances< RegisterTypeBuilderInstance > RegisterTypeBuilderInstances
static REPLInstances & GetREPLInstances()
bool UnregisterPlugin(typename Instance::CallbackType callback)
llvm::StringRef GetNameAtIndex(uint32_t idx)
Instance::CallbackType GetCallbackAtIndex(uint32_t idx)
llvm::StringRef GetDescriptionAtIndex(uint32_t idx)
Instance * GetInstanceAtIndex(uint32_t idx)
Instance::CallbackType GetCallbackForName(llvm::StringRef name)
bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, typename Instance::CallbackType callback, Args &&...args)
std::vector< Instance > m_instances
const std::vector< Instance > & GetInstances() const
void PerformDebuggerCallback(Debugger &debugger)
std::vector< Instance > & GetInstances()
An architecture specification class.
Definition: ArchSpec.h:31
A command line argument class.
Definition: Args.h:33
"lldb/Utility/ArgCompletionRequest.h"
void AddCompletion(llvm::StringRef completion, llvm::StringRef description="", CompletionMode mode=CompletionMode::Normal)
Adds a possible completion string.
A class to manage flag bits.
Definition: Debugger.h:80
A file collection class.
Definition: FileSpecList.h:85
A file utility class.
Definition: FileSpec.h:56
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition: FileSpec.cpp:367
void Resolve(llvm::SmallVectorImpl< char > &path)
Resolve path to make it canonical.
void EnumerateDirectory(llvm::Twine path, bool find_directories, bool find_files, bool find_other, EnumerateDirectoryCallbackType callback, void *callback_baton)
@ eEnumerateDirectoryResultEnter
Recurse into the current entry if it is a directory or symlink, or next if not.
Definition: FileSystem.h:181
@ eEnumerateDirectoryResultNext
Enumerate next entry in the current directory.
Definition: FileSystem.h:178
static FileSystem & Instance()
static llvm::StringRef GetPlatformPluginDescriptionAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForStructuredDataPlugin(Debugger &debugger, llvm::StringRef setting_name)
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 JITLoaderCreateInstance GetJITLoaderCreateCallbackAtIndex(uint32_t idx)
static ABICreateInstance GetABICreateCallbackAtIndex(uint32_t idx)
static LanguageSet GetAllTypeSystemSupportedLanguagesForExpressions()
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 CreateSettingForObjectFilePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
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 PlatformCreateInstance GetPlatformCreateCallbackAtIndex(uint32_t idx)
static bool CreateSettingForTracePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
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 Status SaveCore(const lldb::ProcessSP &process_sp, const lldb_private::SaveCoreOptions &core_options)
static SymbolFileCreateInstance GetSymbolFileCreateCallbackAtIndex(uint32_t idx)
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 SymbolLocatorCreateInstance GetSymbolLocatorCreateCallbackAtIndex(uint32_t idx)
static TraceCreateInstanceForLiveProcess GetTraceCreateCallbackForLiveProcess(llvm::StringRef plugin_name)
static LanguageRuntimeCreateInstance GetLanguageRuntimeCreateCallbackAtIndex(uint32_t idx)
static std::unique_ptr< Architecture > CreateArchitectureInstance(const ArchSpec &arch)
static SystemRuntimeCreateInstance GetSystemRuntimeCreateCallbackAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForSymbolLocatorPlugin(Debugger &debugger, llvm::StringRef setting_name)
static uint32_t GetNumScriptedInterfaces()
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 lldb::OptionValuePropertiesSP GetSettingForPlatformPlugin(Debugger &debugger, llvm::StringRef setting_name)
static LanguageRuntimeGetExceptionPrecondition GetLanguageRuntimeGetExceptionPreconditionAtIndex(uint32_t idx)
static ModuleSpec LocateExecutableObjectFile(const ModuleSpec &module_spec)
static REPLCreateInstance GetREPLCreateCallbackAtIndex(uint32_t idx)
static ObjectFileCreateMemoryInstance GetObjectFileCreateMemoryCallbackAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForJITLoaderPlugin(Debugger &debugger, llvm::StringRef setting_name)
static DisassemblerCreateInstance GetDisassemblerCreateCallbackForPluginName(llvm::StringRef name)
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 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 DynamicLoaderCreateInstance GetDynamicLoaderCreateCallbackAtIndex(uint32_t idx)
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 LanguageCreateInstance GetLanguageCreateCallbackAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForProcessPlugin(Debugger &debugger, llvm::StringRef setting_name)
static ProcessCreateInstance GetProcessCreateCallbackForPluginName(llvm::StringRef name)
static llvm::StringRef GetScriptedInterfaceDescriptionAtIndex(uint32_t idx)
static llvm::StringRef GetProcessPluginDescriptionAtIndex(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 StructuredDataPluginCreateInstance GetStructuredDataPluginCreateCallbackAtIndex(uint32_t idx)
static FileSpec LocateExecutableSymbolFile(const ModuleSpec &module_spec, const FileSpecList &default_search_paths)
static ObjectFileGetModuleSpecifications GetObjectFileGetModuleSpecificationsCallbackAtIndex(uint32_t idx)
static llvm::StringRef GetPlatformPluginNameAtIndex(uint32_t idx)
static TraceCreateInstanceFromBundle GetTraceCreateCallback(llvm::StringRef plugin_name)
static void DebuggerInitialize(Debugger &debugger)
static llvm::StringRef GetScriptedInterfaceNameAtIndex(uint32_t idx)
static llvm::StringRef GetProcessPluginNameAtIndex(uint32_t idx)
static LanguageSet GetAllTypeSystemSupportedLanguagesForTypes()
static bool UnregisterPlugin(ABICreateInstance create_callback)
static FileSpec FindSymbolFileInBundle(const FileSpec &dsym_bundle_fspec, const UUID *uuid, const ArchSpec *arch)
static ObjectContainerCreateMemoryInstance GetObjectContainerCreateMemoryCallbackAtIndex(uint32_t idx)
static StructuredDataFilterLaunchInfo GetStructuredDataFilterCallbackAtIndex(uint32_t idx, bool &iteration_complete)
static InstrumentationRuntimeCreateInstance GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx)
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)
virtual lldb::OptionValuePropertiesSP GetValueProperties() const
const std::optional< lldb_private::FileSpec > GetOutputFile() const
std::optional< std::string > GetPluginName() const
An error handling class.
Definition: Status.h:44
A class that represents a running process on the host machine.
bool(* ObjectFileSaveCore)(const lldb::ProcessSP &process_sp, const lldb_private::SaveCoreOptions &options, Status &error)
SymbolVendor *(* SymbolVendorCreateInstance)(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm)
llvm::Expected< lldb::TraceSP >(* TraceCreateInstanceForLiveProcess)(Process &process)
lldb::InstrumentationRuntimeType(* InstrumentationRuntimeGetType)()
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::PlatformSP(* PlatformCreateInstance)(bool force, const ArchSpec *arch)
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::BreakpointPreconditionSP(* LanguageRuntimeGetExceptionPrecondition)(lldb::LanguageType language, bool throw_bp)
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)
std::optional< ModuleSpec >(* SymbolLocatorLocateExecutableObjectFile)(const ModuleSpec &module_spec)
lldb::CommandObjectSP(* LanguageRuntimeGetCommandObject)(CommandInterpreter &interpreter)
DynamicLoader *(* DynamicLoaderCreateInstance)(Process *process, bool force)
lldb::JITLoaderSP(* JITLoaderCreateInstance)(Process *process, bool force)
OperatingSystem *(* OperatingSystemCreateInstance)(Process *process, bool force)
SymbolFile *(* SymbolFileCreateInstance)(lldb::ObjectFileSP objfile_sp)
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)
lldb::ABISP(* ABICreateInstance)(lldb::ProcessSP process_sp, const ArchSpec &arch)
lldb::DisassemblerSP(* DisassemblerCreateInstance)(const ArchSpec &arch, const char *flavor)
lldb::CommandObjectSP(* ThreadTraceExportCommandCreator)(CommandInterpreter &interpreter)
Definition: SBAddress.h:15
ScriptLanguage
Script interpreter types.
@ eScriptLanguageNone
std::shared_ptr< lldb_private::OptionValueProperties > OptionValuePropertiesSP
Definition: lldb-forward.h:384
std::shared_ptr< lldb_private::ScriptInterpreter > ScriptInterpreterSP
Definition: lldb-forward.h:403
std::shared_ptr< lldb_private::RegisterTypeBuilder > RegisterTypeBuilderSP
Definition: lldb-forward.h:393
std::shared_ptr< lldb_private::Process > ProcessSP
Definition: lldb-forward.h:386
InstrumentationRuntimeInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, InstrumentationRuntimeGetType get_type_callback)
LanguageRuntimeGetExceptionPrecondition precondition_callback
LanguageRuntimeInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, DebuggerInitializeCallback debugger_init_callback, LanguageRuntimeGetCommandObject command_callback, LanguageRuntimeGetExceptionPrecondition precondition_callback)
LanguageRuntimeGetCommandObject command_callback
ObjectFileGetModuleSpecifications get_module_specifications
ObjectContainerInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, ObjectContainerCreateMemoryInstance create_memory_callback, ObjectFileGetModuleSpecifications get_module_specifications)
ObjectContainerCreateMemoryInstance create_memory_callback
ObjectFileCreateMemoryInstance create_memory_callback
ObjectFileGetModuleSpecifications get_module_specifications
ObjectFileInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, ObjectFileCreateMemoryInstance create_memory_callback, ObjectFileGetModuleSpecifications get_module_specifications, ObjectFileSaveCore save_core, DebuggerInitializeCallback debugger_init_callback)
ObjectFileSaveCore save_core
PluginTermCallback plugin_term_callback
PluginInfo()=default
llvm::sys::DynamicLibrary library
PluginInitCallback plugin_init_callback
llvm::StringRef name
llvm::StringRef description
Callback CallbackType
DebuggerInitializeCallback debugger_init_callback
Callback create_callback
PluginInstance()=default
PluginInstance(llvm::StringRef name, llvm::StringRef description, Callback create_callback, DebuggerInitializeCallback debugger_init_callback=nullptr)
LanguageSet supported_languages
REPLInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, LanguageSet supported_languages)
RegisterTypeBuilderInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback)
ScriptInterpreterInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, lldb::ScriptLanguage language)
ScriptedInterfaceUsages usages
lldb::ScriptLanguage language
ScriptedInterfaceInstance(llvm::StringRef name, llvm::StringRef description, ScriptedInterfaceCreateInstance create_callback, lldb::ScriptLanguage language, ScriptedInterfaceUsages usages)
StructuredDataPluginInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, DebuggerInitializeCallback debugger_init_callback, StructuredDataFilterLaunchInfo filter_callback)
SymbolLocatorFindSymbolFileInBundle find_symbol_file_in_bundle
SymbolLocatorInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, SymbolLocatorLocateExecutableObjectFile locate_executable_object_file, SymbolLocatorLocateExecutableSymbolFile locate_executable_symbol_file, SymbolLocatorDownloadObjectAndSymbolFile download_object_symbol_file, SymbolLocatorFindSymbolFileInBundle find_symbol_file_in_bundle, DebuggerInitializeCallback debugger_init_callback)
SymbolLocatorLocateExecutableSymbolFile locate_executable_symbol_file
SymbolLocatorDownloadObjectAndSymbolFile download_object_symbol_file
SymbolLocatorLocateExecutableObjectFile locate_executable_object_file
ThreadTraceExportCommandCreator create_thread_trace_export_command
TraceExporterInstance(llvm::StringRef name, llvm::StringRef description, TraceExporterCreateInstance create_instance, ThreadTraceExportCommandCreator create_thread_trace_export_command)
llvm::StringRef schema
TraceInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback_from_bundle, TraceCreateInstanceForLiveProcess create_callback_for_live_process, llvm::StringRef schema, DebuggerInitializeCallback debugger_init_callback)
TraceCreateInstanceForLiveProcess create_callback_for_live_process
LanguageSet supported_languages_for_expressions
LanguageSet supported_languages_for_types
TypeSystemInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, LanguageSet supported_languages_for_types, LanguageSet supported_languages_for_expressions)
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
Definition: Type.h:38
llvm::SmallBitVector bitvector
Definition: Type.h:39
#define PATH_MAX