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 m_instances.emplace_back(name, description, callback,
210 std::forward<Args>(args)...);
211 return true;
212 }
213
214 bool UnregisterPlugin(typename Instance::CallbackType callback) {
215 if (!callback)
216 return false;
217 auto pos = m_instances.begin();
218 auto end = m_instances.end();
219 for (; pos != end; ++pos) {
220 if (pos->create_callback == callback) {
221 m_instances.erase(pos);
222 return true;
223 }
224 }
225 return false;
226 }
227
228 typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
229 if (Instance *instance = GetInstanceAtIndex(idx))
230 return instance->create_callback;
231 return nullptr;
232 }
233
234 llvm::StringRef GetDescriptionAtIndex(uint32_t idx) {
235 if (Instance *instance = GetInstanceAtIndex(idx))
236 return instance->description;
237 return "";
238 }
239
240 llvm::StringRef GetNameAtIndex(uint32_t idx) {
241 if (Instance *instance = GetInstanceAtIndex(idx))
242 return instance->name;
243 return "";
244 }
245
246 typename Instance::CallbackType GetCallbackForName(llvm::StringRef name) {
247 if (name.empty())
248 return nullptr;
249 for (auto &instance : m_instances) {
250 if (name == instance.name)
251 return instance.create_callback;
252 }
253 return nullptr;
254 }
255
257 for (auto &instance : m_instances) {
258 if (instance.debugger_init_callback)
259 instance.debugger_init_callback(debugger);
260 }
261 }
262
263 const std::vector<Instance> &GetInstances() const { return m_instances; }
264 std::vector<Instance> &GetInstances() { return m_instances; }
265
266 Instance *GetInstanceAtIndex(uint32_t idx) {
267 if (idx < m_instances.size())
268 return &m_instances[idx];
269 return nullptr;
270 }
271
272private:
273 std::vector<Instance> m_instances;
274};
275
276#pragma mark ABI
277
280
282 static ABIInstances g_instances;
283 return g_instances;
284}
285
286bool PluginManager::RegisterPlugin(llvm::StringRef name,
287 llvm::StringRef description,
288 ABICreateInstance create_callback) {
289 return GetABIInstances().RegisterPlugin(name, description, create_callback);
290}
291
293 return GetABIInstances().UnregisterPlugin(create_callback);
294}
295
298}
299
300#pragma mark Architecture
301
303typedef std::vector<ArchitectureInstance> ArchitectureInstances;
304
306 static ArchitectureInstances g_instances;
307 return g_instances;
308}
309
310void PluginManager::RegisterPlugin(llvm::StringRef name,
311 llvm::StringRef description,
312 ArchitectureCreateInstance create_callback) {
313 GetArchitectureInstances().push_back({name, description, create_callback});
314}
315
317 ArchitectureCreateInstance create_callback) {
318 auto &instances = GetArchitectureInstances();
319
320 for (auto pos = instances.begin(), end = instances.end(); pos != end; ++pos) {
321 if (pos->create_callback == create_callback) {
322 instances.erase(pos);
323 return;
324 }
325 }
326 llvm_unreachable("Plugin not found");
327}
328
329std::unique_ptr<Architecture>
331 for (const auto &instances : GetArchitectureInstances()) {
332 if (auto plugin_up = instances.create_callback(arch))
333 return plugin_up;
334 }
335 return nullptr;
336}
337
338#pragma mark Disassembler
339
342
344 static DisassemblerInstances g_instances;
345 return g_instances;
346}
347
348bool PluginManager::RegisterPlugin(llvm::StringRef name,
349 llvm::StringRef description,
350 DisassemblerCreateInstance create_callback) {
351 return GetDisassemblerInstances().RegisterPlugin(name, description,
352 create_callback);
353}
354
356 DisassemblerCreateInstance create_callback) {
357 return GetDisassemblerInstances().UnregisterPlugin(create_callback);
358}
359
363}
364
367 llvm::StringRef name) {
369}
370
371#pragma mark DynamicLoader
372
375
377 static DynamicLoaderInstances g_instances;
378 return g_instances;
379}
380
382 llvm::StringRef name, llvm::StringRef description,
383 DynamicLoaderCreateInstance create_callback,
384 DebuggerInitializeCallback debugger_init_callback) {
386 name, description, create_callback, debugger_init_callback);
387}
388
390 DynamicLoaderCreateInstance create_callback) {
391 return GetDynamicLoaderInstances().UnregisterPlugin(create_callback);
392}
393
397}
398
401 llvm::StringRef name) {
403}
404
405#pragma mark JITLoader
406
409
411 static JITLoaderInstances g_instances;
412 return g_instances;
413}
414
416 llvm::StringRef name, llvm::StringRef description,
417 JITLoaderCreateInstance create_callback,
418 DebuggerInitializeCallback debugger_init_callback) {
420 name, description, create_callback, debugger_init_callback);
421}
422
424 return GetJITLoaderInstances().UnregisterPlugin(create_callback);
425}
426
430}
431
432#pragma mark EmulateInstruction
433
437
439 static EmulateInstructionInstances g_instances;
440 return g_instances;
441}
442
444 llvm::StringRef name, llvm::StringRef description,
445 EmulateInstructionCreateInstance create_callback) {
446 return GetEmulateInstructionInstances().RegisterPlugin(name, description,
447 create_callback);
448}
449
451 EmulateInstructionCreateInstance create_callback) {
452 return GetEmulateInstructionInstances().UnregisterPlugin(create_callback);
453}
454
458}
459
462 llvm::StringRef name) {
464}
465
466#pragma mark OperatingSystem
467
470
472 static OperatingSystemInstances g_instances;
473 return g_instances;
474}
475
477 llvm::StringRef name, llvm::StringRef description,
478 OperatingSystemCreateInstance create_callback,
479 DebuggerInitializeCallback debugger_init_callback) {
481 name, description, create_callback, debugger_init_callback);
482}
483
485 OperatingSystemCreateInstance create_callback) {
486 return GetOperatingSystemInstances().UnregisterPlugin(create_callback);
487}
488
492}
493
496 llvm::StringRef name) {
498}
499
500#pragma mark Language
501
504
506 static LanguageInstances g_instances;
507 return g_instances;
508}
509
510bool PluginManager::RegisterPlugin(llvm::StringRef name,
511 llvm::StringRef description,
512 LanguageCreateInstance create_callback) {
513 return GetLanguageInstances().RegisterPlugin(name, description,
514 create_callback);
515}
516
518 return GetLanguageInstances().UnregisterPlugin(create_callback);
519}
520
524}
525
526#pragma mark LanguageRuntime
527
529 : public PluginInstance<LanguageRuntimeCreateInstance> {
531 llvm::StringRef name, llvm::StringRef description,
532 CallbackType create_callback,
533 DebuggerInitializeCallback debugger_init_callback,
534 LanguageRuntimeGetCommandObject command_callback,
535 LanguageRuntimeGetExceptionPrecondition precondition_callback)
537 name, description, create_callback, debugger_init_callback),
538 command_callback(command_callback),
539 precondition_callback(precondition_callback) {}
540
543};
544
546
548 static LanguageRuntimeInstances g_instances;
549 return g_instances;
550}
551
553 llvm::StringRef name, llvm::StringRef description,
554 LanguageRuntimeCreateInstance create_callback,
555 LanguageRuntimeGetCommandObject command_callback,
556 LanguageRuntimeGetExceptionPrecondition precondition_callback) {
558 name, description, create_callback, nullptr, command_callback,
559 precondition_callback);
560}
561
563 LanguageRuntimeCreateInstance create_callback) {
564 return GetLanguageRuntimeInstances().UnregisterPlugin(create_callback);
565}
566
570}
571
574 const auto &instances = GetLanguageRuntimeInstances().GetInstances();
575 if (idx < instances.size())
576 return instances[idx].command_callback;
577 return nullptr;
578}
579
582 const auto &instances = GetLanguageRuntimeInstances().GetInstances();
583 if (idx < instances.size())
584 return instances[idx].precondition_callback;
585 return nullptr;
586}
587
588#pragma mark SystemRuntime
589
592
594 static SystemRuntimeInstances g_instances;
595 return g_instances;
596}
597
599 llvm::StringRef name, llvm::StringRef description,
600 SystemRuntimeCreateInstance create_callback) {
601 return GetSystemRuntimeInstances().RegisterPlugin(name, description,
602 create_callback);
603}
604
606 SystemRuntimeCreateInstance create_callback) {
607 return GetSystemRuntimeInstances().UnregisterPlugin(create_callback);
608}
609
613}
614
615#pragma mark ObjectFile
616
617struct ObjectFileInstance : public PluginInstance<ObjectFileCreateInstance> {
619 llvm::StringRef name, llvm::StringRef description,
620 CallbackType create_callback,
621 ObjectFileCreateMemoryInstance create_memory_callback,
622 ObjectFileGetModuleSpecifications get_module_specifications,
623 ObjectFileSaveCore save_core,
624 DebuggerInitializeCallback debugger_init_callback)
626 name, description, create_callback, debugger_init_callback),
627 create_memory_callback(create_memory_callback),
628 get_module_specifications(get_module_specifications),
629 save_core(save_core) {}
630
634};
636
638 static ObjectFileInstances g_instances;
639 return g_instances;
640}
641
643 if (name.empty())
644 return false;
645
646 const auto &instances = GetObjectFileInstances().GetInstances();
647 for (auto &instance : instances) {
648 if (instance.name == name)
649 return true;
650 }
651 return false;
652}
653
655 llvm::StringRef name, llvm::StringRef description,
656 ObjectFileCreateInstance create_callback,
657 ObjectFileCreateMemoryInstance create_memory_callback,
658 ObjectFileGetModuleSpecifications get_module_specifications,
659 ObjectFileSaveCore save_core,
660 DebuggerInitializeCallback debugger_init_callback) {
662 name, description, create_callback, create_memory_callback,
663 get_module_specifications, save_core, debugger_init_callback);
664}
665
667 return GetObjectFileInstances().UnregisterPlugin(create_callback);
668}
669
673}
674
677 const auto &instances = GetObjectFileInstances().GetInstances();
678 if (idx < instances.size())
679 return instances[idx].create_memory_callback;
680 return nullptr;
681}
682
685 uint32_t idx) {
686 const auto &instances = GetObjectFileInstances().GetInstances();
687 if (idx < instances.size())
688 return instances[idx].get_module_specifications;
689 return nullptr;
690}
691
694 llvm::StringRef name) {
695 const auto &instances = GetObjectFileInstances().GetInstances();
696 for (auto &instance : instances) {
697 if (instance.name == name)
698 return instance.create_memory_callback;
699 }
700 return nullptr;
701}
702
706 if (!options.GetOutputFile()) {
707 error = Status::FromErrorString("No output file specified");
708 return error;
709 }
710
711 if (!process_sp) {
712 error = Status::FromErrorString("Invalid process");
713 return error;
714 }
715
716 error = options.EnsureValidConfiguration(process_sp);
717 if (error.Fail())
718 return error;
719
720 if (!options.GetPluginName().has_value()) {
721 // Try saving core directly from the process plugin first.
722 llvm::Expected<bool> ret =
723 process_sp->SaveCore(options.GetOutputFile()->GetPath());
724 if (!ret)
725 return Status::FromError(ret.takeError());
726 if (ret.get())
727 return Status();
728 }
729
730 // Fall back to object plugins.
731 const auto &plugin_name = options.GetPluginName().value_or("");
732 auto &instances = GetObjectFileInstances().GetInstances();
733 for (auto &instance : instances) {
734 if (plugin_name.empty() || instance.name == plugin_name) {
735 if (instance.save_core && instance.save_core(process_sp, options, error))
736 return error;
737 }
738 }
739
740 // Check to see if any of the object file plugins tried and failed to save.
741 // If none ran, set the error message.
742 if (error.Success())
744 "no ObjectFile plugins were able to save a core for this process");
745 return error;
746}
747
748#pragma mark ObjectContainer
749
751 : public PluginInstance<ObjectContainerCreateInstance> {
753 llvm::StringRef name, llvm::StringRef description,
754 CallbackType create_callback,
755 ObjectContainerCreateMemoryInstance create_memory_callback,
756 ObjectFileGetModuleSpecifications get_module_specifications)
758 create_callback),
759 create_memory_callback(create_memory_callback),
760 get_module_specifications(get_module_specifications) {}
761
764};
766
768 static ObjectContainerInstances g_instances;
769 return g_instances;
770}
771
773 llvm::StringRef name, llvm::StringRef description,
774 ObjectContainerCreateInstance create_callback,
775 ObjectFileGetModuleSpecifications get_module_specifications,
776 ObjectContainerCreateMemoryInstance create_memory_callback) {
778 name, description, create_callback, create_memory_callback,
779 get_module_specifications);
780}
781
783 ObjectContainerCreateInstance create_callback) {
784 return GetObjectContainerInstances().UnregisterPlugin(create_callback);
785}
786
790}
791
794 const auto &instances = GetObjectContainerInstances().GetInstances();
795 if (idx < instances.size())
796 return instances[idx].create_memory_callback;
797 return nullptr;
798}
799
802 uint32_t idx) {
803 const auto &instances = GetObjectContainerInstances().GetInstances();
804 if (idx < instances.size())
805 return instances[idx].get_module_specifications;
806 return nullptr;
807}
808
809#pragma mark Platform
810
813
815 static PlatformInstances g_platform_instances;
816 return g_platform_instances;
817}
818
820 llvm::StringRef name, llvm::StringRef description,
821 PlatformCreateInstance create_callback,
822 DebuggerInitializeCallback debugger_init_callback) {
824 name, description, create_callback, debugger_init_callback);
825}
826
828 return GetPlatformInstances().UnregisterPlugin(create_callback);
829}
830
831llvm::StringRef PluginManager::GetPlatformPluginNameAtIndex(uint32_t idx) {
833}
834
835llvm::StringRef
838}
839
843}
844
848}
849
851 CompletionRequest &request) {
852 for (const auto &instance : GetPlatformInstances().GetInstances()) {
853 if (instance.name.starts_with(name))
854 request.AddCompletion(instance.name);
855 }
856}
857
858#pragma mark Process
859
862
864 static ProcessInstances g_instances;
865 return g_instances;
866}
867
869 llvm::StringRef name, llvm::StringRef description,
870 ProcessCreateInstance create_callback,
871 DebuggerInitializeCallback debugger_init_callback) {
873 name, description, create_callback, debugger_init_callback);
874}
875
877 return GetProcessInstances().UnregisterPlugin(create_callback);
878}
879
880llvm::StringRef PluginManager::GetProcessPluginNameAtIndex(uint32_t idx) {
882}
883
886}
887
891}
892
896}
897
899 CompletionRequest &request) {
900 for (const auto &instance : GetProcessInstances().GetInstances()) {
901 if (instance.name.starts_with(name))
902 request.AddCompletion(instance.name, instance.description);
903 }
904}
905
906#pragma mark RegisterTypeBuilder
907
909 : public PluginInstance<RegisterTypeBuilderCreateInstance> {
910 RegisterTypeBuilderInstance(llvm::StringRef name, llvm::StringRef description,
911 CallbackType create_callback)
913 create_callback) {}
914};
915
918
920 static RegisterTypeBuilderInstances g_instances;
921 return g_instances;
922}
923
925 llvm::StringRef name, llvm::StringRef description,
926 RegisterTypeBuilderCreateInstance create_callback) {
927 return GetRegisterTypeBuilderInstances().RegisterPlugin(name, description,
928 create_callback);
929}
930
932 RegisterTypeBuilderCreateInstance create_callback) {
933 return GetRegisterTypeBuilderInstances().UnregisterPlugin(create_callback);
934}
935
938 const auto &instances = GetRegisterTypeBuilderInstances().GetInstances();
939 // We assume that RegisterTypeBuilderClang is the only instance of this plugin
940 // type and is always present.
941 assert(instances.size());
942 return instances[0].create_callback(target);
943}
944
945#pragma mark ScriptInterpreter
946
948 : public PluginInstance<ScriptInterpreterCreateInstance> {
949 ScriptInterpreterInstance(llvm::StringRef name, llvm::StringRef description,
950 CallbackType create_callback,
951 lldb::ScriptLanguage language)
953 create_callback),
954 language(language) {}
955
957};
958
960
962 static ScriptInterpreterInstances g_instances;
963 return g_instances;
964}
965
967 llvm::StringRef name, llvm::StringRef description,
968 lldb::ScriptLanguage script_language,
969 ScriptInterpreterCreateInstance create_callback) {
971 name, description, create_callback, script_language);
972}
973
975 ScriptInterpreterCreateInstance create_callback) {
976 return GetScriptInterpreterInstances().UnregisterPlugin(create_callback);
977}
978
982}
983
986 Debugger &debugger) {
987 const auto &instances = GetScriptInterpreterInstances().GetInstances();
988 ScriptInterpreterCreateInstance none_instance = nullptr;
989 for (const auto &instance : instances) {
990 if (instance.language == lldb::eScriptLanguageNone)
991 none_instance = instance.create_callback;
992
993 if (script_lang == instance.language)
994 return instance.create_callback(debugger);
995 }
996
997 // If we didn't find one, return the ScriptInterpreter for the null language.
998 assert(none_instance != nullptr);
999 return none_instance(debugger);
1000}
1001
1002#pragma mark StructuredDataPlugin
1003
1005 : public PluginInstance<StructuredDataPluginCreateInstance> {
1007 llvm::StringRef name, llvm::StringRef description,
1008 CallbackType create_callback,
1009 DebuggerInitializeCallback debugger_init_callback,
1010 StructuredDataFilterLaunchInfo filter_callback)
1012 name, description, create_callback, debugger_init_callback),
1013 filter_callback(filter_callback) {}
1014
1015 StructuredDataFilterLaunchInfo filter_callback = nullptr;
1016};
1017
1020
1022 static StructuredDataPluginInstances g_instances;
1023 return g_instances;
1024}
1025
1027 llvm::StringRef name, llvm::StringRef description,
1028 StructuredDataPluginCreateInstance create_callback,
1029 DebuggerInitializeCallback debugger_init_callback,
1030 StructuredDataFilterLaunchInfo filter_callback) {
1032 name, description, create_callback, debugger_init_callback,
1033 filter_callback);
1034}
1035
1037 StructuredDataPluginCreateInstance create_callback) {
1038 return GetStructuredDataPluginInstances().UnregisterPlugin(create_callback);
1039}
1040
1044}
1045
1048 uint32_t idx, bool &iteration_complete) {
1049 const auto &instances = GetStructuredDataPluginInstances().GetInstances();
1050 if (idx < instances.size()) {
1051 iteration_complete = false;
1052 return instances[idx].filter_callback;
1053 } else {
1054 iteration_complete = true;
1055 }
1056 return nullptr;
1057}
1058
1059#pragma mark SymbolFile
1060
1063
1065 static SymbolFileInstances g_instances;
1066 return g_instances;
1067}
1068
1070 llvm::StringRef name, llvm::StringRef description,
1071 SymbolFileCreateInstance create_callback,
1072 DebuggerInitializeCallback debugger_init_callback) {
1074 name, description, create_callback, debugger_init_callback);
1075}
1076
1078 return GetSymbolFileInstances().UnregisterPlugin(create_callback);
1079}
1080
1084}
1085
1086#pragma mark SymbolVendor
1087
1090
1092 static SymbolVendorInstances g_instances;
1093 return g_instances;
1094}
1095
1096bool PluginManager::RegisterPlugin(llvm::StringRef name,
1097 llvm::StringRef description,
1098 SymbolVendorCreateInstance create_callback) {
1099 return GetSymbolVendorInstances().RegisterPlugin(name, description,
1100 create_callback);
1101}
1102
1104 SymbolVendorCreateInstance create_callback) {
1105 return GetSymbolVendorInstances().UnregisterPlugin(create_callback);
1106}
1107
1111}
1112
1113#pragma mark SymbolLocator
1114
1116 : public PluginInstance<SymbolLocatorCreateInstance> {
1118 llvm::StringRef name, llvm::StringRef description,
1119 CallbackType create_callback,
1120 SymbolLocatorLocateExecutableObjectFile locate_executable_object_file,
1121 SymbolLocatorLocateExecutableSymbolFile locate_executable_symbol_file,
1122 SymbolLocatorDownloadObjectAndSymbolFile download_object_symbol_file,
1123 SymbolLocatorFindSymbolFileInBundle find_symbol_file_in_bundle,
1124 DebuggerInitializeCallback debugger_init_callback)
1126 name, description, create_callback, debugger_init_callback),
1127 locate_executable_object_file(locate_executable_object_file),
1128 locate_executable_symbol_file(locate_executable_symbol_file),
1129 download_object_symbol_file(download_object_symbol_file),
1130 find_symbol_file_in_bundle(find_symbol_file_in_bundle) {}
1131
1136};
1138
1140 static SymbolLocatorInstances g_instances;
1141 return g_instances;
1142}
1143
1145 llvm::StringRef name, llvm::StringRef description,
1146 SymbolLocatorCreateInstance create_callback,
1147 SymbolLocatorLocateExecutableObjectFile locate_executable_object_file,
1148 SymbolLocatorLocateExecutableSymbolFile locate_executable_symbol_file,
1149 SymbolLocatorDownloadObjectAndSymbolFile download_object_symbol_file,
1150 SymbolLocatorFindSymbolFileInBundle find_symbol_file_in_bundle,
1151 DebuggerInitializeCallback debugger_init_callback) {
1153 name, description, create_callback, locate_executable_object_file,
1154 locate_executable_symbol_file, download_object_symbol_file,
1155 find_symbol_file_in_bundle, debugger_init_callback);
1156}
1157
1159 SymbolLocatorCreateInstance create_callback) {
1160 return GetSymbolLocatorInstances().UnregisterPlugin(create_callback);
1161}
1162
1166}
1167
1170 auto &instances = GetSymbolLocatorInstances().GetInstances();
1171 for (auto &instance : instances) {
1172 if (instance.locate_executable_object_file) {
1173 std::optional<ModuleSpec> result =
1174 instance.locate_executable_object_file(module_spec);
1175 if (result)
1176 return *result;
1177 }
1178 }
1179 return {};
1180}
1181
1183 const ModuleSpec &module_spec, const FileSpecList &default_search_paths) {
1184 auto &instances = GetSymbolLocatorInstances().GetInstances();
1185 for (auto &instance : instances) {
1186 if (instance.locate_executable_symbol_file) {
1187 std::optional<FileSpec> result = instance.locate_executable_symbol_file(
1188 module_spec, default_search_paths);
1189 if (result)
1190 return *result;
1191 }
1192 }
1193 return {};
1194}
1195
1197 Status &error,
1198 bool force_lookup,
1199 bool copy_executable) {
1200 auto &instances = GetSymbolLocatorInstances().GetInstances();
1201 for (auto &instance : instances) {
1202 if (instance.download_object_symbol_file) {
1203 if (instance.download_object_symbol_file(module_spec, error, force_lookup,
1204 copy_executable))
1205 return true;
1206 }
1207 }
1208 return false;
1209}
1210
1212 const UUID *uuid,
1213 const ArchSpec *arch) {
1214 auto &instances = GetSymbolLocatorInstances().GetInstances();
1215 for (auto &instance : instances) {
1216 if (instance.find_symbol_file_in_bundle) {
1217 std::optional<FileSpec> result =
1218 instance.find_symbol_file_in_bundle(symfile_bundle, uuid, arch);
1219 if (result)
1220 return *result;
1221 }
1222 }
1223 return {};
1224}
1225
1226#pragma mark Trace
1227
1229 : public PluginInstance<TraceCreateInstanceFromBundle> {
1231 llvm::StringRef name, llvm::StringRef description,
1232 CallbackType create_callback_from_bundle,
1233 TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1234 llvm::StringRef schema, DebuggerInitializeCallback debugger_init_callback)
1236 name, description, create_callback_from_bundle,
1237 debugger_init_callback),
1238 schema(schema),
1239 create_callback_for_live_process(create_callback_for_live_process) {}
1240
1241 llvm::StringRef schema;
1243};
1244
1246
1248 static TraceInstances g_instances;
1249 return g_instances;
1250}
1251
1253 llvm::StringRef name, llvm::StringRef description,
1254 TraceCreateInstanceFromBundle create_callback_from_bundle,
1255 TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1256 llvm::StringRef schema, DebuggerInitializeCallback debugger_init_callback) {
1258 name, description, create_callback_from_bundle,
1259 create_callback_for_live_process, schema, debugger_init_callback);
1260}
1261
1263 TraceCreateInstanceFromBundle create_callback_from_bundle) {
1265 create_callback_from_bundle);
1266}
1267
1269PluginManager::GetTraceCreateCallback(llvm::StringRef plugin_name) {
1270 return GetTracePluginInstances().GetCallbackForName(plugin_name);
1271}
1272
1275 for (const TraceInstance &instance : GetTracePluginInstances().GetInstances())
1276 if (instance.name == plugin_name)
1277 return instance.create_callback_for_live_process;
1278 return nullptr;
1279}
1280
1281llvm::StringRef PluginManager::GetTraceSchema(llvm::StringRef plugin_name) {
1282 for (const TraceInstance &instance : GetTracePluginInstances().GetInstances())
1283 if (instance.name == plugin_name)
1284 return instance.schema;
1285 return llvm::StringRef();
1286}
1287
1288llvm::StringRef PluginManager::GetTraceSchema(size_t index) {
1289 if (TraceInstance *instance =
1290 GetTracePluginInstances().GetInstanceAtIndex(index))
1291 return instance->schema;
1292 return llvm::StringRef();
1293}
1294
1295#pragma mark TraceExporter
1296
1298 : public PluginInstance<TraceExporterCreateInstance> {
1300 llvm::StringRef name, llvm::StringRef description,
1301 TraceExporterCreateInstance create_instance,
1302 ThreadTraceExportCommandCreator create_thread_trace_export_command)
1303 : PluginInstance<TraceExporterCreateInstance>(name, description,
1304 create_instance),
1305 create_thread_trace_export_command(create_thread_trace_export_command) {
1306 }
1307
1309};
1310
1312
1314 static TraceExporterInstances g_instances;
1315 return g_instances;
1316}
1317
1319 llvm::StringRef name, llvm::StringRef description,
1320 TraceExporterCreateInstance create_callback,
1321 ThreadTraceExportCommandCreator create_thread_trace_export_command) {
1323 name, description, create_callback, create_thread_trace_export_command);
1324}
1325
1328 return GetTraceExporterInstances().GetCallbackForName(plugin_name);
1329}
1330
1332 TraceExporterCreateInstance create_callback) {
1333 return GetTraceExporterInstances().UnregisterPlugin(create_callback);
1334}
1335
1338 if (TraceExporterInstance *instance =
1339 GetTraceExporterInstances().GetInstanceAtIndex(index))
1340 return instance->create_thread_trace_export_command;
1341 return nullptr;
1342}
1343
1344llvm::StringRef
1347}
1348
1349#pragma mark UnwindAssembly
1350
1353
1355 static UnwindAssemblyInstances g_instances;
1356 return g_instances;
1357}
1358
1360 llvm::StringRef name, llvm::StringRef description,
1361 UnwindAssemblyCreateInstance create_callback) {
1362 return GetUnwindAssemblyInstances().RegisterPlugin(name, description,
1363 create_callback);
1364}
1365
1367 UnwindAssemblyCreateInstance create_callback) {
1368 return GetUnwindAssemblyInstances().UnregisterPlugin(create_callback);
1369}
1370
1374}
1375
1376#pragma mark MemoryHistory
1377
1380
1382 static MemoryHistoryInstances g_instances;
1383 return g_instances;
1384}
1385
1387 llvm::StringRef name, llvm::StringRef description,
1388 MemoryHistoryCreateInstance create_callback) {
1389 return GetMemoryHistoryInstances().RegisterPlugin(name, description,
1390 create_callback);
1391}
1392
1394 MemoryHistoryCreateInstance create_callback) {
1395 return GetMemoryHistoryInstances().UnregisterPlugin(create_callback);
1396}
1397
1401}
1402
1403#pragma mark InstrumentationRuntime
1404
1406 : public PluginInstance<InstrumentationRuntimeCreateInstance> {
1408 llvm::StringRef name, llvm::StringRef description,
1409 CallbackType create_callback,
1410 InstrumentationRuntimeGetType get_type_callback)
1412 create_callback),
1413 get_type_callback(get_type_callback) {}
1414
1415 InstrumentationRuntimeGetType get_type_callback = nullptr;
1416};
1417
1420
1422 static InstrumentationRuntimeInstances g_instances;
1423 return g_instances;
1424}
1425
1427 llvm::StringRef name, llvm::StringRef description,
1429 InstrumentationRuntimeGetType get_type_callback) {
1431 name, description, create_callback, get_type_callback);
1432}
1433
1435 InstrumentationRuntimeCreateInstance create_callback) {
1436 return GetInstrumentationRuntimeInstances().UnregisterPlugin(create_callback);
1437}
1438
1441 const auto &instances = GetInstrumentationRuntimeInstances().GetInstances();
1442 if (idx < instances.size())
1443 return instances[idx].get_type_callback;
1444 return nullptr;
1445}
1446
1450}
1451
1452#pragma mark TypeSystem
1453
1454struct TypeSystemInstance : public PluginInstance<TypeSystemCreateInstance> {
1455 TypeSystemInstance(llvm::StringRef name, llvm::StringRef description,
1456 CallbackType create_callback,
1457 LanguageSet supported_languages_for_types,
1458 LanguageSet supported_languages_for_expressions)
1459 : PluginInstance<TypeSystemCreateInstance>(name, description,
1460 create_callback),
1461 supported_languages_for_types(supported_languages_for_types),
1462 supported_languages_for_expressions(
1463 supported_languages_for_expressions) {}
1464
1467};
1468
1470
1472 static TypeSystemInstances g_instances;
1473 return g_instances;
1474}
1475
1477 llvm::StringRef name, llvm::StringRef description,
1478 TypeSystemCreateInstance create_callback,
1479 LanguageSet supported_languages_for_types,
1480 LanguageSet supported_languages_for_expressions) {
1482 name, description, create_callback, supported_languages_for_types,
1483 supported_languages_for_expressions);
1484}
1485
1487 return GetTypeSystemInstances().UnregisterPlugin(create_callback);
1488}
1489
1493}
1494
1496 const auto &instances = GetTypeSystemInstances().GetInstances();
1497 LanguageSet all;
1498 for (unsigned i = 0; i < instances.size(); ++i)
1499 all.bitvector |= instances[i].supported_languages_for_types.bitvector;
1500 return all;
1501}
1502
1504 const auto &instances = GetTypeSystemInstances().GetInstances();
1505 LanguageSet all;
1506 for (unsigned i = 0; i < instances.size(); ++i)
1507 all.bitvector |= instances[i].supported_languages_for_expressions.bitvector;
1508 return all;
1509}
1510
1511#pragma mark ScriptedInterfaces
1512
1514 : public PluginInstance<ScriptedInterfaceCreateInstance> {
1515 ScriptedInterfaceInstance(llvm::StringRef name, llvm::StringRef description,
1516 ScriptedInterfaceCreateInstance create_callback,
1517 lldb::ScriptLanguage language,
1520 create_callback),
1521 language(language), usages(usages) {}
1522
1525};
1526
1528
1530 static ScriptedInterfaceInstances g_instances;
1531 return g_instances;
1532}
1533
1535 llvm::StringRef name, llvm::StringRef description,
1536 ScriptedInterfaceCreateInstance create_callback,
1539 name, description, create_callback, language, usages);
1540}
1541
1543 ScriptedInterfaceCreateInstance create_callback) {
1544 return GetScriptedInterfaceInstances().UnregisterPlugin(create_callback);
1545}
1546
1549}
1550
1551llvm::StringRef PluginManager::GetScriptedInterfaceNameAtIndex(uint32_t index) {
1553}
1554
1555llvm::StringRef
1558}
1559
1562 const auto &instances = GetScriptedInterfaceInstances().GetInstances();
1563 return idx < instances.size() ? instances[idx].language
1564 : ScriptLanguage::eScriptLanguageNone;
1565}
1566
1569 const auto &instances = GetScriptedInterfaceInstances().GetInstances();
1570 if (idx >= instances.size())
1571 return {};
1572 return instances[idx].usages;
1573}
1574
1575#pragma mark REPL
1576
1577struct REPLInstance : public PluginInstance<REPLCreateInstance> {
1578 REPLInstance(llvm::StringRef name, llvm::StringRef description,
1579 CallbackType create_callback, LanguageSet supported_languages)
1580 : PluginInstance<REPLCreateInstance>(name, description, create_callback),
1581 supported_languages(supported_languages) {}
1582
1584};
1585
1587
1589 static REPLInstances g_instances;
1590 return g_instances;
1591}
1592
1593bool PluginManager::RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
1594 REPLCreateInstance create_callback,
1595 LanguageSet supported_languages) {
1596 return GetREPLInstances().RegisterPlugin(name, description, create_callback,
1597 supported_languages);
1598}
1599
1601 return GetREPLInstances().UnregisterPlugin(create_callback);
1602}
1603
1606}
1607
1609 const auto &instances = GetREPLInstances().GetInstances();
1610 return idx < instances.size() ? instances[idx].supported_languages
1611 : LanguageSet();
1612}
1613
1615 const auto &instances = GetREPLInstances().GetInstances();
1616 LanguageSet all;
1617 for (unsigned i = 0; i < instances.size(); ++i)
1618 all.bitvector |= instances[i].supported_languages.bitvector;
1619 return all;
1620}
1621
1622#pragma mark PluginManager
1623
1636}
1637
1638// This is the preferred new way to register plugin specific settings. e.g.
1639// This will put a plugin's settings under e.g.
1640// "plugin.<plugin_type_name>.<plugin_type_desc>.SETTINGNAME".
1642GetDebuggerPropertyForPlugins(Debugger &debugger, llvm::StringRef plugin_type_name,
1643 llvm::StringRef plugin_type_desc,
1644 bool can_create) {
1645 lldb::OptionValuePropertiesSP parent_properties_sp(
1646 debugger.GetValueProperties());
1647 if (parent_properties_sp) {
1648 static constexpr llvm::StringLiteral g_property_name("plugin");
1649
1650 OptionValuePropertiesSP plugin_properties_sp =
1651 parent_properties_sp->GetSubProperty(nullptr, g_property_name);
1652 if (!plugin_properties_sp && can_create) {
1653 plugin_properties_sp =
1654 std::make_shared<OptionValueProperties>(g_property_name);
1655 parent_properties_sp->AppendProperty(g_property_name,
1656 "Settings specify to plugins.", true,
1657 plugin_properties_sp);
1658 }
1659
1660 if (plugin_properties_sp) {
1661 lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1662 plugin_properties_sp->GetSubProperty(nullptr, plugin_type_name);
1663 if (!plugin_type_properties_sp && can_create) {
1664 plugin_type_properties_sp =
1665 std::make_shared<OptionValueProperties>(plugin_type_name);
1666 plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1667 true, plugin_type_properties_sp);
1668 }
1669 return plugin_type_properties_sp;
1670 }
1671 }
1673}
1674
1675// This is deprecated way to register plugin specific settings. e.g.
1676// "<plugin_type_name>.plugin.<plugin_type_desc>.SETTINGNAME" and Platform
1677// generic settings would be under "platform.SETTINGNAME".
1679 Debugger &debugger, llvm::StringRef plugin_type_name,
1680 llvm::StringRef plugin_type_desc, bool can_create) {
1681 static constexpr llvm::StringLiteral g_property_name("plugin");
1682 lldb::OptionValuePropertiesSP parent_properties_sp(
1683 debugger.GetValueProperties());
1684 if (parent_properties_sp) {
1685 OptionValuePropertiesSP plugin_properties_sp =
1686 parent_properties_sp->GetSubProperty(nullptr, plugin_type_name);
1687 if (!plugin_properties_sp && can_create) {
1688 plugin_properties_sp =
1689 std::make_shared<OptionValueProperties>(plugin_type_name);
1690 parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1691 true, plugin_properties_sp);
1692 }
1693
1694 if (plugin_properties_sp) {
1695 lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1696 plugin_properties_sp->GetSubProperty(nullptr, g_property_name);
1697 if (!plugin_type_properties_sp && can_create) {
1698 plugin_type_properties_sp =
1699 std::make_shared<OptionValueProperties>(g_property_name);
1700 plugin_properties_sp->AppendProperty(g_property_name,
1701 "Settings specific to plugins",
1702 true, plugin_type_properties_sp);
1703 }
1704 return plugin_type_properties_sp;
1705 }
1706 }
1708}
1709
1710namespace {
1711
1713GetDebuggerPropertyForPluginsPtr(Debugger &, llvm::StringRef, llvm::StringRef,
1714 bool can_create);
1715}
1716
1718GetSettingForPlugin(Debugger &debugger, llvm::StringRef setting_name,
1719 llvm::StringRef plugin_type_name,
1720 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1722 lldb::OptionValuePropertiesSP properties_sp;
1723 lldb::OptionValuePropertiesSP plugin_type_properties_sp(get_debugger_property(
1724 debugger, plugin_type_name,
1725 "", // not creating to so we don't need the description
1726 false));
1727 if (plugin_type_properties_sp)
1728 properties_sp =
1729 plugin_type_properties_sp->GetSubProperty(nullptr, setting_name);
1730 return properties_sp;
1731}
1732
1733static bool
1734CreateSettingForPlugin(Debugger &debugger, llvm::StringRef plugin_type_name,
1735 llvm::StringRef plugin_type_desc,
1736 const lldb::OptionValuePropertiesSP &properties_sp,
1737 llvm::StringRef description, bool is_global_property,
1738 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1740 if (properties_sp) {
1741 lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1742 get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
1743 true));
1744 if (plugin_type_properties_sp) {
1745 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1746 description, is_global_property,
1747 properties_sp);
1748 return true;
1749 }
1750 }
1751 return false;
1752}
1753
1754static constexpr llvm::StringLiteral kDynamicLoaderPluginName("dynamic-loader");
1755static constexpr llvm::StringLiteral kPlatformPluginName("platform");
1756static constexpr llvm::StringLiteral kProcessPluginName("process");
1757static constexpr llvm::StringLiteral kTracePluginName("trace");
1758static constexpr llvm::StringLiteral kObjectFilePluginName("object-file");
1759static constexpr llvm::StringLiteral kSymbolFilePluginName("symbol-file");
1760static constexpr llvm::StringLiteral kSymbolLocatorPluginName("symbol-locator");
1761static constexpr llvm::StringLiteral kJITLoaderPluginName("jit-loader");
1762static constexpr llvm::StringLiteral
1763 kStructuredDataPluginName("structured-data");
1764
1767 llvm::StringRef setting_name) {
1768 return GetSettingForPlugin(debugger, setting_name, kDynamicLoaderPluginName);
1769}
1770
1772 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1773 llvm::StringRef description, bool is_global_property) {
1775 "Settings for dynamic loader plug-ins",
1776 properties_sp, description, is_global_property);
1777}
1778
1781 llvm::StringRef setting_name) {
1782 return GetSettingForPlugin(debugger, setting_name, kPlatformPluginName,
1784}
1785
1787 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1788 llvm::StringRef description, bool is_global_property) {
1790 "Settings for platform plug-ins", properties_sp,
1791 description, is_global_property,
1793}
1794
1797 llvm::StringRef setting_name) {
1798 return GetSettingForPlugin(debugger, setting_name, kProcessPluginName);
1799}
1800
1802 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1803 llvm::StringRef description, bool is_global_property) {
1805 "Settings for process plug-ins", properties_sp,
1806 description, is_global_property);
1807}
1808
1811 llvm::StringRef setting_name) {
1812 return GetSettingForPlugin(debugger, setting_name, kSymbolLocatorPluginName);
1813}
1814
1816 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1817 llvm::StringRef description, bool is_global_property) {
1819 "Settings for symbol locator plug-ins",
1820 properties_sp, description, is_global_property);
1821}
1822
1824 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1825 llvm::StringRef description, bool is_global_property) {
1827 "Settings for trace plug-ins", properties_sp,
1828 description, is_global_property);
1829}
1830
1833 llvm::StringRef setting_name) {
1834 return GetSettingForPlugin(debugger, setting_name, kObjectFilePluginName);
1835}
1836
1838 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1839 llvm::StringRef description, bool is_global_property) {
1841 "Settings for object file plug-ins",
1842 properties_sp, description, is_global_property);
1843}
1844
1847 llvm::StringRef setting_name) {
1848 return GetSettingForPlugin(debugger, setting_name, kSymbolFilePluginName);
1849}
1850
1852 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1853 llvm::StringRef description, bool is_global_property) {
1855 "Settings for symbol file plug-ins",
1856 properties_sp, description, is_global_property);
1857}
1858
1861 llvm::StringRef setting_name) {
1862 return GetSettingForPlugin(debugger, setting_name, kJITLoaderPluginName);
1863}
1864
1866 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1867 llvm::StringRef description, bool is_global_property) {
1869 "Settings for JIT loader plug-ins",
1870 properties_sp, description, is_global_property);
1871}
1872
1873static const char *kOperatingSystemPluginName("os");
1874
1877 llvm::StringRef setting_name) {
1878 lldb::OptionValuePropertiesSP properties_sp;
1879 lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1882 "", // not creating to so we don't need the description
1883 false));
1884 if (plugin_type_properties_sp)
1885 properties_sp =
1886 plugin_type_properties_sp->GetSubProperty(nullptr, setting_name);
1887 return properties_sp;
1888}
1889
1891 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1892 llvm::StringRef description, bool is_global_property) {
1893 if (properties_sp) {
1894 lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1896 "Settings for operating system plug-ins",
1897 true));
1898 if (plugin_type_properties_sp) {
1899 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1900 description, is_global_property,
1901 properties_sp);
1902 return true;
1903 }
1904 }
1905 return false;
1906}
1907
1910 llvm::StringRef setting_name) {
1911 return GetSettingForPlugin(debugger, setting_name, kStructuredDataPluginName);
1912}
1913
1915 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1916 llvm::StringRef description, bool is_global_property) {
1918 "Settings for structured data plug-ins",
1919 properties_sp, description, is_global_property);
1920}
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:693
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:91
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 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 Status SaveCore(const lldb::ProcessSP &process_sp, lldb_private::SaveCoreOptions &core_options)
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
Status EnsureValidConfiguration(lldb::ProcessSP process_sp) const
An error handling class.
Definition: Status.h:118
static Status FromErrorString(const char *str)
Definition: Status.h:141
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
Definition: Status.cpp:137
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)
lldb::InstrumentationRuntimeType(* InstrumentationRuntimeGetType)()
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::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::CommandObjectSP(* ThreadTraceExportCommandCreator)(CommandInterpreter &interpreter)
Definition: SBAddress.h:15
ScriptLanguage
Script interpreter types.
@ eScriptLanguageNone
std::shared_ptr< lldb_private::OptionValueProperties > OptionValuePropertiesSP
Definition: lldb-forward.h:387
std::shared_ptr< lldb_private::ScriptInterpreter > ScriptInterpreterSP
Definition: lldb-forward.h:406
std::shared_ptr< lldb_private::RegisterTypeBuilder > RegisterTypeBuilderSP
Definition: lldb-forward.h:396
std::shared_ptr< lldb_private::Process > ProcessSP
Definition: lldb-forward.h:389
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