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
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 error = options.EnsureValidConfiguration(process_sp);
718 if (error.Fail())
719 return error;
720
721 if (!options.GetPluginName().has_value()) {
722 // Try saving core directly from the process plugin first.
723 llvm::Expected<bool> ret =
724 process_sp->SaveCore(options.GetOutputFile()->GetPath());
725 if (!ret)
726 return Status(ret.takeError());
727 if (ret.get())
728 return Status();
729 }
730
731 // Fall back to object plugins.
732 const auto &plugin_name = options.GetPluginName().value_or("");
733 auto &instances = GetObjectFileInstances().GetInstances();
734 for (auto &instance : instances) {
735 if (plugin_name.empty() || instance.name == plugin_name) {
736 if (instance.save_core && instance.save_core(process_sp, options, error))
737 return error;
738 }
739 }
740
741 // Check to see if any of the object file plugins tried and failed to save.
742 // If none ran, set the error message.
743 if (error.Success())
744 error.SetErrorString(
745 "no ObjectFile plugins were able to save a core for this process");
746 return error;
747}
748
749#pragma mark ObjectContainer
750
752 : public PluginInstance<ObjectContainerCreateInstance> {
754 llvm::StringRef name, llvm::StringRef description,
755 CallbackType create_callback,
756 ObjectContainerCreateMemoryInstance create_memory_callback,
757 ObjectFileGetModuleSpecifications get_module_specifications)
759 create_callback),
760 create_memory_callback(create_memory_callback),
761 get_module_specifications(get_module_specifications) {}
762
765};
767
769 static ObjectContainerInstances g_instances;
770 return g_instances;
771}
772
774 llvm::StringRef name, llvm::StringRef description,
775 ObjectContainerCreateInstance create_callback,
776 ObjectFileGetModuleSpecifications get_module_specifications,
777 ObjectContainerCreateMemoryInstance create_memory_callback) {
779 name, description, create_callback, create_memory_callback,
780 get_module_specifications);
781}
782
784 ObjectContainerCreateInstance create_callback) {
785 return GetObjectContainerInstances().UnregisterPlugin(create_callback);
786}
787
791}
792
795 const auto &instances = GetObjectContainerInstances().GetInstances();
796 if (idx < instances.size())
797 return instances[idx].create_memory_callback;
798 return nullptr;
799}
800
803 uint32_t idx) {
804 const auto &instances = GetObjectContainerInstances().GetInstances();
805 if (idx < instances.size())
806 return instances[idx].get_module_specifications;
807 return nullptr;
808}
809
810#pragma mark Platform
811
814
816 static PlatformInstances g_platform_instances;
817 return g_platform_instances;
818}
819
821 llvm::StringRef name, llvm::StringRef description,
822 PlatformCreateInstance create_callback,
823 DebuggerInitializeCallback debugger_init_callback) {
825 name, description, create_callback, debugger_init_callback);
826}
827
829 return GetPlatformInstances().UnregisterPlugin(create_callback);
830}
831
832llvm::StringRef PluginManager::GetPlatformPluginNameAtIndex(uint32_t idx) {
834}
835
836llvm::StringRef
839}
840
844}
845
849}
850
852 CompletionRequest &request) {
853 for (const auto &instance : GetPlatformInstances().GetInstances()) {
854 if (instance.name.starts_with(name))
855 request.AddCompletion(instance.name);
856 }
857}
858
859#pragma mark Process
860
863
865 static ProcessInstances g_instances;
866 return g_instances;
867}
868
870 llvm::StringRef name, llvm::StringRef description,
871 ProcessCreateInstance create_callback,
872 DebuggerInitializeCallback debugger_init_callback) {
874 name, description, create_callback, debugger_init_callback);
875}
876
878 return GetProcessInstances().UnregisterPlugin(create_callback);
879}
880
881llvm::StringRef PluginManager::GetProcessPluginNameAtIndex(uint32_t idx) {
883}
884
887}
888
892}
893
897}
898
900 CompletionRequest &request) {
901 for (const auto &instance : GetProcessInstances().GetInstances()) {
902 if (instance.name.starts_with(name))
903 request.AddCompletion(instance.name, instance.description);
904 }
905}
906
907#pragma mark RegisterTypeBuilder
908
910 : public PluginInstance<RegisterTypeBuilderCreateInstance> {
911 RegisterTypeBuilderInstance(llvm::StringRef name, llvm::StringRef description,
912 CallbackType create_callback)
914 create_callback) {}
915};
916
919
921 static RegisterTypeBuilderInstances g_instances;
922 return g_instances;
923}
924
926 llvm::StringRef name, llvm::StringRef description,
927 RegisterTypeBuilderCreateInstance create_callback) {
928 return GetRegisterTypeBuilderInstances().RegisterPlugin(name, description,
929 create_callback);
930}
931
933 RegisterTypeBuilderCreateInstance create_callback) {
934 return GetRegisterTypeBuilderInstances().UnregisterPlugin(create_callback);
935}
936
939 const auto &instances = GetRegisterTypeBuilderInstances().GetInstances();
940 // We assume that RegisterTypeBuilderClang is the only instance of this plugin
941 // type and is always present.
942 assert(instances.size());
943 return instances[0].create_callback(target);
944}
945
946#pragma mark ScriptInterpreter
947
949 : public PluginInstance<ScriptInterpreterCreateInstance> {
950 ScriptInterpreterInstance(llvm::StringRef name, llvm::StringRef description,
951 CallbackType create_callback,
952 lldb::ScriptLanguage language)
954 create_callback),
955 language(language) {}
956
958};
959
961
963 static ScriptInterpreterInstances g_instances;
964 return g_instances;
965}
966
968 llvm::StringRef name, llvm::StringRef description,
969 lldb::ScriptLanguage script_language,
970 ScriptInterpreterCreateInstance create_callback) {
972 name, description, create_callback, script_language);
973}
974
976 ScriptInterpreterCreateInstance create_callback) {
977 return GetScriptInterpreterInstances().UnregisterPlugin(create_callback);
978}
979
983}
984
987 Debugger &debugger) {
988 const auto &instances = GetScriptInterpreterInstances().GetInstances();
989 ScriptInterpreterCreateInstance none_instance = nullptr;
990 for (const auto &instance : instances) {
991 if (instance.language == lldb::eScriptLanguageNone)
992 none_instance = instance.create_callback;
993
994 if (script_lang == instance.language)
995 return instance.create_callback(debugger);
996 }
997
998 // If we didn't find one, return the ScriptInterpreter for the null language.
999 assert(none_instance != nullptr);
1000 return none_instance(debugger);
1001}
1002
1003#pragma mark StructuredDataPlugin
1004
1006 : public PluginInstance<StructuredDataPluginCreateInstance> {
1008 llvm::StringRef name, llvm::StringRef description,
1009 CallbackType create_callback,
1010 DebuggerInitializeCallback debugger_init_callback,
1011 StructuredDataFilterLaunchInfo filter_callback)
1013 name, description, create_callback, debugger_init_callback),
1014 filter_callback(filter_callback) {}
1015
1016 StructuredDataFilterLaunchInfo filter_callback = nullptr;
1017};
1018
1021
1023 static StructuredDataPluginInstances g_instances;
1024 return g_instances;
1025}
1026
1028 llvm::StringRef name, llvm::StringRef description,
1029 StructuredDataPluginCreateInstance create_callback,
1030 DebuggerInitializeCallback debugger_init_callback,
1031 StructuredDataFilterLaunchInfo filter_callback) {
1033 name, description, create_callback, debugger_init_callback,
1034 filter_callback);
1035}
1036
1038 StructuredDataPluginCreateInstance create_callback) {
1039 return GetStructuredDataPluginInstances().UnregisterPlugin(create_callback);
1040}
1041
1045}
1046
1049 uint32_t idx, bool &iteration_complete) {
1050 const auto &instances = GetStructuredDataPluginInstances().GetInstances();
1051 if (idx < instances.size()) {
1052 iteration_complete = false;
1053 return instances[idx].filter_callback;
1054 } else {
1055 iteration_complete = true;
1056 }
1057 return nullptr;
1058}
1059
1060#pragma mark SymbolFile
1061
1064
1066 static SymbolFileInstances g_instances;
1067 return g_instances;
1068}
1069
1071 llvm::StringRef name, llvm::StringRef description,
1072 SymbolFileCreateInstance create_callback,
1073 DebuggerInitializeCallback debugger_init_callback) {
1075 name, description, create_callback, debugger_init_callback);
1076}
1077
1079 return GetSymbolFileInstances().UnregisterPlugin(create_callback);
1080}
1081
1085}
1086
1087#pragma mark SymbolVendor
1088
1091
1093 static SymbolVendorInstances g_instances;
1094 return g_instances;
1095}
1096
1097bool PluginManager::RegisterPlugin(llvm::StringRef name,
1098 llvm::StringRef description,
1099 SymbolVendorCreateInstance create_callback) {
1100 return GetSymbolVendorInstances().RegisterPlugin(name, description,
1101 create_callback);
1102}
1103
1105 SymbolVendorCreateInstance create_callback) {
1106 return GetSymbolVendorInstances().UnregisterPlugin(create_callback);
1107}
1108
1112}
1113
1114#pragma mark SymbolLocator
1115
1117 : public PluginInstance<SymbolLocatorCreateInstance> {
1119 llvm::StringRef name, llvm::StringRef description,
1120 CallbackType create_callback,
1121 SymbolLocatorLocateExecutableObjectFile locate_executable_object_file,
1122 SymbolLocatorLocateExecutableSymbolFile locate_executable_symbol_file,
1123 SymbolLocatorDownloadObjectAndSymbolFile download_object_symbol_file,
1124 SymbolLocatorFindSymbolFileInBundle find_symbol_file_in_bundle,
1125 DebuggerInitializeCallback debugger_init_callback)
1127 name, description, create_callback, debugger_init_callback),
1128 locate_executable_object_file(locate_executable_object_file),
1129 locate_executable_symbol_file(locate_executable_symbol_file),
1130 download_object_symbol_file(download_object_symbol_file),
1131 find_symbol_file_in_bundle(find_symbol_file_in_bundle) {}
1132
1137};
1139
1141 static SymbolLocatorInstances g_instances;
1142 return g_instances;
1143}
1144
1146 llvm::StringRef name, llvm::StringRef description,
1147 SymbolLocatorCreateInstance create_callback,
1148 SymbolLocatorLocateExecutableObjectFile locate_executable_object_file,
1149 SymbolLocatorLocateExecutableSymbolFile locate_executable_symbol_file,
1150 SymbolLocatorDownloadObjectAndSymbolFile download_object_symbol_file,
1151 SymbolLocatorFindSymbolFileInBundle find_symbol_file_in_bundle,
1152 DebuggerInitializeCallback debugger_init_callback) {
1154 name, description, create_callback, locate_executable_object_file,
1155 locate_executable_symbol_file, download_object_symbol_file,
1156 find_symbol_file_in_bundle, debugger_init_callback);
1157}
1158
1160 SymbolLocatorCreateInstance create_callback) {
1161 return GetSymbolLocatorInstances().UnregisterPlugin(create_callback);
1162}
1163
1167}
1168
1171 auto &instances = GetSymbolLocatorInstances().GetInstances();
1172 for (auto &instance : instances) {
1173 if (instance.locate_executable_object_file) {
1174 std::optional<ModuleSpec> result =
1175 instance.locate_executable_object_file(module_spec);
1176 if (result)
1177 return *result;
1178 }
1179 }
1180 return {};
1181}
1182
1184 const ModuleSpec &module_spec, const FileSpecList &default_search_paths) {
1185 auto &instances = GetSymbolLocatorInstances().GetInstances();
1186 for (auto &instance : instances) {
1187 if (instance.locate_executable_symbol_file) {
1188 std::optional<FileSpec> result = instance.locate_executable_symbol_file(
1189 module_spec, default_search_paths);
1190 if (result)
1191 return *result;
1192 }
1193 }
1194 return {};
1195}
1196
1198 Status &error,
1199 bool force_lookup,
1200 bool copy_executable) {
1201 auto &instances = GetSymbolLocatorInstances().GetInstances();
1202 for (auto &instance : instances) {
1203 if (instance.download_object_symbol_file) {
1204 if (instance.download_object_symbol_file(module_spec, error, force_lookup,
1205 copy_executable))
1206 return true;
1207 }
1208 }
1209 return false;
1210}
1211
1213 const UUID *uuid,
1214 const ArchSpec *arch) {
1215 auto &instances = GetSymbolLocatorInstances().GetInstances();
1216 for (auto &instance : instances) {
1217 if (instance.find_symbol_file_in_bundle) {
1218 std::optional<FileSpec> result =
1219 instance.find_symbol_file_in_bundle(symfile_bundle, uuid, arch);
1220 if (result)
1221 return *result;
1222 }
1223 }
1224 return {};
1225}
1226
1227#pragma mark Trace
1228
1230 : public PluginInstance<TraceCreateInstanceFromBundle> {
1232 llvm::StringRef name, llvm::StringRef description,
1233 CallbackType create_callback_from_bundle,
1234 TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1235 llvm::StringRef schema, DebuggerInitializeCallback debugger_init_callback)
1237 name, description, create_callback_from_bundle,
1238 debugger_init_callback),
1239 schema(schema),
1240 create_callback_for_live_process(create_callback_for_live_process) {}
1241
1242 llvm::StringRef schema;
1244};
1245
1247
1249 static TraceInstances g_instances;
1250 return g_instances;
1251}
1252
1254 llvm::StringRef name, llvm::StringRef description,
1255 TraceCreateInstanceFromBundle create_callback_from_bundle,
1256 TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1257 llvm::StringRef schema, DebuggerInitializeCallback debugger_init_callback) {
1259 name, description, create_callback_from_bundle,
1260 create_callback_for_live_process, schema, debugger_init_callback);
1261}
1262
1264 TraceCreateInstanceFromBundle create_callback_from_bundle) {
1266 create_callback_from_bundle);
1267}
1268
1270PluginManager::GetTraceCreateCallback(llvm::StringRef plugin_name) {
1271 return GetTracePluginInstances().GetCallbackForName(plugin_name);
1272}
1273
1276 for (const TraceInstance &instance : GetTracePluginInstances().GetInstances())
1277 if (instance.name == plugin_name)
1278 return instance.create_callback_for_live_process;
1279 return nullptr;
1280}
1281
1282llvm::StringRef PluginManager::GetTraceSchema(llvm::StringRef plugin_name) {
1283 for (const TraceInstance &instance : GetTracePluginInstances().GetInstances())
1284 if (instance.name == plugin_name)
1285 return instance.schema;
1286 return llvm::StringRef();
1287}
1288
1289llvm::StringRef PluginManager::GetTraceSchema(size_t index) {
1290 if (TraceInstance *instance =
1291 GetTracePluginInstances().GetInstanceAtIndex(index))
1292 return instance->schema;
1293 return llvm::StringRef();
1294}
1295
1296#pragma mark TraceExporter
1297
1299 : public PluginInstance<TraceExporterCreateInstance> {
1301 llvm::StringRef name, llvm::StringRef description,
1302 TraceExporterCreateInstance create_instance,
1303 ThreadTraceExportCommandCreator create_thread_trace_export_command)
1304 : PluginInstance<TraceExporterCreateInstance>(name, description,
1305 create_instance),
1306 create_thread_trace_export_command(create_thread_trace_export_command) {
1307 }
1308
1310};
1311
1313
1315 static TraceExporterInstances g_instances;
1316 return g_instances;
1317}
1318
1320 llvm::StringRef name, llvm::StringRef description,
1321 TraceExporterCreateInstance create_callback,
1322 ThreadTraceExportCommandCreator create_thread_trace_export_command) {
1324 name, description, create_callback, create_thread_trace_export_command);
1325}
1326
1329 return GetTraceExporterInstances().GetCallbackForName(plugin_name);
1330}
1331
1333 TraceExporterCreateInstance create_callback) {
1334 return GetTraceExporterInstances().UnregisterPlugin(create_callback);
1335}
1336
1339 if (TraceExporterInstance *instance =
1340 GetTraceExporterInstances().GetInstanceAtIndex(index))
1341 return instance->create_thread_trace_export_command;
1342 return nullptr;
1343}
1344
1345llvm::StringRef
1348}
1349
1350#pragma mark UnwindAssembly
1351
1354
1356 static UnwindAssemblyInstances g_instances;
1357 return g_instances;
1358}
1359
1361 llvm::StringRef name, llvm::StringRef description,
1362 UnwindAssemblyCreateInstance create_callback) {
1363 return GetUnwindAssemblyInstances().RegisterPlugin(name, description,
1364 create_callback);
1365}
1366
1368 UnwindAssemblyCreateInstance create_callback) {
1369 return GetUnwindAssemblyInstances().UnregisterPlugin(create_callback);
1370}
1371
1375}
1376
1377#pragma mark MemoryHistory
1378
1381
1383 static MemoryHistoryInstances g_instances;
1384 return g_instances;
1385}
1386
1388 llvm::StringRef name, llvm::StringRef description,
1389 MemoryHistoryCreateInstance create_callback) {
1390 return GetMemoryHistoryInstances().RegisterPlugin(name, description,
1391 create_callback);
1392}
1393
1395 MemoryHistoryCreateInstance create_callback) {
1396 return GetMemoryHistoryInstances().UnregisterPlugin(create_callback);
1397}
1398
1402}
1403
1404#pragma mark InstrumentationRuntime
1405
1407 : public PluginInstance<InstrumentationRuntimeCreateInstance> {
1409 llvm::StringRef name, llvm::StringRef description,
1410 CallbackType create_callback,
1411 InstrumentationRuntimeGetType get_type_callback)
1413 create_callback),
1414 get_type_callback(get_type_callback) {}
1415
1416 InstrumentationRuntimeGetType get_type_callback = nullptr;
1417};
1418
1421
1423 static InstrumentationRuntimeInstances g_instances;
1424 return g_instances;
1425}
1426
1428 llvm::StringRef name, llvm::StringRef description,
1430 InstrumentationRuntimeGetType get_type_callback) {
1432 name, description, create_callback, get_type_callback);
1433}
1434
1436 InstrumentationRuntimeCreateInstance create_callback) {
1437 return GetInstrumentationRuntimeInstances().UnregisterPlugin(create_callback);
1438}
1439
1442 const auto &instances = GetInstrumentationRuntimeInstances().GetInstances();
1443 if (idx < instances.size())
1444 return instances[idx].get_type_callback;
1445 return nullptr;
1446}
1447
1451}
1452
1453#pragma mark TypeSystem
1454
1455struct TypeSystemInstance : public PluginInstance<TypeSystemCreateInstance> {
1456 TypeSystemInstance(llvm::StringRef name, llvm::StringRef description,
1457 CallbackType create_callback,
1458 LanguageSet supported_languages_for_types,
1459 LanguageSet supported_languages_for_expressions)
1460 : PluginInstance<TypeSystemCreateInstance>(name, description,
1461 create_callback),
1462 supported_languages_for_types(supported_languages_for_types),
1463 supported_languages_for_expressions(
1464 supported_languages_for_expressions) {}
1465
1468};
1469
1471
1473 static TypeSystemInstances g_instances;
1474 return g_instances;
1475}
1476
1478 llvm::StringRef name, llvm::StringRef description,
1479 TypeSystemCreateInstance create_callback,
1480 LanguageSet supported_languages_for_types,
1481 LanguageSet supported_languages_for_expressions) {
1483 name, description, create_callback, supported_languages_for_types,
1484 supported_languages_for_expressions);
1485}
1486
1488 return GetTypeSystemInstances().UnregisterPlugin(create_callback);
1489}
1490
1494}
1495
1497 const auto &instances = GetTypeSystemInstances().GetInstances();
1498 LanguageSet all;
1499 for (unsigned i = 0; i < instances.size(); ++i)
1500 all.bitvector |= instances[i].supported_languages_for_types.bitvector;
1501 return all;
1502}
1503
1505 const auto &instances = GetTypeSystemInstances().GetInstances();
1506 LanguageSet all;
1507 for (unsigned i = 0; i < instances.size(); ++i)
1508 all.bitvector |= instances[i].supported_languages_for_expressions.bitvector;
1509 return all;
1510}
1511
1512#pragma mark ScriptedInterfaces
1513
1515 : public PluginInstance<ScriptedInterfaceCreateInstance> {
1516 ScriptedInterfaceInstance(llvm::StringRef name, llvm::StringRef description,
1517 ScriptedInterfaceCreateInstance create_callback,
1518 lldb::ScriptLanguage language,
1521 create_callback),
1522 language(language), usages(usages) {}
1523
1526};
1527
1529
1531 static ScriptedInterfaceInstances g_instances;
1532 return g_instances;
1533}
1534
1536 llvm::StringRef name, llvm::StringRef description,
1537 ScriptedInterfaceCreateInstance create_callback,
1540 name, description, create_callback, language, usages);
1541}
1542
1544 ScriptedInterfaceCreateInstance create_callback) {
1545 return GetScriptedInterfaceInstances().UnregisterPlugin(create_callback);
1546}
1547
1550}
1551
1552llvm::StringRef PluginManager::GetScriptedInterfaceNameAtIndex(uint32_t index) {
1554}
1555
1556llvm::StringRef
1559}
1560
1563 const auto &instances = GetScriptedInterfaceInstances().GetInstances();
1564 return idx < instances.size() ? instances[idx].language
1565 : ScriptLanguage::eScriptLanguageNone;
1566}
1567
1570 const auto &instances = GetScriptedInterfaceInstances().GetInstances();
1571 if (idx >= instances.size())
1572 return {};
1573 return instances[idx].usages;
1574}
1575
1576#pragma mark REPL
1577
1578struct REPLInstance : public PluginInstance<REPLCreateInstance> {
1579 REPLInstance(llvm::StringRef name, llvm::StringRef description,
1580 CallbackType create_callback, LanguageSet supported_languages)
1581 : PluginInstance<REPLCreateInstance>(name, description, create_callback),
1582 supported_languages(supported_languages) {}
1583
1585};
1586
1588
1590 static REPLInstances g_instances;
1591 return g_instances;
1592}
1593
1594bool PluginManager::RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
1595 REPLCreateInstance create_callback,
1596 LanguageSet supported_languages) {
1597 return GetREPLInstances().RegisterPlugin(name, description, create_callback,
1598 supported_languages);
1599}
1600
1602 return GetREPLInstances().UnregisterPlugin(create_callback);
1603}
1604
1607}
1608
1610 const auto &instances = GetREPLInstances().GetInstances();
1611 return idx < instances.size() ? instances[idx].supported_languages
1612 : LanguageSet();
1613}
1614
1616 const auto &instances = GetREPLInstances().GetInstances();
1617 LanguageSet all;
1618 for (unsigned i = 0; i < instances.size(); ++i)
1619 all.bitvector |= instances[i].supported_languages.bitvector;
1620 return all;
1621}
1622
1623#pragma mark PluginManager
1624
1637}
1638
1639// This is the preferred new way to register plugin specific settings. e.g.
1640// This will put a plugin's settings under e.g.
1641// "plugin.<plugin_type_name>.<plugin_type_desc>.SETTINGNAME".
1643GetDebuggerPropertyForPlugins(Debugger &debugger, llvm::StringRef plugin_type_name,
1644 llvm::StringRef plugin_type_desc,
1645 bool can_create) {
1646 lldb::OptionValuePropertiesSP parent_properties_sp(
1647 debugger.GetValueProperties());
1648 if (parent_properties_sp) {
1649 static constexpr llvm::StringLiteral g_property_name("plugin");
1650
1651 OptionValuePropertiesSP plugin_properties_sp =
1652 parent_properties_sp->GetSubProperty(nullptr, g_property_name);
1653 if (!plugin_properties_sp && can_create) {
1654 plugin_properties_sp =
1655 std::make_shared<OptionValueProperties>(g_property_name);
1656 parent_properties_sp->AppendProperty(g_property_name,
1657 "Settings specify to plugins.", true,
1658 plugin_properties_sp);
1659 }
1660
1661 if (plugin_properties_sp) {
1662 lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1663 plugin_properties_sp->GetSubProperty(nullptr, plugin_type_name);
1664 if (!plugin_type_properties_sp && can_create) {
1665 plugin_type_properties_sp =
1666 std::make_shared<OptionValueProperties>(plugin_type_name);
1667 plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1668 true, plugin_type_properties_sp);
1669 }
1670 return plugin_type_properties_sp;
1671 }
1672 }
1674}
1675
1676// This is deprecated way to register plugin specific settings. e.g.
1677// "<plugin_type_name>.plugin.<plugin_type_desc>.SETTINGNAME" and Platform
1678// generic settings would be under "platform.SETTINGNAME".
1680 Debugger &debugger, llvm::StringRef plugin_type_name,
1681 llvm::StringRef plugin_type_desc, bool can_create) {
1682 static constexpr llvm::StringLiteral g_property_name("plugin");
1683 lldb::OptionValuePropertiesSP parent_properties_sp(
1684 debugger.GetValueProperties());
1685 if (parent_properties_sp) {
1686 OptionValuePropertiesSP plugin_properties_sp =
1687 parent_properties_sp->GetSubProperty(nullptr, plugin_type_name);
1688 if (!plugin_properties_sp && can_create) {
1689 plugin_properties_sp =
1690 std::make_shared<OptionValueProperties>(plugin_type_name);
1691 parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1692 true, plugin_properties_sp);
1693 }
1694
1695 if (plugin_properties_sp) {
1696 lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1697 plugin_properties_sp->GetSubProperty(nullptr, g_property_name);
1698 if (!plugin_type_properties_sp && can_create) {
1699 plugin_type_properties_sp =
1700 std::make_shared<OptionValueProperties>(g_property_name);
1701 plugin_properties_sp->AppendProperty(g_property_name,
1702 "Settings specific to plugins",
1703 true, plugin_type_properties_sp);
1704 }
1705 return plugin_type_properties_sp;
1706 }
1707 }
1709}
1710
1711namespace {
1712
1714GetDebuggerPropertyForPluginsPtr(Debugger &, llvm::StringRef, llvm::StringRef,
1715 bool can_create);
1716}
1717
1719GetSettingForPlugin(Debugger &debugger, llvm::StringRef setting_name,
1720 llvm::StringRef plugin_type_name,
1721 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1723 lldb::OptionValuePropertiesSP properties_sp;
1724 lldb::OptionValuePropertiesSP plugin_type_properties_sp(get_debugger_property(
1725 debugger, plugin_type_name,
1726 "", // not creating to so we don't need the description
1727 false));
1728 if (plugin_type_properties_sp)
1729 properties_sp =
1730 plugin_type_properties_sp->GetSubProperty(nullptr, setting_name);
1731 return properties_sp;
1732}
1733
1734static bool
1735CreateSettingForPlugin(Debugger &debugger, llvm::StringRef plugin_type_name,
1736 llvm::StringRef plugin_type_desc,
1737 const lldb::OptionValuePropertiesSP &properties_sp,
1738 llvm::StringRef description, bool is_global_property,
1739 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1741 if (properties_sp) {
1742 lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1743 get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
1744 true));
1745 if (plugin_type_properties_sp) {
1746 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1747 description, is_global_property,
1748 properties_sp);
1749 return true;
1750 }
1751 }
1752 return false;
1753}
1754
1755static constexpr llvm::StringLiteral kDynamicLoaderPluginName("dynamic-loader");
1756static constexpr llvm::StringLiteral kPlatformPluginName("platform");
1757static constexpr llvm::StringLiteral kProcessPluginName("process");
1758static constexpr llvm::StringLiteral kTracePluginName("trace");
1759static constexpr llvm::StringLiteral kObjectFilePluginName("object-file");
1760static constexpr llvm::StringLiteral kSymbolFilePluginName("symbol-file");
1761static constexpr llvm::StringLiteral kSymbolLocatorPluginName("symbol-locator");
1762static constexpr llvm::StringLiteral kJITLoaderPluginName("jit-loader");
1763static constexpr llvm::StringLiteral
1764 kStructuredDataPluginName("structured-data");
1765
1768 llvm::StringRef setting_name) {
1769 return GetSettingForPlugin(debugger, setting_name, kDynamicLoaderPluginName);
1770}
1771
1773 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1774 llvm::StringRef description, bool is_global_property) {
1776 "Settings for dynamic loader plug-ins",
1777 properties_sp, description, is_global_property);
1778}
1779
1782 llvm::StringRef setting_name) {
1783 return GetSettingForPlugin(debugger, setting_name, kPlatformPluginName,
1785}
1786
1788 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1789 llvm::StringRef description, bool is_global_property) {
1791 "Settings for platform plug-ins", properties_sp,
1792 description, is_global_property,
1794}
1795
1798 llvm::StringRef setting_name) {
1799 return GetSettingForPlugin(debugger, setting_name, kProcessPluginName);
1800}
1801
1803 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1804 llvm::StringRef description, bool is_global_property) {
1806 "Settings for process plug-ins", properties_sp,
1807 description, is_global_property);
1808}
1809
1812 llvm::StringRef setting_name) {
1813 return GetSettingForPlugin(debugger, setting_name, kSymbolLocatorPluginName);
1814}
1815
1817 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1818 llvm::StringRef description, bool is_global_property) {
1820 "Settings for symbol locator plug-ins",
1821 properties_sp, description, is_global_property);
1822}
1823
1825 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1826 llvm::StringRef description, bool is_global_property) {
1828 "Settings for trace plug-ins", properties_sp,
1829 description, is_global_property);
1830}
1831
1834 llvm::StringRef setting_name) {
1835 return GetSettingForPlugin(debugger, setting_name, kObjectFilePluginName);
1836}
1837
1839 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1840 llvm::StringRef description, bool is_global_property) {
1842 "Settings for object file plug-ins",
1843 properties_sp, description, is_global_property);
1844}
1845
1848 llvm::StringRef setting_name) {
1849 return GetSettingForPlugin(debugger, setting_name, kSymbolFilePluginName);
1850}
1851
1853 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1854 llvm::StringRef description, bool is_global_property) {
1856 "Settings for symbol file plug-ins",
1857 properties_sp, description, is_global_property);
1858}
1859
1862 llvm::StringRef setting_name) {
1863 return GetSettingForPlugin(debugger, setting_name, kJITLoaderPluginName);
1864}
1865
1867 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1868 llvm::StringRef description, bool is_global_property) {
1870 "Settings for JIT loader plug-ins",
1871 properties_sp, description, is_global_property);
1872}
1873
1874static const char *kOperatingSystemPluginName("os");
1875
1878 llvm::StringRef setting_name) {
1879 lldb::OptionValuePropertiesSP properties_sp;
1880 lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1883 "", // not creating to so we don't need the description
1884 false));
1885 if (plugin_type_properties_sp)
1886 properties_sp =
1887 plugin_type_properties_sp->GetSubProperty(nullptr, setting_name);
1888 return properties_sp;
1889}
1890
1892 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1893 llvm::StringRef description, bool is_global_property) {
1894 if (properties_sp) {
1895 lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1897 "Settings for operating system plug-ins",
1898 true));
1899 if (plugin_type_properties_sp) {
1900 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1901 description, is_global_property,
1902 properties_sp);
1903 return true;
1904 }
1905 }
1906 return false;
1907}
1908
1911 llvm::StringRef setting_name) {
1912 return GetSettingForPlugin(debugger, setting_name, kStructuredDataPluginName);
1913}
1914
1916 Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1917 llvm::StringRef description, bool is_global_property) {
1919 "Settings for structured data plug-ins",
1920 properties_sp, description, is_global_property);
1921}
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: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:44
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)()
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:385
std::shared_ptr< lldb_private::ScriptInterpreter > ScriptInterpreterSP
Definition: lldb-forward.h:404
std::shared_ptr< lldb_private::RegisterTypeBuilder > RegisterTypeBuilderSP
Definition: lldb-forward.h:394
std::shared_ptr< lldb_private::Process > ProcessSP
Definition: lldb-forward.h:387
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