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"
12 #include "lldb/Host/FileSystem.h"
13 #include "lldb/Host/HostInfo.h"
15 #include "lldb/Target/Process.h"
17 #include "lldb/Utility/FileSpec.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 
35 using namespace lldb;
36 using namespace lldb_private;
37 
38 typedef bool (*PluginInitCallback)();
39 typedef void (*PluginTermCallback)();
40 
41 struct PluginInfo {
42  PluginInfo() = default;
43 
44  llvm::sys::DynamicLibrary library;
45  PluginInitCallback plugin_init_callback = nullptr;
46  PluginTermCallback plugin_term_callback = nullptr;
47 };
48 
49 typedef std::map<FileSpec, PluginInfo> PluginTerminateMap;
50 
51 static 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 
61 static 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 
67 static 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 
75 template <typename FPtrTy> static FPtrTy CastToFPtr(void *VPtr) {
76  return reinterpret_cast<FPtrTy>(VPtr);
77 }
78 
80 LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,
81  llvm::StringRef path) {
82  Status error;
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))
95  return FileSystem::eEnumerateDirectoryResultNext;
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 
127  return FileSystem::eEnumerateDirectoryResultNext;
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.
138  return FileSystem::eEnumerateDirectoryResultEnter;
139  }
140 
141  return FileSystem::eEnumerateDirectoryResultNext;
142 }
143 
144 void PluginManager::Initialize() {
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 
168 void PluginManager::Terminate() {
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 
184 template <typename Callback> struct PluginInstance {
185  typedef Callback CallbackType;
186 
187  PluginInstance() = default;
189  Callback create_callback = nullptr,
190  DebuggerInitializeCallback debugger_init_callback = nullptr)
191  : name(name), description(std::move(description)),
192  create_callback(create_callback),
193  debugger_init_callback(debugger_init_callback) {}
194 
197  Callback create_callback;
199 };
200 
201 template <typename Instance> class PluginInstances {
202 public:
203  template <typename... Args>
204  bool RegisterPlugin(ConstString name, const char *description,
205  typename Instance::CallbackType callback,
206  Args &&... args) {
207  if (!callback)
208  return false;
209  assert((bool)name);
210  Instance instance =
211  Instance(name, description, callback, std::forward<Args>(args)...);
212  m_instances.push_back(instance);
213  return false;
214  }
215 
216  bool UnregisterPlugin(typename Instance::CallbackType callback) {
217  if (!callback)
218  return false;
219  auto pos = m_instances.begin();
220  auto end = m_instances.end();
221  for (; pos != end; ++pos) {
222  if (pos->create_callback == callback) {
223  m_instances.erase(pos);
224  return true;
225  }
226  }
227  return false;
228  }
229 
230  typename Instance::CallbackType GetCallbackAtIndex(uint32_t idx) {
231  if (Instance *instance = GetInstanceAtIndex(idx))
232  return instance->create_callback;
233  return nullptr;
234  }
235 
236  const char *GetDescriptionAtIndex(uint32_t idx) {
237  if (Instance *instance = GetInstanceAtIndex(idx))
238  return instance->description.c_str();
239  return nullptr;
240  }
241 
242  const char *GetNameAtIndex(uint32_t idx) {
243  if (Instance *instance = GetInstanceAtIndex(idx))
244  return instance->name.GetCString();
245  return nullptr;
246  }
247 
248  typename Instance::CallbackType GetCallbackForName(ConstString name) {
249  if (!name)
250  return nullptr;
251  for (auto &instance : m_instances) {
252  if (name == instance.name)
253  return instance.create_callback;
254  }
255  return nullptr;
256  }
257 
259  for (auto &instance : m_instances) {
260  if (instance.debugger_init_callback)
261  instance.debugger_init_callback(debugger);
262  }
263  }
264 
265  const std::vector<Instance> &GetInstances() const { return m_instances; }
266  std::vector<Instance> &GetInstances() { return m_instances; }
267 
268  Instance *GetInstanceAtIndex(uint32_t idx) {
269  if (idx < m_instances.size())
270  return &m_instances[idx];
271  return nullptr;
272  }
273 
274 private:
275  std::vector<Instance> m_instances;
276 };
277 
278 #pragma mark ABI
279 
282 
284  static ABIInstances g_instances;
285  return g_instances;
286 }
287 
288 bool PluginManager::RegisterPlugin(ConstString name, const char *description,
289  ABICreateInstance create_callback) {
290  return GetABIInstances().RegisterPlugin(name, description, create_callback);
291 }
292 
293 bool PluginManager::UnregisterPlugin(ABICreateInstance create_callback) {
294  return GetABIInstances().UnregisterPlugin(create_callback);
295 }
296 
297 ABICreateInstance PluginManager::GetABICreateCallbackAtIndex(uint32_t idx) {
298  return GetABIInstances().GetCallbackAtIndex(idx);
299 }
300 
301 #pragma mark Architecture
302 
304 typedef std::vector<ArchitectureInstance> ArchitectureInstances;
305 
307  static ArchitectureInstances g_instances;
308  return g_instances;
309 }
310 
311 void PluginManager::RegisterPlugin(ConstString name,
312  llvm::StringRef description,
313  ArchitectureCreateInstance create_callback) {
314  GetArchitectureInstances().push_back(
315  {name, std::string(description), create_callback});
316 }
317 
318 void PluginManager::UnregisterPlugin(
319  ArchitectureCreateInstance create_callback) {
320  auto &instances = GetArchitectureInstances();
321 
322  for (auto pos = instances.begin(), end = instances.end(); pos != end; ++pos) {
323  if (pos->create_callback == create_callback) {
324  instances.erase(pos);
325  return;
326  }
327  }
328  llvm_unreachable("Plugin not found");
329 }
330 
331 std::unique_ptr<Architecture>
332 PluginManager::CreateArchitectureInstance(const ArchSpec &arch) {
333  for (const auto &instances : GetArchitectureInstances()) {
334  if (auto plugin_up = instances.create_callback(arch))
335  return plugin_up;
336  }
337  return nullptr;
338 }
339 
340 #pragma mark Disassembler
341 
344 
346  static DisassemblerInstances g_instances;
347  return g_instances;
348 }
349 
350 bool PluginManager::RegisterPlugin(ConstString name, const char *description,
351  DisassemblerCreateInstance create_callback) {
352  return GetDisassemblerInstances().RegisterPlugin(name, description,
353  create_callback);
354 }
355 
356 bool PluginManager::UnregisterPlugin(
357  DisassemblerCreateInstance create_callback) {
358  return GetDisassemblerInstances().UnregisterPlugin(create_callback);
359 }
360 
361 DisassemblerCreateInstance
362 PluginManager::GetDisassemblerCreateCallbackAtIndex(uint32_t idx) {
364 }
365 
366 DisassemblerCreateInstance
367 PluginManager::GetDisassemblerCreateCallbackForPluginName(ConstString name) {
369 }
370 
371 #pragma mark DynamicLoader
372 
375 
377  static DynamicLoaderInstances g_instances;
378  return g_instances;
379 }
380 
381 bool PluginManager::RegisterPlugin(
382  ConstString name, const char *description,
383  DynamicLoaderCreateInstance create_callback,
384  DebuggerInitializeCallback debugger_init_callback) {
386  name, description, create_callback, debugger_init_callback);
387 }
388 
389 bool PluginManager::UnregisterPlugin(
390  DynamicLoaderCreateInstance create_callback) {
391  return GetDynamicLoaderInstances().UnregisterPlugin(create_callback);
392 }
393 
394 DynamicLoaderCreateInstance
395 PluginManager::GetDynamicLoaderCreateCallbackAtIndex(uint32_t idx) {
397 }
398 
399 DynamicLoaderCreateInstance
400 PluginManager::GetDynamicLoaderCreateCallbackForPluginName(ConstString name) {
402 }
403 
404 #pragma mark JITLoader
405 
408 
410  static JITLoaderInstances g_instances;
411  return g_instances;
412 }
413 
414 bool PluginManager::RegisterPlugin(
415  ConstString name, const char *description,
416  JITLoaderCreateInstance create_callback,
417  DebuggerInitializeCallback debugger_init_callback) {
419  name, description, create_callback, debugger_init_callback);
420 }
421 
422 bool PluginManager::UnregisterPlugin(JITLoaderCreateInstance create_callback) {
423  return GetJITLoaderInstances().UnregisterPlugin(create_callback);
424 }
425 
426 JITLoaderCreateInstance
427 PluginManager::GetJITLoaderCreateCallbackAtIndex(uint32_t idx) {
429 }
430 
431 #pragma mark EmulateInstruction
432 
436 
438  static EmulateInstructionInstances g_instances;
439  return g_instances;
440 }
441 
442 bool PluginManager::RegisterPlugin(
443  ConstString name, const char *description,
444  EmulateInstructionCreateInstance create_callback) {
445  return GetEmulateInstructionInstances().RegisterPlugin(name, description,
446  create_callback);
447 }
448 
449 bool PluginManager::UnregisterPlugin(
450  EmulateInstructionCreateInstance create_callback) {
451  return GetEmulateInstructionInstances().UnregisterPlugin(create_callback);
452 }
453 
454 EmulateInstructionCreateInstance
455 PluginManager::GetEmulateInstructionCreateCallbackAtIndex(uint32_t idx) {
457 }
458 
459 EmulateInstructionCreateInstance
460 PluginManager::GetEmulateInstructionCreateCallbackForPluginName(
461  ConstString name) {
463 }
464 
465 #pragma mark OperatingSystem
466 
469 
471  static OperatingSystemInstances g_instances;
472  return g_instances;
473 }
474 
475 bool PluginManager::RegisterPlugin(
476  ConstString name, const char *description,
477  OperatingSystemCreateInstance create_callback,
478  DebuggerInitializeCallback debugger_init_callback) {
480  name, description, create_callback, debugger_init_callback);
481 }
482 
483 bool PluginManager::UnregisterPlugin(
484  OperatingSystemCreateInstance create_callback) {
485  return GetOperatingSystemInstances().UnregisterPlugin(create_callback);
486 }
487 
488 OperatingSystemCreateInstance
489 PluginManager::GetOperatingSystemCreateCallbackAtIndex(uint32_t idx) {
491 }
492 
493 OperatingSystemCreateInstance
494 PluginManager::GetOperatingSystemCreateCallbackForPluginName(ConstString name) {
496 }
497 
498 #pragma mark Language
499 
502 
504  static LanguageInstances g_instances;
505  return g_instances;
506 }
507 
508 bool PluginManager::RegisterPlugin(ConstString name, const char *description,
509  LanguageCreateInstance create_callback) {
510  return GetLanguageInstances().RegisterPlugin(name, description,
511  create_callback);
512 }
513 
514 bool PluginManager::UnregisterPlugin(LanguageCreateInstance create_callback) {
515  return GetLanguageInstances().UnregisterPlugin(create_callback);
516 }
517 
518 LanguageCreateInstance
519 PluginManager::GetLanguageCreateCallbackAtIndex(uint32_t idx) {
521 }
522 
523 #pragma mark LanguageRuntime
524 
526  : public PluginInstance<LanguageRuntimeCreateInstance> {
528  ConstString name, std::string description, CallbackType create_callback,
529  DebuggerInitializeCallback debugger_init_callback,
530  LanguageRuntimeGetCommandObject command_callback,
531  LanguageRuntimeGetExceptionPrecondition precondition_callback)
533  name, std::move(description), create_callback,
534  debugger_init_callback),
535  command_callback(command_callback),
536  precondition_callback(precondition_callback) {}
537 
538  LanguageRuntimeGetCommandObject command_callback;
539  LanguageRuntimeGetExceptionPrecondition precondition_callback;
540 };
541 
543 
545  static LanguageRuntimeInstances g_instances;
546  return g_instances;
547 }
548 
549 bool PluginManager::RegisterPlugin(
550  ConstString name, const char *description,
551  LanguageRuntimeCreateInstance create_callback,
552  LanguageRuntimeGetCommandObject command_callback,
553  LanguageRuntimeGetExceptionPrecondition precondition_callback) {
555  name, description, create_callback, nullptr, command_callback,
556  precondition_callback);
557 }
558 
559 bool PluginManager::UnregisterPlugin(
560  LanguageRuntimeCreateInstance create_callback) {
561  return GetLanguageRuntimeInstances().UnregisterPlugin(create_callback);
562 }
563 
565 PluginManager::GetLanguageRuntimeCreateCallbackAtIndex(uint32_t idx) {
567 }
568 
569 LanguageRuntimeGetCommandObject
570 PluginManager::GetLanguageRuntimeGetCommandObjectAtIndex(uint32_t idx) {
571  const auto &instances = GetLanguageRuntimeInstances().GetInstances();
572  if (idx < instances.size())
573  return instances[idx].command_callback;
574  return nullptr;
575 }
576 
577 LanguageRuntimeGetExceptionPrecondition
578 PluginManager::GetLanguageRuntimeGetExceptionPreconditionAtIndex(uint32_t idx) {
579  const auto &instances = GetLanguageRuntimeInstances().GetInstances();
580  if (idx < instances.size())
581  return instances[idx].precondition_callback;
582  return nullptr;
583 }
584 
585 #pragma mark SystemRuntime
586 
589 
591  static SystemRuntimeInstances g_instances;
592  return g_instances;
593 }
594 
595 bool PluginManager::RegisterPlugin(
596  ConstString name, const char *description,
597  SystemRuntimeCreateInstance create_callback) {
598  return GetSystemRuntimeInstances().RegisterPlugin(name, description,
599  create_callback);
600 }
601 
602 bool PluginManager::UnregisterPlugin(
603  SystemRuntimeCreateInstance create_callback) {
604  return GetSystemRuntimeInstances().UnregisterPlugin(create_callback);
605 }
606 
607 SystemRuntimeCreateInstance
608 PluginManager::GetSystemRuntimeCreateCallbackAtIndex(uint32_t idx) {
610 }
611 
612 #pragma mark ObjectFile
613 
614 struct ObjectFileInstance : public PluginInstance<ObjectFileCreateInstance> {
616  ConstString name, std::string description, CallbackType create_callback,
617  ObjectFileCreateMemoryInstance create_memory_callback,
618  ObjectFileGetModuleSpecifications get_module_specifications,
619  ObjectFileSaveCore save_core)
620  : PluginInstance<ObjectFileCreateInstance>(name, std::move(description),
621  create_callback),
622  create_memory_callback(create_memory_callback),
623  get_module_specifications(get_module_specifications),
624  save_core(save_core) {}
625 
626  ObjectFileCreateMemoryInstance create_memory_callback;
627  ObjectFileGetModuleSpecifications get_module_specifications;
628  ObjectFileSaveCore save_core;
629 };
631 
633  static ObjectFileInstances g_instances;
634  return g_instances;
635 }
636 
637 bool PluginManager::RegisterPlugin(
638  ConstString name, const char *description,
639  ObjectFileCreateInstance create_callback,
640  ObjectFileCreateMemoryInstance create_memory_callback,
641  ObjectFileGetModuleSpecifications get_module_specifications,
642  ObjectFileSaveCore save_core) {
644  name, description, create_callback, create_memory_callback,
645  get_module_specifications, save_core);
646 }
647 
648 bool PluginManager::UnregisterPlugin(ObjectFileCreateInstance create_callback) {
649  return GetObjectFileInstances().UnregisterPlugin(create_callback);
650 }
651 
653 PluginManager::GetObjectFileCreateCallbackAtIndex(uint32_t idx) {
655 }
656 
657 ObjectFileCreateMemoryInstance
658 PluginManager::GetObjectFileCreateMemoryCallbackAtIndex(uint32_t idx) {
659  const auto &instances = GetObjectFileInstances().GetInstances();
660  if (idx < instances.size())
661  return instances[idx].create_memory_callback;
662  return nullptr;
663 }
664 
665 ObjectFileGetModuleSpecifications
666 PluginManager::GetObjectFileGetModuleSpecificationsCallbackAtIndex(
667  uint32_t idx) {
668  const auto &instances = GetObjectFileInstances().GetInstances();
669  if (idx < instances.size())
670  return instances[idx].get_module_specifications;
671  return nullptr;
672 }
673 
674 ObjectFileCreateMemoryInstance
675 PluginManager::GetObjectFileCreateMemoryCallbackForPluginName(
676  ConstString name) {
677  if (!name)
678  return nullptr;
679  const auto &instances = GetObjectFileInstances().GetInstances();
680  for (auto &instance : instances) {
681  if (instance.name == name)
682  return instance.create_memory_callback;
683  }
684  return nullptr;
685 }
686 
687 Status PluginManager::SaveCore(const lldb::ProcessSP &process_sp,
688  const FileSpec &outfile,
689  lldb::SaveCoreStyle &core_style,
690  const ConstString plugin_name) {
691  if (!plugin_name) {
692  // Try saving core directly from the process plugin first.
693  llvm::Expected<bool> ret = process_sp->SaveCore(outfile.GetPath());
694  if (!ret)
695  return Status(ret.takeError());
696  if (ret.get())
697  return Status();
698  }
699 
700  // Fall back to object plugins.
701  Status error;
702  auto &instances = GetObjectFileInstances().GetInstances();
703  for (auto &instance : instances) {
704  if (plugin_name && instance.name != plugin_name)
705  continue;
706  if (instance.save_core &&
707  instance.save_core(process_sp, outfile, core_style, error))
708  return error;
709  }
710  error.SetErrorString(
711  "no ObjectFile plugins were able to save a core for this process");
712  return error;
713 }
714 
715 #pragma mark ObjectContainer
716 
718  : public PluginInstance<ObjectContainerCreateInstance> {
720  ConstString name, std::string description, CallbackType create_callback,
721  ObjectFileGetModuleSpecifications get_module_specifications)
723  name, std::move(description), create_callback),
724  get_module_specifications(get_module_specifications) {}
725 
726  ObjectFileGetModuleSpecifications get_module_specifications;
727 };
729 
731  static ObjectContainerInstances g_instances;
732  return g_instances;
733 }
734 
735 bool PluginManager::RegisterPlugin(
736  ConstString name, const char *description,
737  ObjectContainerCreateInstance create_callback,
738  ObjectFileGetModuleSpecifications get_module_specifications) {
740  name, description, create_callback, get_module_specifications);
741 }
742 
743 bool PluginManager::UnregisterPlugin(
744  ObjectContainerCreateInstance create_callback) {
745  return GetObjectContainerInstances().UnregisterPlugin(create_callback);
746 }
747 
749 PluginManager::GetObjectContainerCreateCallbackAtIndex(uint32_t idx) {
751 }
752 
753 ObjectFileGetModuleSpecifications
754 PluginManager::GetObjectContainerGetModuleSpecificationsCallbackAtIndex(
755  uint32_t idx) {
756  const auto &instances = GetObjectContainerInstances().GetInstances();
757  if (idx < instances.size())
758  return instances[idx].get_module_specifications;
759  return nullptr;
760 }
761 
762 #pragma mark Platform
763 
766 
768  static PlatformInstances g_platform_instances;
769  return g_platform_instances;
770 }
771 
772 bool PluginManager::RegisterPlugin(
773  ConstString name, const char *description,
774  PlatformCreateInstance create_callback,
775  DebuggerInitializeCallback debugger_init_callback) {
777  name, description, create_callback, debugger_init_callback);
778 }
779 
780 bool PluginManager::UnregisterPlugin(PlatformCreateInstance create_callback) {
781  return GetPlatformInstances().UnregisterPlugin(create_callback);
782 }
783 
784 const char *PluginManager::GetPlatformPluginNameAtIndex(uint32_t idx) {
785  return GetPlatformInstances().GetNameAtIndex(idx);
786 }
787 
788 const char *PluginManager::GetPlatformPluginDescriptionAtIndex(uint32_t idx) {
790 }
791 
792 PlatformCreateInstance
793 PluginManager::GetPlatformCreateCallbackAtIndex(uint32_t idx) {
795 }
796 
797 PlatformCreateInstance
798 PluginManager::GetPlatformCreateCallbackForPluginName(ConstString name) {
800 }
801 
802 void PluginManager::AutoCompletePlatformName(llvm::StringRef name,
803  CompletionRequest &request) {
804  for (const auto &instance : GetPlatformInstances().GetInstances()) {
805  if (instance.name.GetStringRef().startswith(name))
806  request.AddCompletion(instance.name.GetCString());
807  }
808 }
809 
810 #pragma mark Process
811 
814 
816  static ProcessInstances g_instances;
817  return g_instances;
818 }
819 
820 bool PluginManager::RegisterPlugin(
821  ConstString name, const char *description,
822  ProcessCreateInstance create_callback,
823  DebuggerInitializeCallback debugger_init_callback) {
825  name, description, create_callback, debugger_init_callback);
826 }
827 
828 bool PluginManager::UnregisterPlugin(ProcessCreateInstance create_callback) {
829  return GetProcessInstances().UnregisterPlugin(create_callback);
830 }
831 
832 const char *PluginManager::GetProcessPluginNameAtIndex(uint32_t idx) {
833  return GetProcessInstances().GetNameAtIndex(idx);
834 }
835 
836 const char *PluginManager::GetProcessPluginDescriptionAtIndex(uint32_t idx) {
838 }
839 
840 ProcessCreateInstance
841 PluginManager::GetProcessCreateCallbackAtIndex(uint32_t idx) {
843 }
844 
845 ProcessCreateInstance
846 PluginManager::GetProcessCreateCallbackForPluginName(ConstString name) {
848 }
849 
850 void PluginManager::AutoCompleteProcessName(llvm::StringRef name,
851  CompletionRequest &request) {
852  for (const auto &instance : GetProcessInstances().GetInstances()) {
853  if (instance.name.GetStringRef().startswith(name))
854  request.AddCompletion(instance.name.GetCString(), instance.description);
855  }
856 }
857 
858 #pragma mark ScriptInterpreter
859 
861  : public PluginInstance<ScriptInterpreterCreateInstance> {
863  CallbackType create_callback,
864  lldb::ScriptLanguage language)
866  name, std::move(description), create_callback),
867  language(language) {}
868 
870 };
871 
873 
875  static ScriptInterpreterInstances g_instances;
876  return g_instances;
877 }
878 
879 bool PluginManager::RegisterPlugin(
880  ConstString name, const char *description,
881  lldb::ScriptLanguage script_language,
882  ScriptInterpreterCreateInstance create_callback) {
884  name, description, create_callback, script_language);
885 }
886 
887 bool PluginManager::UnregisterPlugin(
888  ScriptInterpreterCreateInstance create_callback) {
889  return GetScriptInterpreterInstances().UnregisterPlugin(create_callback);
890 }
891 
893 PluginManager::GetScriptInterpreterCreateCallbackAtIndex(uint32_t idx) {
895 }
896 
897 lldb::ScriptInterpreterSP
898 PluginManager::GetScriptInterpreterForLanguage(lldb::ScriptLanguage script_lang,
899  Debugger &debugger) {
900  const auto &instances = GetScriptInterpreterInstances().GetInstances();
901  ScriptInterpreterCreateInstance none_instance = nullptr;
902  for (const auto &instance : instances) {
903  if (instance.language == lldb::eScriptLanguageNone)
904  none_instance = instance.create_callback;
905 
906  if (script_lang == instance.language)
907  return instance.create_callback(debugger);
908  }
909 
910  // If we didn't find one, return the ScriptInterpreter for the null language.
911  assert(none_instance != nullptr);
912  return none_instance(debugger);
913 }
914 
915 #pragma mark StructuredDataPlugin
916 
918  : public PluginInstance<StructuredDataPluginCreateInstance> {
920  ConstString name, std::string description, CallbackType create_callback,
921  DebuggerInitializeCallback debugger_init_callback,
922  StructuredDataFilterLaunchInfo filter_callback)
924  name, std::move(description), create_callback,
925  debugger_init_callback),
926  filter_callback(filter_callback) {}
927 
928  StructuredDataFilterLaunchInfo filter_callback = nullptr;
929 };
930 
933 
935  static StructuredDataPluginInstances g_instances;
936  return g_instances;
937 }
938 
939 bool PluginManager::RegisterPlugin(
940  ConstString name, const char *description,
941  StructuredDataPluginCreateInstance create_callback,
942  DebuggerInitializeCallback debugger_init_callback,
943  StructuredDataFilterLaunchInfo filter_callback) {
945  name, description, create_callback, debugger_init_callback,
946  filter_callback);
947 }
948 
949 bool PluginManager::UnregisterPlugin(
950  StructuredDataPluginCreateInstance create_callback) {
951  return GetStructuredDataPluginInstances().UnregisterPlugin(create_callback);
952 }
953 
955 PluginManager::GetStructuredDataPluginCreateCallbackAtIndex(uint32_t idx) {
957 }
958 
959 StructuredDataFilterLaunchInfo
960 PluginManager::GetStructuredDataFilterCallbackAtIndex(
961  uint32_t idx, bool &iteration_complete) {
962  const auto &instances = GetStructuredDataPluginInstances().GetInstances();
963  if (idx < instances.size()) {
964  iteration_complete = false;
965  return instances[idx].filter_callback;
966  } else {
967  iteration_complete = true;
968  }
969  return nullptr;
970 }
971 
972 #pragma mark SymbolFile
973 
976 
978  static SymbolFileInstances g_instances;
979  return g_instances;
980 }
981 
982 bool PluginManager::RegisterPlugin(
983  ConstString name, const char *description,
984  SymbolFileCreateInstance create_callback,
985  DebuggerInitializeCallback debugger_init_callback) {
987  name, description, create_callback, debugger_init_callback);
988 }
989 
990 bool PluginManager::UnregisterPlugin(SymbolFileCreateInstance create_callback) {
991  return GetSymbolFileInstances().UnregisterPlugin(create_callback);
992 }
993 
994 SymbolFileCreateInstance
995 PluginManager::GetSymbolFileCreateCallbackAtIndex(uint32_t idx) {
997 }
998 
999 #pragma mark SymbolVendor
1000 
1003 
1005  static SymbolVendorInstances g_instances;
1006  return g_instances;
1007 }
1008 
1009 bool PluginManager::RegisterPlugin(ConstString name, const char *description,
1010  SymbolVendorCreateInstance create_callback) {
1011  return GetSymbolVendorInstances().RegisterPlugin(name, description,
1012  create_callback);
1013 }
1014 
1015 bool PluginManager::UnregisterPlugin(
1016  SymbolVendorCreateInstance create_callback) {
1017  return GetSymbolVendorInstances().UnregisterPlugin(create_callback);
1018 }
1019 
1020 SymbolVendorCreateInstance
1021 PluginManager::GetSymbolVendorCreateCallbackAtIndex(uint32_t idx) {
1023 }
1024 
1025 #pragma mark Trace
1026 
1028  : public PluginInstance<TraceCreateInstanceForSessionFile> {
1030  ConstString name, std::string description,
1031  CallbackType create_callback_for_session_file,
1032  TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1033  llvm::StringRef schema)
1035  name, std::move(description), create_callback_for_session_file),
1036  schema(schema),
1037  create_callback_for_live_process(create_callback_for_live_process) {}
1038 
1039  llvm::StringRef schema;
1040  TraceCreateInstanceForLiveProcess create_callback_for_live_process;
1041 };
1042 
1044 
1046  static TraceInstances g_instances;
1047  return g_instances;
1048 }
1049 
1050 bool PluginManager::RegisterPlugin(
1051  ConstString name, const char *description,
1052  TraceCreateInstanceForSessionFile create_callback_for_session_file,
1053  TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1054  llvm::StringRef schema) {
1056  name, description, create_callback_for_session_file,
1057  create_callback_for_live_process, schema);
1058 }
1059 
1060 bool PluginManager::UnregisterPlugin(
1061  TraceCreateInstanceForSessionFile create_callback_for_session_file) {
1063  create_callback_for_session_file);
1064 }
1065 
1067 PluginManager::GetTraceCreateCallback(ConstString plugin_name) {
1068  return GetTracePluginInstances().GetCallbackForName(plugin_name);
1069 }
1070 
1071 TraceCreateInstanceForLiveProcess
1072 PluginManager::GetTraceCreateCallbackForLiveProcess(ConstString plugin_name) {
1073  for (const TraceInstance &instance : GetTracePluginInstances().GetInstances())
1074  if (instance.name == plugin_name)
1075  return instance.create_callback_for_live_process;
1076  return nullptr;
1077 }
1078 
1079 llvm::StringRef PluginManager::GetTraceSchema(ConstString plugin_name) {
1080  for (const TraceInstance &instance : GetTracePluginInstances().GetInstances())
1081  if (instance.name == plugin_name)
1082  return instance.schema;
1083  return llvm::StringRef();
1084 }
1085 
1086 llvm::StringRef PluginManager::GetTraceSchema(size_t index) {
1087  if (TraceInstance *instance =
1088  GetTracePluginInstances().GetInstanceAtIndex(index))
1089  return instance->schema;
1090  return llvm::StringRef();
1091 }
1092 
1093 #pragma mark TraceExporter
1094 
1096  : public PluginInstance<TraceExporterCreateInstance> {
1098  ConstString name, std::string description,
1099  TraceExporterCreateInstance create_instance,
1100  ThreadTraceExportCommandCreator create_thread_trace_export_command)
1102  name, std::move(description), create_instance),
1103  create_thread_trace_export_command(create_thread_trace_export_command) {
1104  }
1105 
1106  ThreadTraceExportCommandCreator create_thread_trace_export_command;
1107 };
1108 
1110 
1112  static TraceExporterInstances g_instances;
1113  return g_instances;
1114 }
1115 
1116 bool PluginManager::RegisterPlugin(
1117  ConstString name, const char *description,
1118  TraceExporterCreateInstance create_callback,
1119  ThreadTraceExportCommandCreator create_thread_trace_export_command) {
1121  name, description, create_callback, create_thread_trace_export_command);
1122 }
1123 
1125 PluginManager::GetTraceExporterCreateCallback(ConstString plugin_name) {
1126  return GetTraceExporterInstances().GetCallbackForName(plugin_name);
1127 }
1128 
1129 bool PluginManager::UnregisterPlugin(
1130  TraceExporterCreateInstance create_callback) {
1131  return GetTraceExporterInstances().UnregisterPlugin(create_callback);
1132 }
1133 
1134 ThreadTraceExportCommandCreator
1135 PluginManager::GetThreadTraceExportCommandCreatorAtIndex(uint32_t index) {
1136  if (TraceExporterInstance *instance =
1137  GetTraceExporterInstances().GetInstanceAtIndex(index))
1138  return instance->create_thread_trace_export_command;
1139  return nullptr;
1140 }
1141 
1142 const char *PluginManager::GetTraceExporterPluginNameAtIndex(uint32_t index) {
1143  return GetTraceExporterInstances().GetNameAtIndex(index);
1144 }
1145 
1146 #pragma mark UnwindAssembly
1147 
1150 
1152  static UnwindAssemblyInstances g_instances;
1153  return g_instances;
1154 }
1155 
1156 bool PluginManager::RegisterPlugin(
1157  ConstString name, const char *description,
1158  UnwindAssemblyCreateInstance create_callback) {
1159  return GetUnwindAssemblyInstances().RegisterPlugin(name, description,
1160  create_callback);
1161 }
1162 
1163 bool PluginManager::UnregisterPlugin(
1164  UnwindAssemblyCreateInstance create_callback) {
1165  return GetUnwindAssemblyInstances().UnregisterPlugin(create_callback);
1166 }
1167 
1168 UnwindAssemblyCreateInstance
1169 PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(uint32_t idx) {
1171 }
1172 
1173 #pragma mark MemoryHistory
1174 
1177 
1179  static MemoryHistoryInstances g_instances;
1180  return g_instances;
1181 }
1182 
1183 bool PluginManager::RegisterPlugin(
1184  ConstString name, const char *description,
1185  MemoryHistoryCreateInstance create_callback) {
1186  return GetMemoryHistoryInstances().RegisterPlugin(name, description,
1187  create_callback);
1188 }
1189 
1190 bool PluginManager::UnregisterPlugin(
1191  MemoryHistoryCreateInstance create_callback) {
1192  return GetMemoryHistoryInstances().UnregisterPlugin(create_callback);
1193 }
1194 
1195 MemoryHistoryCreateInstance
1196 PluginManager::GetMemoryHistoryCreateCallbackAtIndex(uint32_t idx) {
1198 }
1199 
1200 #pragma mark InstrumentationRuntime
1201 
1203  : public PluginInstance<InstrumentationRuntimeCreateInstance> {
1205  ConstString name, std::string description, CallbackType create_callback,
1206  InstrumentationRuntimeGetType get_type_callback)
1208  name, std::move(description), create_callback),
1209  get_type_callback(get_type_callback) {}
1210 
1211  InstrumentationRuntimeGetType get_type_callback = nullptr;
1212 };
1213 
1216 
1218  static InstrumentationRuntimeInstances g_instances;
1219  return g_instances;
1220 }
1221 
1222 bool PluginManager::RegisterPlugin(
1223  ConstString name, const char *description,
1224  InstrumentationRuntimeCreateInstance create_callback,
1225  InstrumentationRuntimeGetType get_type_callback) {
1227  name, description, create_callback, get_type_callback);
1228 }
1229 
1230 bool PluginManager::UnregisterPlugin(
1231  InstrumentationRuntimeCreateInstance create_callback) {
1232  return GetInstrumentationRuntimeInstances().UnregisterPlugin(create_callback);
1233 }
1234 
1235 InstrumentationRuntimeGetType
1236 PluginManager::GetInstrumentationRuntimeGetTypeCallbackAtIndex(uint32_t idx) {
1237  const auto &instances = GetInstrumentationRuntimeInstances().GetInstances();
1238  if (idx < instances.size())
1239  return instances[idx].get_type_callback;
1240  return nullptr;
1241 }
1242 
1244 PluginManager::GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx) {
1246 }
1247 
1248 #pragma mark TypeSystem
1249 
1250 struct TypeSystemInstance : public PluginInstance<TypeSystemCreateInstance> {
1252  CallbackType create_callback,
1253  LanguageSet supported_languages_for_types,
1254  LanguageSet supported_languages_for_expressions)
1255  : PluginInstance<TypeSystemCreateInstance>(name, std::move(description),
1256  create_callback),
1257  supported_languages_for_types(supported_languages_for_types),
1258  supported_languages_for_expressions(
1259  supported_languages_for_expressions) {}
1260 
1263 };
1264 
1266 
1268  static TypeSystemInstances g_instances;
1269  return g_instances;
1270 }
1271 
1272 bool PluginManager::RegisterPlugin(
1273  ConstString name, const char *description,
1274  TypeSystemCreateInstance create_callback,
1275  LanguageSet supported_languages_for_types,
1276  LanguageSet supported_languages_for_expressions) {
1278  name, description, create_callback, supported_languages_for_types,
1279  supported_languages_for_expressions);
1280 }
1281 
1282 bool PluginManager::UnregisterPlugin(TypeSystemCreateInstance create_callback) {
1283  return GetTypeSystemInstances().UnregisterPlugin(create_callback);
1284 }
1285 
1287 PluginManager::GetTypeSystemCreateCallbackAtIndex(uint32_t idx) {
1289 }
1290 
1291 LanguageSet PluginManager::GetAllTypeSystemSupportedLanguagesForTypes() {
1292  const auto &instances = GetTypeSystemInstances().GetInstances();
1293  LanguageSet all;
1294  for (unsigned i = 0; i < instances.size(); ++i)
1295  all.bitvector |= instances[i].supported_languages_for_types.bitvector;
1296  return all;
1297 }
1298 
1299 LanguageSet PluginManager::GetAllTypeSystemSupportedLanguagesForExpressions() {
1300  const auto &instances = GetTypeSystemInstances().GetInstances();
1301  LanguageSet all;
1302  for (unsigned i = 0; i < instances.size(); ++i)
1303  all.bitvector |= instances[i].supported_languages_for_expressions.bitvector;
1304  return all;
1305 }
1306 
1307 #pragma mark REPL
1308 
1309 struct REPLInstance : public PluginInstance<REPLCreateInstance> {
1311  CallbackType create_callback, LanguageSet supported_languages)
1312  : PluginInstance<REPLCreateInstance>(name, std::move(description),
1313  create_callback),
1314  supported_languages(supported_languages) {}
1315 
1317 };
1318 
1320 
1322  static REPLInstances g_instances;
1323  return g_instances;
1324 }
1325 
1326 bool PluginManager::RegisterPlugin(ConstString name, const char *description,
1327  REPLCreateInstance create_callback,
1328  LanguageSet supported_languages) {
1329  return GetREPLInstances().RegisterPlugin(name, description, create_callback,
1330  supported_languages);
1331 }
1332 
1333 bool PluginManager::UnregisterPlugin(REPLCreateInstance create_callback) {
1334  return GetREPLInstances().UnregisterPlugin(create_callback);
1335 }
1336 
1337 REPLCreateInstance PluginManager::GetREPLCreateCallbackAtIndex(uint32_t idx) {
1338  return GetREPLInstances().GetCallbackAtIndex(idx);
1339 }
1340 
1341 LanguageSet PluginManager::GetREPLAllTypeSystemSupportedLanguages() {
1342  const auto &instances = GetREPLInstances().GetInstances();
1343  LanguageSet all;
1344  for (unsigned i = 0; i < instances.size(); ++i)
1345  all.bitvector |= instances[i].supported_languages.bitvector;
1346  return all;
1347 }
1348 
1349 #pragma mark PluginManager
1350 
1351 void PluginManager::DebuggerInitialize(Debugger &debugger) {
1360 }
1361 
1362 // This is the preferred new way to register plugin specific settings. e.g.
1363 // This will put a plugin's settings under e.g.
1364 // "plugin.<plugin_type_name>.<plugin_type_desc>.SETTINGNAME".
1365 static lldb::OptionValuePropertiesSP
1367  ConstString plugin_type_desc, bool can_create) {
1368  lldb::OptionValuePropertiesSP parent_properties_sp(
1369  debugger.GetValueProperties());
1370  if (parent_properties_sp) {
1371  static ConstString g_property_name("plugin");
1372 
1373  OptionValuePropertiesSP plugin_properties_sp =
1374  parent_properties_sp->GetSubProperty(nullptr, g_property_name);
1375  if (!plugin_properties_sp && can_create) {
1376  plugin_properties_sp =
1377  std::make_shared<OptionValueProperties>(g_property_name);
1378  parent_properties_sp->AppendProperty(
1379  g_property_name, ConstString("Settings specify to plugins."), true,
1380  plugin_properties_sp);
1381  }
1382 
1383  if (plugin_properties_sp) {
1384  lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1385  plugin_properties_sp->GetSubProperty(nullptr, plugin_type_name);
1386  if (!plugin_type_properties_sp && can_create) {
1387  plugin_type_properties_sp =
1388  std::make_shared<OptionValueProperties>(plugin_type_name);
1389  plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1390  true, plugin_type_properties_sp);
1391  }
1392  return plugin_type_properties_sp;
1393  }
1394  }
1395  return lldb::OptionValuePropertiesSP();
1396 }
1397 
1398 // This is deprecated way to register plugin specific settings. e.g.
1399 // "<plugin_type_name>.plugin.<plugin_type_desc>.SETTINGNAME" and Platform
1400 // generic settings would be under "platform.SETTINGNAME".
1401 static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPluginsOldStyle(
1402  Debugger &debugger, ConstString plugin_type_name,
1403  ConstString plugin_type_desc, bool can_create) {
1404  static ConstString g_property_name("plugin");
1405  lldb::OptionValuePropertiesSP parent_properties_sp(
1406  debugger.GetValueProperties());
1407  if (parent_properties_sp) {
1408  OptionValuePropertiesSP plugin_properties_sp =
1409  parent_properties_sp->GetSubProperty(nullptr, plugin_type_name);
1410  if (!plugin_properties_sp && can_create) {
1411  plugin_properties_sp =
1412  std::make_shared<OptionValueProperties>(plugin_type_name);
1413  parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1414  true, plugin_properties_sp);
1415  }
1416 
1417  if (plugin_properties_sp) {
1418  lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1419  plugin_properties_sp->GetSubProperty(nullptr, g_property_name);
1420  if (!plugin_type_properties_sp && can_create) {
1421  plugin_type_properties_sp =
1422  std::make_shared<OptionValueProperties>(g_property_name);
1423  plugin_properties_sp->AppendProperty(
1424  g_property_name, ConstString("Settings specific to plugins"), true,
1425  plugin_type_properties_sp);
1426  }
1427  return plugin_type_properties_sp;
1428  }
1429  }
1430  return lldb::OptionValuePropertiesSP();
1431 }
1432 
1433 namespace {
1434 
1435 typedef lldb::OptionValuePropertiesSP
1436 GetDebuggerPropertyForPluginsPtr(Debugger &, ConstString, ConstString,
1437  bool can_create);
1438 
1439 lldb::OptionValuePropertiesSP
1440 GetSettingForPlugin(Debugger &debugger, ConstString setting_name,
1441  ConstString plugin_type_name,
1442  GetDebuggerPropertyForPluginsPtr get_debugger_property =
1444  lldb::OptionValuePropertiesSP properties_sp;
1445  lldb::OptionValuePropertiesSP plugin_type_properties_sp(get_debugger_property(
1446  debugger, plugin_type_name,
1447  ConstString(), // not creating to so we don't need the description
1448  false));
1449  if (plugin_type_properties_sp)
1450  properties_sp =
1451  plugin_type_properties_sp->GetSubProperty(nullptr, setting_name);
1452  return properties_sp;
1453 }
1454 
1455 bool CreateSettingForPlugin(
1456  Debugger &debugger, ConstString plugin_type_name,
1457  ConstString plugin_type_desc,
1458  const lldb::OptionValuePropertiesSP &properties_sp, ConstString description,
1459  bool is_global_property,
1460  GetDebuggerPropertyForPluginsPtr get_debugger_property =
1462  if (properties_sp) {
1463  lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1464  get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
1465  true));
1466  if (plugin_type_properties_sp) {
1467  plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1468  description, is_global_property,
1469  properties_sp);
1470  return true;
1471  }
1472  }
1473  return false;
1474 }
1475 
1476 const char *kDynamicLoaderPluginName("dynamic-loader");
1477 const char *kPlatformPluginName("platform");
1478 const char *kProcessPluginName("process");
1479 const char *kSymbolFilePluginName("symbol-file");
1480 const char *kJITLoaderPluginName("jit-loader");
1481 const char *kStructuredDataPluginName("structured-data");
1482 
1483 } // anonymous namespace
1484 
1485 lldb::OptionValuePropertiesSP
1486 PluginManager::GetSettingForDynamicLoaderPlugin(Debugger &debugger,
1487  ConstString setting_name) {
1488  return GetSettingForPlugin(debugger, setting_name,
1489  ConstString(kDynamicLoaderPluginName));
1490 }
1491 
1492 bool PluginManager::CreateSettingForDynamicLoaderPlugin(
1493  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1494  ConstString description, bool is_global_property) {
1495  return CreateSettingForPlugin(
1496  debugger, ConstString(kDynamicLoaderPluginName),
1497  ConstString("Settings for dynamic loader plug-ins"), properties_sp,
1498  description, is_global_property);
1499 }
1500 
1501 lldb::OptionValuePropertiesSP
1502 PluginManager::GetSettingForPlatformPlugin(Debugger &debugger,
1503  ConstString setting_name) {
1504  return GetSettingForPlugin(debugger, setting_name,
1505  ConstString(kPlatformPluginName),
1507 }
1508 
1509 bool PluginManager::CreateSettingForPlatformPlugin(
1510  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1511  ConstString description, bool is_global_property) {
1512  return CreateSettingForPlugin(debugger, ConstString(kPlatformPluginName),
1513  ConstString("Settings for platform plug-ins"),
1514  properties_sp, description, is_global_property,
1516 }
1517 
1518 lldb::OptionValuePropertiesSP
1519 PluginManager::GetSettingForProcessPlugin(Debugger &debugger,
1520  ConstString setting_name) {
1521  return GetSettingForPlugin(debugger, setting_name,
1522  ConstString(kProcessPluginName));
1523 }
1524 
1525 bool PluginManager::CreateSettingForProcessPlugin(
1526  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1527  ConstString description, bool is_global_property) {
1528  return CreateSettingForPlugin(debugger, ConstString(kProcessPluginName),
1529  ConstString("Settings for process plug-ins"),
1530  properties_sp, description, is_global_property);
1531 }
1532 
1533 lldb::OptionValuePropertiesSP
1534 PluginManager::GetSettingForSymbolFilePlugin(Debugger &debugger,
1535  ConstString setting_name) {
1536  return GetSettingForPlugin(debugger, setting_name,
1537  ConstString(kSymbolFilePluginName));
1538 }
1539 
1540 bool PluginManager::CreateSettingForSymbolFilePlugin(
1541  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1542  ConstString description, bool is_global_property) {
1543  return CreateSettingForPlugin(
1544  debugger, ConstString(kSymbolFilePluginName),
1545  ConstString("Settings for symbol file plug-ins"), properties_sp,
1546  description, is_global_property);
1547 }
1548 
1549 lldb::OptionValuePropertiesSP
1550 PluginManager::GetSettingForJITLoaderPlugin(Debugger &debugger,
1551  ConstString setting_name) {
1552  return GetSettingForPlugin(debugger, setting_name,
1553  ConstString(kJITLoaderPluginName));
1554 }
1555 
1556 bool PluginManager::CreateSettingForJITLoaderPlugin(
1557  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1558  ConstString description, bool is_global_property) {
1559  return CreateSettingForPlugin(debugger, ConstString(kJITLoaderPluginName),
1560  ConstString("Settings for JIT loader plug-ins"),
1561  properties_sp, description, is_global_property);
1562 }
1563 
1564 static const char *kOperatingSystemPluginName("os");
1565 
1566 lldb::OptionValuePropertiesSP
1567 PluginManager::GetSettingForOperatingSystemPlugin(Debugger &debugger,
1568  ConstString setting_name) {
1569  lldb::OptionValuePropertiesSP properties_sp;
1570  lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1573  ConstString(), // not creating to so we don't need the description
1574  false));
1575  if (plugin_type_properties_sp)
1576  properties_sp =
1577  plugin_type_properties_sp->GetSubProperty(nullptr, setting_name);
1578  return properties_sp;
1579 }
1580 
1581 bool PluginManager::CreateSettingForOperatingSystemPlugin(
1582  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1583  ConstString description, bool is_global_property) {
1584  if (properties_sp) {
1585  lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1588  ConstString("Settings for operating system plug-ins"), true));
1589  if (plugin_type_properties_sp) {
1590  plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1591  description, is_global_property,
1592  properties_sp);
1593  return true;
1594  }
1595  }
1596  return false;
1597 }
1598 
1599 lldb::OptionValuePropertiesSP
1600 PluginManager::GetSettingForStructuredDataPlugin(Debugger &debugger,
1601  ConstString setting_name) {
1602  return GetSettingForPlugin(debugger, setting_name,
1603  ConstString(kStructuredDataPluginName));
1604 }
1605 
1606 bool PluginManager::CreateSettingForStructuredDataPlugin(
1607  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1608  ConstString description, bool is_global_property) {
1609  return CreateSettingForPlugin(
1610  debugger, ConstString(kStructuredDataPluginName),
1611  ConstString("Settings for structured data plug-ins"), properties_sp,
1612  description, is_global_property);
1613 }
OperatingSystemInstances
PluginInstances< OperatingSystemInstance > OperatingSystemInstances
Definition: PluginManager.cpp:468
TypeSystemInstance::supported_languages_for_expressions
LanguageSet supported_languages_for_expressions
Definition: PluginManager.cpp:1262
GetMemoryHistoryInstances
static MemoryHistoryInstances & GetMemoryHistoryInstances()
Definition: PluginManager.cpp:1178
LanguageRuntimeCreateInstance
GetDisassemblerInstances
static DisassemblerInstances & GetDisassemblerInstances()
Definition: PluginManager.cpp:345
MemoryHistoryInstance
PluginInstance< MemoryHistoryCreateInstance > MemoryHistoryInstance
Definition: PluginManager.cpp:1175
lldb::ScriptLanguage
ScriptLanguage
Script interpreter types.
Definition: lldb-enumerations.h:216
lldb_private::Properties::GetValueProperties
virtual lldb::OptionValuePropertiesSP GetValueProperties() const
Definition: UserSettingsController.h:42
lldb_private::ArchSpec
Definition: ArchSpec.h:33
TraceExporterInstance::create_thread_trace_export_command
ThreadTraceExportCommandCreator create_thread_trace_export_command
Definition: PluginManager.cpp:1106
FileSystem.h
TypeSystemInstances
PluginInstances< TypeSystemInstance > TypeSystemInstances
Definition: PluginManager.cpp:1265
GetPluginMapMutex
static std::recursive_mutex & GetPluginMapMutex()
Definition: PluginManager.cpp:51
ABIInstances
PluginInstances< ABIInstance > ABIInstances
Definition: PluginManager.cpp:281
PluginTerminateMap
std::map< FileSpec, PluginInfo > PluginTerminateMap
Definition: PluginManager.cpp:49
GetREPLInstances
static REPLInstances & GetREPLInstances()
Definition: PluginManager.cpp:1321
GetTraceExporterInstances
static TraceExporterInstances & GetTraceExporterInstances()
Definition: PluginManager.cpp:1111
GetJITLoaderInstances
static JITLoaderInstances & GetJITLoaderInstances()
Definition: PluginManager.cpp:409
TypeSystemCreateInstance
LanguageRuntimeInstance
Definition: PluginManager.cpp:525
PluginInstance::create_callback
Callback create_callback
Definition: PluginManager.cpp:197
SymbolFileInstance
PluginInstance< SymbolFileCreateInstance > SymbolFileInstance
Definition: PluginManager.cpp:974
DisassemblerInstances
PluginInstances< DisassemblerInstance > DisassemblerInstances
Definition: PluginManager.cpp:343
GetObjectFileInstances
static ObjectFileInstances & GetObjectFileInstances()
Definition: PluginManager.cpp:632
GetDebuggerPropertyForPluginsOldStyle
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPluginsOldStyle(Debugger &debugger, ConstString plugin_type_name, ConstString plugin_type_desc, bool can_create)
Definition: PluginManager.cpp:1401
StructuredDataPluginInstances
PluginInstances< StructuredDataPluginInstance > StructuredDataPluginInstances
Definition: PluginManager.cpp:932
ObjectContainerInstance::get_module_specifications
ObjectFileGetModuleSpecifications get_module_specifications
Definition: PluginManager.cpp:726
EmulateInstructionInstance
PluginInstance< EmulateInstructionCreateInstance > EmulateInstructionInstance
Definition: PluginManager.cpp:434
PluginTermCallback
void(* PluginTermCallback)()
Definition: PluginManager.cpp:39
StructuredDataPluginCreateInstance
REPLInstance
Definition: PluginManager.cpp:1309
CastToFPtr
static FPtrTy CastToFPtr(void *VPtr)
Definition: PluginManager.cpp:75
PluginInstances::m_instances
std::vector< Instance > m_instances
Definition: PluginManager.cpp:275
InstrumentationRuntimeCreateInstance
lldb_private::Args
Definition: Args.h:33
GetDynamicLoaderInstances
static DynamicLoaderInstances & GetDynamicLoaderInstances()
Definition: PluginManager.cpp:376
Debugger.h
LanguageRuntimeInstance::command_callback
LanguageRuntimeGetCommandObject command_callback
Definition: PluginManager.cpp:538
PluginInstances::GetInstances
const std::vector< Instance > & GetInstances() const
Definition: PluginManager.cpp:265
TraceCreateInstanceForSessionFile
PluginInstance::name
ConstString name
Definition: PluginManager.cpp:195
LanguageRuntimeInstances
PluginInstances< LanguageRuntimeInstance > LanguageRuntimeInstances
Definition: PluginManager.cpp:542
Process.h
GetPlatformInstances
static PlatformInstances & GetPlatformInstances()
Definition: PluginManager.cpp:767
lldb::eScriptLanguageNone
@ eScriptLanguageNone
Definition: lldb-enumerations.h:217
GetLanguageRuntimeInstances
static LanguageRuntimeInstances & GetLanguageRuntimeInstances()
Definition: PluginManager.cpp:544
GetSymbolVendorInstances
static SymbolVendorInstances & GetSymbolVendorInstances()
Definition: PluginManager.cpp:1004
SymbolVendorInstance
PluginInstance< SymbolVendorCreateInstance > SymbolVendorInstance
Definition: PluginManager.cpp:1001
PluginInstances
Definition: PluginManager.cpp:201
PluginInfo
Definition: PluginManager.cpp:41
TraceInstances
PluginInstances< TraceInstance > TraceInstances
Definition: PluginManager.cpp:1043
ObjectFileInstances
PluginInstances< ObjectFileInstance > ObjectFileInstances
Definition: PluginManager.cpp:630
InstrumentationRuntimeInstance::InstrumentationRuntimeInstance
InstrumentationRuntimeInstance(ConstString name, std::string description, CallbackType create_callback, InstrumentationRuntimeGetType get_type_callback)
Definition: PluginManager.cpp:1204
TraceExporterInstance::TraceExporterInstance
TraceExporterInstance(ConstString name, std::string description, TraceExporterCreateInstance create_instance, ThreadTraceExportCommandCreator create_thread_trace_export_command)
Definition: PluginManager.cpp:1097
GetUnwindAssemblyInstances
static UnwindAssemblyInstances & GetUnwindAssemblyInstances()
Definition: PluginManager.cpp:1151
lldb_private::FileSpec
Definition: FileSpec.h:56
ObjectFileInstance::save_core
ObjectFileSaveCore save_core
Definition: PluginManager.cpp:628
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
GetStructuredDataPluginInstances
static StructuredDataPluginInstances & GetStructuredDataPluginInstances()
Definition: PluginManager.cpp:934
UnwindAssemblyInstance
PluginInstance< UnwindAssemblyCreateInstance > UnwindAssemblyInstance
Definition: PluginManager.cpp:1148
LoadPluginCallback
static FileSystem::EnumerateDirectoryResult LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft, llvm::StringRef path)
Definition: PluginManager.cpp:80
lldb_private::LanguageSet::bitvector
llvm::SmallBitVector bitvector
Definition: TypeSystem.h:41
PluginInstances::GetCallbackAtIndex
Instance::CallbackType GetCallbackAtIndex(uint32_t idx)
Definition: PluginManager.cpp:230
PluginInstance::description
std::string description
Definition: PluginManager.cpp:196
REPLInstance::REPLInstance
REPLInstance(ConstString name, std::string description, CallbackType create_callback, LanguageSet supported_languages)
Definition: PluginManager.cpp:1310
LanguageRuntimeInstance::LanguageRuntimeInstance
LanguageRuntimeInstance(ConstString name, std::string description, CallbackType create_callback, DebuggerInitializeCallback debugger_init_callback, LanguageRuntimeGetCommandObject command_callback, LanguageRuntimeGetExceptionPrecondition precondition_callback)
Definition: PluginManager.cpp:527
GetScriptInterpreterInstances
static ScriptInterpreterInstances & GetScriptInterpreterInstances()
Definition: PluginManager.cpp:874
REPLInstance::supported_languages
LanguageSet supported_languages
Definition: PluginManager.cpp:1316
GetTracePluginInstances
static TraceInstances & GetTracePluginInstances()
Definition: PluginManager.cpp:1045
PluginInstances::UnregisterPlugin
bool UnregisterPlugin(typename Instance::CallbackType callback)
Definition: PluginManager.cpp:216
PluginInstances::RegisterPlugin
bool RegisterPlugin(ConstString name, const char *description, typename Instance::CallbackType callback, Args &&... args)
Definition: PluginManager.cpp:204
JITLoaderInstances
PluginInstances< JITLoaderInstance > JITLoaderInstances
Definition: PluginManager.cpp:407
ArchitectureInstance
PluginInstance< ArchitectureCreateInstance > ArchitectureInstance
Definition: PluginManager.cpp:303
GetProcessInstances
static ProcessInstances & GetProcessInstances()
Definition: PluginManager.cpp:815
GetTypeSystemInstances
static TypeSystemInstances & GetTypeSystemInstances()
Definition: PluginManager.cpp:1267
DynamicLoaderInstances
PluginInstances< DynamicLoaderInstance > DynamicLoaderInstances
Definition: PluginManager.cpp:374
ObjectContainerInstances
PluginInstances< ObjectContainerInstance > ObjectContainerInstances
Definition: PluginManager.cpp:728
lldb_private::FileSystem::EnumerateDirectoryResult
EnumerateDirectoryResult
Definition: FileSystem.h:162
OperatingSystemInstance
PluginInstance< OperatingSystemCreateInstance > OperatingSystemInstance
Definition: PluginManager.cpp:467
LanguageRuntimeInstance::precondition_callback
LanguageRuntimeGetExceptionPrecondition precondition_callback
Definition: PluginManager.cpp:539
TypeSystemInstance::supported_languages_for_types
LanguageSet supported_languages_for_types
Definition: PluginManager.cpp:1261
lldb_private::ConstString
Definition: ConstString.h:40
TraceInstance::schema
llvm::StringRef schema
Definition: PluginManager.cpp:1039
SymbolFileInstances
PluginInstances< SymbolFileInstance > SymbolFileInstances
Definition: PluginManager.cpp:975
GetLanguageInstances
static LanguageInstances & GetLanguageInstances()
Definition: PluginManager.cpp:503
StructuredDataPluginInstance::StructuredDataPluginInstance
StructuredDataPluginInstance(ConstString name, std::string description, CallbackType create_callback, DebuggerInitializeCallback debugger_init_callback, StructuredDataFilterLaunchInfo filter_callback)
Definition: PluginManager.cpp:919
TraceInstance
Definition: PluginManager.cpp:1027
SymbolVendorInstances
PluginInstances< SymbolVendorInstance > SymbolVendorInstances
Definition: PluginManager.cpp:1002
PluginInstances::PerformDebuggerCallback
void PerformDebuggerCallback(Debugger &debugger)
Definition: PluginManager.cpp:258
PlatformInstances
PluginInstances< PlatformInstance > PlatformInstances
Definition: PluginManager.cpp:765
ScriptInterpreterCreateInstance
ObjectContainerCreateInstance
PluginInstance
Definition: PluginManager.cpp:184
TypeSystemInstance
Definition: PluginManager.cpp:1250
GetABIInstances
static ABIInstances & GetABIInstances()
Definition: PluginManager.cpp:283
GetEmulateInstructionInstances
static EmulateInstructionInstances & GetEmulateInstructionInstances()
Definition: PluginManager.cpp:437
lldb_private::Debugger
Definition: Debugger.h:70
PluginInstances::GetCallbackForName
Instance::CallbackType GetCallbackForName(ConstString name)
Definition: PluginManager.cpp:248
HostInfo.h
UnwindAssemblyInstances
PluginInstances< UnwindAssemblyInstance > UnwindAssemblyInstances
Definition: PluginManager.cpp:1149
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:39
StringList.h
ProcessInstance
PluginInstance< ProcessCreateInstance > ProcessInstance
Definition: PluginManager.cpp:812
PluginInfo::plugin_term_callback
PluginTermCallback plugin_term_callback
Definition: PluginManager.cpp:46
ObjectFileInstance::get_module_specifications
ObjectFileGetModuleSpecifications get_module_specifications
Definition: PluginManager.cpp:627
ScriptInterpreterInstance
Definition: PluginManager.cpp:860
StructuredDataPluginInstance
Definition: PluginManager.cpp:917
OptionValueProperties.h
TraceExporterInstance
Definition: PluginManager.cpp:1095
SystemRuntimeInstance
PluginInstance< SystemRuntimeCreateInstance > SystemRuntimeInstance
Definition: PluginManager.cpp:587
TraceInstance::TraceInstance
TraceInstance(ConstString name, std::string description, CallbackType create_callback_for_session_file, TraceCreateInstanceForLiveProcess create_callback_for_live_process, llvm::StringRef schema)
Definition: PluginManager.cpp:1029
ObjectFileInstance
Definition: PluginManager.cpp:614
PluginIsLoaded
static bool PluginIsLoaded(const FileSpec &plugin_file_spec)
Definition: PluginManager.cpp:61
PluginInstance::CallbackType
Callback CallbackType
Definition: PluginManager.cpp:185
TraceExporterInstances
PluginInstances< TraceExporterInstance > TraceExporterInstances
Definition: PluginManager.cpp:1109
PosixApi.h
lldb_private::Status
Definition: Status.h:44
PluginInfo::plugin_init_callback
PluginInitCallback plugin_init_callback
Definition: PluginManager.cpp:45
ObjectFileInstance::create_memory_callback
ObjectFileCreateMemoryInstance create_memory_callback
Definition: PluginManager.cpp:626
GetSystemRuntimeInstances
static SystemRuntimeInstances & GetSystemRuntimeInstances()
Definition: PluginManager.cpp:590
LanguageInstance
PluginInstance< LanguageCreateInstance > LanguageInstance
Definition: PluginManager.cpp:500
uint32_t
SystemRuntimeInstances
PluginInstances< SystemRuntimeInstance > SystemRuntimeInstances
Definition: PluginManager.cpp:588
PluginInstances::GetNameAtIndex
const char * GetNameAtIndex(uint32_t idx)
Definition: PluginManager.cpp:242
GetPluginMap
static PluginTerminateMap & GetPluginMap()
Definition: PluginManager.cpp:56
LanguageInstances
PluginInstances< LanguageInstance > LanguageInstances
Definition: PluginManager.cpp:501
GetOperatingSystemInstances
static OperatingSystemInstances & GetOperatingSystemInstances()
Definition: PluginManager.cpp:470
InstrumentationRuntimeInstances
PluginInstances< InstrumentationRuntimeInstance > InstrumentationRuntimeInstances
Definition: PluginManager.cpp:1215
ObjectContainerInstance::ObjectContainerInstance
ObjectContainerInstance(ConstString name, std::string description, CallbackType create_callback, ObjectFileGetModuleSpecifications get_module_specifications)
Definition: PluginManager.cpp:719
REPLInstances
PluginInstances< REPLInstance > REPLInstances
Definition: PluginManager.cpp:1319
DynamicLoaderInstance
PluginInstance< DynamicLoaderCreateInstance > DynamicLoaderInstance
Definition: PluginManager.cpp:373
lldb::SaveCoreStyle
SaveCoreStyle
Definition: lldb-enumerations.h:1136
PluginInitCallback
bool(* PluginInitCallback)()
Definition: PluginManager.cpp:38
PluginInstance::PluginInstance
PluginInstance(ConstString name, std::string description, Callback create_callback=nullptr, DebuggerInitializeCallback debugger_init_callback=nullptr)
Definition: PluginManager.cpp:188
TypeSystemInstance::TypeSystemInstance
TypeSystemInstance(ConstString name, std::string description, CallbackType create_callback, LanguageSet supported_languages_for_types, LanguageSet supported_languages_for_expressions)
Definition: PluginManager.cpp:1251
GetArchitectureInstances
static ArchitectureInstances & GetArchitectureInstances()
Definition: PluginManager.cpp:306
PluginManager.h
kOperatingSystemPluginName
static const char * kOperatingSystemPluginName("os")
Status.h
JITLoaderInstance
PluginInstance< JITLoaderCreateInstance > JITLoaderInstance
Definition: PluginManager.cpp:406
InstrumentationRuntimeInstance
Definition: PluginManager.cpp:1202
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
ObjectFileCreateInstance
ProcessInstances
PluginInstances< ProcessInstance > ProcessInstances
Definition: PluginManager.cpp:813
GetInstrumentationRuntimeInstances
static InstrumentationRuntimeInstances & GetInstrumentationRuntimeInstances()
Definition: PluginManager.cpp:1217
FileSpec.h
lldb_private::CompletionRequest::AddCompletion
void AddCompletion(llvm::StringRef completion, llvm::StringRef description="", CompletionMode mode=CompletionMode::Normal)
Adds a possible completion string.
Definition: CompletionRequest.h:167
ObjectFileInstance::ObjectFileInstance
ObjectFileInstance(ConstString name, std::string description, CallbackType create_callback, ObjectFileCreateMemoryInstance create_memory_callback, ObjectFileGetModuleSpecifications get_module_specifications, ObjectFileSaveCore save_core)
Definition: PluginManager.cpp:615
PluginInstance::debugger_init_callback
DebuggerInitializeCallback debugger_init_callback
Definition: PluginManager.cpp:198
ConstString.h
MemoryHistoryInstances
PluginInstances< MemoryHistoryInstance > MemoryHistoryInstances
Definition: PluginManager.cpp:1176
lldb_private::LanguageSet
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
Definition: TypeSystem.h:40
ScriptInterpreterInstances
PluginInstances< ScriptInterpreterInstance > ScriptInterpreterInstances
Definition: PluginManager.cpp:872
DisassemblerInstance
PluginInstance< DisassemblerCreateInstance > DisassemblerInstance
Definition: PluginManager.cpp:342
EmulateInstructionInstances
PluginInstances< EmulateInstructionInstance > EmulateInstructionInstances
Definition: PluginManager.cpp:435
ObjectContainerInstance
Definition: PluginManager.cpp:717
ArchitectureInstances
std::vector< ArchitectureInstance > ArchitectureInstances
Definition: PluginManager.cpp:304
TraceInstance::create_callback_for_live_process
TraceCreateInstanceForLiveProcess create_callback_for_live_process
Definition: PluginManager.cpp:1040
PluginInfo::library
llvm::sys::DynamicLibrary library
Definition: PluginManager.cpp:44
REPLCreateInstance
GetSymbolFileInstances
static SymbolFileInstances & GetSymbolFileInstances()
Definition: PluginManager.cpp:977
PATH_MAX
#define PATH_MAX
Definition: windows/PosixApi.h:25
lldb_private::FileSpec::GetPath
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition: FileSpec.cpp:348
ScriptInterpreterInstance::ScriptInterpreterInstance
ScriptInterpreterInstance(ConstString name, std::string description, CallbackType create_callback, lldb::ScriptLanguage language)
Definition: PluginManager.cpp:862
TraceExporterCreateInstance
lldb
Definition: SBAddress.h:15
GetObjectContainerInstances
static ObjectContainerInstances & GetObjectContainerInstances()
Definition: PluginManager.cpp:730
PluginInstances::GetDescriptionAtIndex
const char * GetDescriptionAtIndex(uint32_t idx)
Definition: PluginManager.cpp:236
GetDebuggerPropertyForPlugins
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPlugins(Debugger &debugger, ConstString plugin_type_name, ConstString plugin_type_desc, bool can_create)
Definition: PluginManager.cpp:1366
SetPluginInfo
static void SetPluginInfo(const FileSpec &plugin_file_spec, const PluginInfo &plugin_info)
Definition: PluginManager.cpp:67
ABIInstance
PluginInstance< ABICreateInstance > ABIInstance
Definition: PluginManager.cpp:280
PluginInstances::GetInstanceAtIndex
Instance * GetInstanceAtIndex(uint32_t idx)
Definition: PluginManager.cpp:268
PluginInstances::GetInstances
std::vector< Instance > & GetInstances()
Definition: PluginManager.cpp:266
lldb_private::CompletionRequest
Definition: CompletionRequest.h:100
PlatformInstance
PluginInstance< PlatformCreateInstance > PlatformInstance
Definition: PluginManager.cpp:764
DebuggerInitializeCallback