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;
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;
196  Callback create_callback;
198 };
199 
200 template <typename Instance> class PluginInstances {
201 public:
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 
273 private:
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 
287 bool PluginManager::RegisterPlugin(llvm::StringRef name,
288  llvm::StringRef 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(llvm::StringRef name,
312  llvm::StringRef description,
313  ArchitectureCreateInstance create_callback) {
314  GetArchitectureInstances().push_back({name, description, create_callback});
315 }
316 
317 void PluginManager::UnregisterPlugin(
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 
330 std::unique_ptr<Architecture>
331 PluginManager::CreateArchitectureInstance(const ArchSpec &arch) {
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 
349 bool PluginManager::RegisterPlugin(llvm::StringRef name,
350  llvm::StringRef 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(
368  llvm::StringRef name) {
370 }
371 
372 #pragma mark DynamicLoader
373 
376 
378  static DynamicLoaderInstances g_instances;
379  return g_instances;
380 }
381 
382 bool PluginManager::RegisterPlugin(
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 
390 bool PluginManager::UnregisterPlugin(
391  DynamicLoaderCreateInstance create_callback) {
392  return GetDynamicLoaderInstances().UnregisterPlugin(create_callback);
393 }
394 
395 DynamicLoaderCreateInstance
396 PluginManager::GetDynamicLoaderCreateCallbackAtIndex(uint32_t idx) {
398 }
399 
400 DynamicLoaderCreateInstance
401 PluginManager::GetDynamicLoaderCreateCallbackForPluginName(
402  llvm::StringRef name) {
404 }
405 
406 #pragma mark JITLoader
407 
410 
412  static JITLoaderInstances g_instances;
413  return g_instances;
414 }
415 
416 bool PluginManager::RegisterPlugin(
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 
424 bool PluginManager::UnregisterPlugin(JITLoaderCreateInstance create_callback) {
425  return GetJITLoaderInstances().UnregisterPlugin(create_callback);
426 }
427 
428 JITLoaderCreateInstance
429 PluginManager::GetJITLoaderCreateCallbackAtIndex(uint32_t idx) {
431 }
432 
433 #pragma mark EmulateInstruction
434 
438 
440  static EmulateInstructionInstances g_instances;
441  return g_instances;
442 }
443 
444 bool PluginManager::RegisterPlugin(
445  llvm::StringRef name, llvm::StringRef description,
446  EmulateInstructionCreateInstance create_callback) {
447  return GetEmulateInstructionInstances().RegisterPlugin(name, description,
448  create_callback);
449 }
450 
451 bool PluginManager::UnregisterPlugin(
452  EmulateInstructionCreateInstance create_callback) {
453  return GetEmulateInstructionInstances().UnregisterPlugin(create_callback);
454 }
455 
456 EmulateInstructionCreateInstance
457 PluginManager::GetEmulateInstructionCreateCallbackAtIndex(uint32_t idx) {
459 }
460 
461 EmulateInstructionCreateInstance
462 PluginManager::GetEmulateInstructionCreateCallbackForPluginName(
463  llvm::StringRef name) {
465 }
466 
467 #pragma mark OperatingSystem
468 
471 
473  static OperatingSystemInstances g_instances;
474  return g_instances;
475 }
476 
477 bool PluginManager::RegisterPlugin(
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 
485 bool PluginManager::UnregisterPlugin(
486  OperatingSystemCreateInstance create_callback) {
487  return GetOperatingSystemInstances().UnregisterPlugin(create_callback);
488 }
489 
490 OperatingSystemCreateInstance
491 PluginManager::GetOperatingSystemCreateCallbackAtIndex(uint32_t idx) {
493 }
494 
495 OperatingSystemCreateInstance
496 PluginManager::GetOperatingSystemCreateCallbackForPluginName(
497  llvm::StringRef name) {
499 }
500 
501 #pragma mark Language
502 
505 
507  static LanguageInstances g_instances;
508  return g_instances;
509 }
510 
511 bool PluginManager::RegisterPlugin(llvm::StringRef name,
512  llvm::StringRef description,
513  LanguageCreateInstance create_callback) {
514  return GetLanguageInstances().RegisterPlugin(name, description,
515  create_callback);
516 }
517 
518 bool PluginManager::UnregisterPlugin(LanguageCreateInstance create_callback) {
519  return GetLanguageInstances().UnregisterPlugin(create_callback);
520 }
521 
522 LanguageCreateInstance
523 PluginManager::GetLanguageCreateCallbackAtIndex(uint32_t idx) {
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 
542  LanguageRuntimeGetCommandObject command_callback;
543  LanguageRuntimeGetExceptionPrecondition precondition_callback;
544 };
545 
547 
549  static LanguageRuntimeInstances g_instances;
550  return g_instances;
551 }
552 
553 bool PluginManager::RegisterPlugin(
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 
563 bool PluginManager::UnregisterPlugin(
564  LanguageRuntimeCreateInstance create_callback) {
565  return GetLanguageRuntimeInstances().UnregisterPlugin(create_callback);
566 }
567 
569 PluginManager::GetLanguageRuntimeCreateCallbackAtIndex(uint32_t idx) {
571 }
572 
573 LanguageRuntimeGetCommandObject
574 PluginManager::GetLanguageRuntimeGetCommandObjectAtIndex(uint32_t idx) {
575  const auto &instances = GetLanguageRuntimeInstances().GetInstances();
576  if (idx < instances.size())
577  return instances[idx].command_callback;
578  return nullptr;
579 }
580 
581 LanguageRuntimeGetExceptionPrecondition
582 PluginManager::GetLanguageRuntimeGetExceptionPreconditionAtIndex(uint32_t idx) {
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 
599 bool PluginManager::RegisterPlugin(
600  llvm::StringRef name, llvm::StringRef description,
601  SystemRuntimeCreateInstance create_callback) {
602  return GetSystemRuntimeInstances().RegisterPlugin(name, description,
603  create_callback);
604 }
605 
606 bool PluginManager::UnregisterPlugin(
607  SystemRuntimeCreateInstance create_callback) {
608  return GetSystemRuntimeInstances().UnregisterPlugin(create_callback);
609 }
610 
611 SystemRuntimeCreateInstance
612 PluginManager::GetSystemRuntimeCreateCallbackAtIndex(uint32_t idx) {
614 }
615 
616 #pragma mark ObjectFile
617 
618 struct 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  : PluginInstance<ObjectFileCreateInstance>(name, description,
626  create_callback),
627  create_memory_callback(create_memory_callback),
628  get_module_specifications(get_module_specifications),
629  save_core(save_core) {}
630 
631  ObjectFileCreateMemoryInstance create_memory_callback;
632  ObjectFileGetModuleSpecifications get_module_specifications;
633  ObjectFileSaveCore save_core;
634 };
636 
638  static ObjectFileInstances g_instances;
639  return g_instances;
640 }
641 
642 bool PluginManager::RegisterPlugin(
643  llvm::StringRef name, llvm::StringRef description,
644  ObjectFileCreateInstance create_callback,
645  ObjectFileCreateMemoryInstance create_memory_callback,
646  ObjectFileGetModuleSpecifications get_module_specifications,
647  ObjectFileSaveCore save_core) {
649  name, description, create_callback, create_memory_callback,
650  get_module_specifications, save_core);
651 }
652 
653 bool PluginManager::UnregisterPlugin(ObjectFileCreateInstance create_callback) {
654  return GetObjectFileInstances().UnregisterPlugin(create_callback);
655 }
656 
658 PluginManager::GetObjectFileCreateCallbackAtIndex(uint32_t idx) {
660 }
661 
662 ObjectFileCreateMemoryInstance
663 PluginManager::GetObjectFileCreateMemoryCallbackAtIndex(uint32_t idx) {
664  const auto &instances = GetObjectFileInstances().GetInstances();
665  if (idx < instances.size())
666  return instances[idx].create_memory_callback;
667  return nullptr;
668 }
669 
670 ObjectFileGetModuleSpecifications
671 PluginManager::GetObjectFileGetModuleSpecificationsCallbackAtIndex(
672  uint32_t idx) {
673  const auto &instances = GetObjectFileInstances().GetInstances();
674  if (idx < instances.size())
675  return instances[idx].get_module_specifications;
676  return nullptr;
677 }
678 
679 ObjectFileCreateMemoryInstance
680 PluginManager::GetObjectFileCreateMemoryCallbackForPluginName(
681  llvm::StringRef name) {
682  const auto &instances = GetObjectFileInstances().GetInstances();
683  for (auto &instance : instances) {
684  if (instance.name == name)
685  return instance.create_memory_callback;
686  }
687  return nullptr;
688 }
689 
690 Status PluginManager::SaveCore(const lldb::ProcessSP &process_sp,
691  const FileSpec &outfile,
692  lldb::SaveCoreStyle &core_style,
693  llvm::StringRef plugin_name) {
694  if (plugin_name.empty()) {
695  // Try saving core directly from the process plugin first.
696  llvm::Expected<bool> ret = process_sp->SaveCore(outfile.GetPath());
697  if (!ret)
698  return Status(ret.takeError());
699  if (ret.get())
700  return Status();
701  }
702 
703  // Fall back to object plugins.
704  Status error;
705  auto &instances = GetObjectFileInstances().GetInstances();
706  for (auto &instance : instances) {
707  if (plugin_name.empty() || instance.name == plugin_name) {
708  if (instance.save_core &&
709  instance.save_core(process_sp, outfile, core_style, error))
710  return error;
711  }
712  }
713  error.SetErrorString(
714  "no ObjectFile plugins were able to save a core for this process");
715  return error;
716 }
717 
718 #pragma mark ObjectContainer
719 
721  : public PluginInstance<ObjectContainerCreateInstance> {
723  llvm::StringRef name, llvm::StringRef description,
724  CallbackType create_callback,
725  ObjectFileGetModuleSpecifications get_module_specifications)
726  : PluginInstance<ObjectContainerCreateInstance>(name, description,
727  create_callback),
728  get_module_specifications(get_module_specifications) {}
729 
730  ObjectFileGetModuleSpecifications get_module_specifications;
731 };
733 
735  static ObjectContainerInstances g_instances;
736  return g_instances;
737 }
738 
739 bool PluginManager::RegisterPlugin(
740  llvm::StringRef name, llvm::StringRef description,
741  ObjectContainerCreateInstance create_callback,
742  ObjectFileGetModuleSpecifications get_module_specifications) {
744  name, description, create_callback, get_module_specifications);
745 }
746 
747 bool PluginManager::UnregisterPlugin(
748  ObjectContainerCreateInstance create_callback) {
749  return GetObjectContainerInstances().UnregisterPlugin(create_callback);
750 }
751 
753 PluginManager::GetObjectContainerCreateCallbackAtIndex(uint32_t idx) {
755 }
756 
757 ObjectFileGetModuleSpecifications
758 PluginManager::GetObjectContainerGetModuleSpecificationsCallbackAtIndex(
759  uint32_t idx) {
760  const auto &instances = GetObjectContainerInstances().GetInstances();
761  if (idx < instances.size())
762  return instances[idx].get_module_specifications;
763  return nullptr;
764 }
765 
766 #pragma mark Platform
767 
770 
772  static PlatformInstances g_platform_instances;
773  return g_platform_instances;
774 }
775 
776 bool PluginManager::RegisterPlugin(
777  llvm::StringRef name, llvm::StringRef description,
778  PlatformCreateInstance create_callback,
779  DebuggerInitializeCallback debugger_init_callback) {
781  name, description, create_callback, debugger_init_callback);
782 }
783 
784 bool PluginManager::UnregisterPlugin(PlatformCreateInstance create_callback) {
785  return GetPlatformInstances().UnregisterPlugin(create_callback);
786 }
787 
788 llvm::StringRef PluginManager::GetPlatformPluginNameAtIndex(uint32_t idx) {
789  return GetPlatformInstances().GetNameAtIndex(idx);
790 }
791 
792 llvm::StringRef
793 PluginManager::GetPlatformPluginDescriptionAtIndex(uint32_t idx) {
795 }
796 
797 PlatformCreateInstance
798 PluginManager::GetPlatformCreateCallbackAtIndex(uint32_t idx) {
800 }
801 
802 PlatformCreateInstance
803 PluginManager::GetPlatformCreateCallbackForPluginName(llvm::StringRef name) {
805 }
806 
807 void PluginManager::AutoCompletePlatformName(llvm::StringRef name,
808  CompletionRequest &request) {
809  for (const auto &instance : GetPlatformInstances().GetInstances()) {
810  if (instance.name.startswith(name))
811  request.AddCompletion(instance.name);
812  }
813 }
814 
815 #pragma mark Process
816 
819 
821  static ProcessInstances g_instances;
822  return g_instances;
823 }
824 
825 bool PluginManager::RegisterPlugin(
826  llvm::StringRef name, llvm::StringRef description,
827  ProcessCreateInstance create_callback,
828  DebuggerInitializeCallback debugger_init_callback) {
830  name, description, create_callback, debugger_init_callback);
831 }
832 
833 bool PluginManager::UnregisterPlugin(ProcessCreateInstance create_callback) {
834  return GetProcessInstances().UnregisterPlugin(create_callback);
835 }
836 
837 llvm::StringRef PluginManager::GetProcessPluginNameAtIndex(uint32_t idx) {
838  return GetProcessInstances().GetNameAtIndex(idx);
839 }
840 
841 llvm::StringRef PluginManager::GetProcessPluginDescriptionAtIndex(uint32_t idx) {
843 }
844 
845 ProcessCreateInstance
846 PluginManager::GetProcessCreateCallbackAtIndex(uint32_t idx) {
848 }
849 
850 ProcessCreateInstance
851 PluginManager::GetProcessCreateCallbackForPluginName(llvm::StringRef name) {
853 }
854 
855 void PluginManager::AutoCompleteProcessName(llvm::StringRef name,
856  CompletionRequest &request) {
857  for (const auto &instance : GetProcessInstances().GetInstances()) {
858  if (instance.name.startswith(name))
859  request.AddCompletion(instance.name, instance.description);
860  }
861 }
862 
863 #pragma mark ScriptInterpreter
864 
866  : public PluginInstance<ScriptInterpreterCreateInstance> {
867  ScriptInterpreterInstance(llvm::StringRef name, llvm::StringRef description,
868  CallbackType create_callback,
869  lldb::ScriptLanguage language)
870  : PluginInstance<ScriptInterpreterCreateInstance>(name, description,
871  create_callback),
872  language(language) {}
873 
875 };
876 
878 
880  static ScriptInterpreterInstances g_instances;
881  return g_instances;
882 }
883 
884 bool PluginManager::RegisterPlugin(
885  llvm::StringRef name, llvm::StringRef description,
886  lldb::ScriptLanguage script_language,
887  ScriptInterpreterCreateInstance create_callback) {
889  name, description, create_callback, script_language);
890 }
891 
892 bool PluginManager::UnregisterPlugin(
893  ScriptInterpreterCreateInstance create_callback) {
894  return GetScriptInterpreterInstances().UnregisterPlugin(create_callback);
895 }
896 
898 PluginManager::GetScriptInterpreterCreateCallbackAtIndex(uint32_t idx) {
900 }
901 
902 lldb::ScriptInterpreterSP
903 PluginManager::GetScriptInterpreterForLanguage(lldb::ScriptLanguage script_lang,
904  Debugger &debugger) {
905  const auto &instances = GetScriptInterpreterInstances().GetInstances();
906  ScriptInterpreterCreateInstance none_instance = nullptr;
907  for (const auto &instance : instances) {
908  if (instance.language == lldb::eScriptLanguageNone)
909  none_instance = instance.create_callback;
910 
911  if (script_lang == instance.language)
912  return instance.create_callback(debugger);
913  }
914 
915  // If we didn't find one, return the ScriptInterpreter for the null language.
916  assert(none_instance != nullptr);
917  return none_instance(debugger);
918 }
919 
920 #pragma mark StructuredDataPlugin
921 
923  : public PluginInstance<StructuredDataPluginCreateInstance> {
925  llvm::StringRef name, llvm::StringRef description,
926  CallbackType create_callback,
927  DebuggerInitializeCallback debugger_init_callback,
928  StructuredDataFilterLaunchInfo filter_callback)
930  name, description, create_callback, debugger_init_callback),
931  filter_callback(filter_callback) {}
932 
933  StructuredDataFilterLaunchInfo filter_callback = nullptr;
934 };
935 
938 
940  static StructuredDataPluginInstances g_instances;
941  return g_instances;
942 }
943 
944 bool PluginManager::RegisterPlugin(
945  llvm::StringRef name, llvm::StringRef description,
946  StructuredDataPluginCreateInstance create_callback,
947  DebuggerInitializeCallback debugger_init_callback,
948  StructuredDataFilterLaunchInfo filter_callback) {
950  name, description, create_callback, debugger_init_callback,
951  filter_callback);
952 }
953 
954 bool PluginManager::UnregisterPlugin(
955  StructuredDataPluginCreateInstance create_callback) {
956  return GetStructuredDataPluginInstances().UnregisterPlugin(create_callback);
957 }
958 
960 PluginManager::GetStructuredDataPluginCreateCallbackAtIndex(uint32_t idx) {
962 }
963 
964 StructuredDataFilterLaunchInfo
965 PluginManager::GetStructuredDataFilterCallbackAtIndex(
966  uint32_t idx, bool &iteration_complete) {
967  const auto &instances = GetStructuredDataPluginInstances().GetInstances();
968  if (idx < instances.size()) {
969  iteration_complete = false;
970  return instances[idx].filter_callback;
971  } else {
972  iteration_complete = true;
973  }
974  return nullptr;
975 }
976 
977 #pragma mark SymbolFile
978 
981 
983  static SymbolFileInstances g_instances;
984  return g_instances;
985 }
986 
987 bool PluginManager::RegisterPlugin(
988  llvm::StringRef name, llvm::StringRef description,
989  SymbolFileCreateInstance create_callback,
990  DebuggerInitializeCallback debugger_init_callback) {
992  name, description, create_callback, debugger_init_callback);
993 }
994 
995 bool PluginManager::UnregisterPlugin(SymbolFileCreateInstance create_callback) {
996  return GetSymbolFileInstances().UnregisterPlugin(create_callback);
997 }
998 
999 SymbolFileCreateInstance
1000 PluginManager::GetSymbolFileCreateCallbackAtIndex(uint32_t idx) {
1002 }
1003 
1004 #pragma mark SymbolVendor
1005 
1008 
1010  static SymbolVendorInstances g_instances;
1011  return g_instances;
1012 }
1013 
1014 bool PluginManager::RegisterPlugin(llvm::StringRef name,
1015  llvm::StringRef description,
1016  SymbolVendorCreateInstance create_callback) {
1017  return GetSymbolVendorInstances().RegisterPlugin(name, description,
1018  create_callback);
1019 }
1020 
1021 bool PluginManager::UnregisterPlugin(
1022  SymbolVendorCreateInstance create_callback) {
1023  return GetSymbolVendorInstances().UnregisterPlugin(create_callback);
1024 }
1025 
1026 SymbolVendorCreateInstance
1027 PluginManager::GetSymbolVendorCreateCallbackAtIndex(uint32_t idx) {
1029 }
1030 
1031 #pragma mark Trace
1032 
1034  : public PluginInstance<TraceCreateInstanceForSessionFile> {
1036  llvm::StringRef name, llvm::StringRef description,
1037  CallbackType create_callback_for_session_file,
1038  TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1039  llvm::StringRef schema)
1041  name, description, create_callback_for_session_file),
1042  schema(schema),
1043  create_callback_for_live_process(create_callback_for_live_process) {}
1044 
1045  llvm::StringRef schema;
1046  TraceCreateInstanceForLiveProcess create_callback_for_live_process;
1047 };
1048 
1050 
1052  static TraceInstances g_instances;
1053  return g_instances;
1054 }
1055 
1056 bool PluginManager::RegisterPlugin(
1057  llvm::StringRef name, llvm::StringRef description,
1058  TraceCreateInstanceForSessionFile create_callback_for_session_file,
1059  TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1060  llvm::StringRef schema) {
1062  name, description, create_callback_for_session_file,
1063  create_callback_for_live_process, schema);
1064 }
1065 
1066 bool PluginManager::UnregisterPlugin(
1067  TraceCreateInstanceForSessionFile create_callback_for_session_file) {
1069  create_callback_for_session_file);
1070 }
1071 
1073 PluginManager::GetTraceCreateCallback(llvm::StringRef plugin_name) {
1074  return GetTracePluginInstances().GetCallbackForName(plugin_name);
1075 }
1076 
1077 TraceCreateInstanceForLiveProcess
1078 PluginManager::GetTraceCreateCallbackForLiveProcess(llvm::StringRef plugin_name) {
1079  for (const TraceInstance &instance : GetTracePluginInstances().GetInstances())
1080  if (instance.name == plugin_name)
1081  return instance.create_callback_for_live_process;
1082  return nullptr;
1083 }
1084 
1085 llvm::StringRef PluginManager::GetTraceSchema(llvm::StringRef plugin_name) {
1086  for (const TraceInstance &instance : GetTracePluginInstances().GetInstances())
1087  if (instance.name == plugin_name)
1088  return instance.schema;
1089  return llvm::StringRef();
1090 }
1091 
1092 llvm::StringRef PluginManager::GetTraceSchema(size_t index) {
1093  if (TraceInstance *instance =
1094  GetTracePluginInstances().GetInstanceAtIndex(index))
1095  return instance->schema;
1096  return llvm::StringRef();
1097 }
1098 
1099 #pragma mark TraceExporter
1100 
1102  : public PluginInstance<TraceExporterCreateInstance> {
1104  llvm::StringRef name, llvm::StringRef description,
1105  TraceExporterCreateInstance create_instance,
1106  ThreadTraceExportCommandCreator create_thread_trace_export_command)
1107  : PluginInstance<TraceExporterCreateInstance>(name, description,
1108  create_instance),
1109  create_thread_trace_export_command(create_thread_trace_export_command) {
1110  }
1111 
1112  ThreadTraceExportCommandCreator create_thread_trace_export_command;
1113 };
1114 
1116 
1118  static TraceExporterInstances g_instances;
1119  return g_instances;
1120 }
1121 
1122 bool PluginManager::RegisterPlugin(
1123  llvm::StringRef name, llvm::StringRef description,
1124  TraceExporterCreateInstance create_callback,
1125  ThreadTraceExportCommandCreator create_thread_trace_export_command) {
1127  name, description, create_callback, create_thread_trace_export_command);
1128 }
1129 
1131 PluginManager::GetTraceExporterCreateCallback(llvm::StringRef plugin_name) {
1132  return GetTraceExporterInstances().GetCallbackForName(plugin_name);
1133 }
1134 
1135 bool PluginManager::UnregisterPlugin(
1136  TraceExporterCreateInstance create_callback) {
1137  return GetTraceExporterInstances().UnregisterPlugin(create_callback);
1138 }
1139 
1140 ThreadTraceExportCommandCreator
1141 PluginManager::GetThreadTraceExportCommandCreatorAtIndex(uint32_t index) {
1142  if (TraceExporterInstance *instance =
1143  GetTraceExporterInstances().GetInstanceAtIndex(index))
1144  return instance->create_thread_trace_export_command;
1145  return nullptr;
1146 }
1147 
1148 llvm::StringRef
1149 PluginManager::GetTraceExporterPluginNameAtIndex(uint32_t index) {
1150  return GetTraceExporterInstances().GetNameAtIndex(index);
1151 }
1152 
1153 #pragma mark UnwindAssembly
1154 
1157 
1159  static UnwindAssemblyInstances g_instances;
1160  return g_instances;
1161 }
1162 
1163 bool PluginManager::RegisterPlugin(
1164  llvm::StringRef name, llvm::StringRef description,
1165  UnwindAssemblyCreateInstance create_callback) {
1166  return GetUnwindAssemblyInstances().RegisterPlugin(name, description,
1167  create_callback);
1168 }
1169 
1170 bool PluginManager::UnregisterPlugin(
1171  UnwindAssemblyCreateInstance create_callback) {
1172  return GetUnwindAssemblyInstances().UnregisterPlugin(create_callback);
1173 }
1174 
1175 UnwindAssemblyCreateInstance
1176 PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(uint32_t idx) {
1178 }
1179 
1180 #pragma mark MemoryHistory
1181 
1184 
1186  static MemoryHistoryInstances g_instances;
1187  return g_instances;
1188 }
1189 
1190 bool PluginManager::RegisterPlugin(
1191  llvm::StringRef name, llvm::StringRef description,
1192  MemoryHistoryCreateInstance create_callback) {
1193  return GetMemoryHistoryInstances().RegisterPlugin(name, description,
1194  create_callback);
1195 }
1196 
1197 bool PluginManager::UnregisterPlugin(
1198  MemoryHistoryCreateInstance create_callback) {
1199  return GetMemoryHistoryInstances().UnregisterPlugin(create_callback);
1200 }
1201 
1202 MemoryHistoryCreateInstance
1203 PluginManager::GetMemoryHistoryCreateCallbackAtIndex(uint32_t idx) {
1205 }
1206 
1207 #pragma mark InstrumentationRuntime
1208 
1210  : public PluginInstance<InstrumentationRuntimeCreateInstance> {
1212  llvm::StringRef name, llvm::StringRef description,
1213  CallbackType create_callback,
1214  InstrumentationRuntimeGetType get_type_callback)
1216  create_callback),
1217  get_type_callback(get_type_callback) {}
1218 
1219  InstrumentationRuntimeGetType get_type_callback = nullptr;
1220 };
1221 
1224 
1226  static InstrumentationRuntimeInstances g_instances;
1227  return g_instances;
1228 }
1229 
1230 bool PluginManager::RegisterPlugin(
1231  llvm::StringRef name, llvm::StringRef description,
1232  InstrumentationRuntimeCreateInstance create_callback,
1233  InstrumentationRuntimeGetType get_type_callback) {
1235  name, description, create_callback, get_type_callback);
1236 }
1237 
1238 bool PluginManager::UnregisterPlugin(
1239  InstrumentationRuntimeCreateInstance create_callback) {
1240  return GetInstrumentationRuntimeInstances().UnregisterPlugin(create_callback);
1241 }
1242 
1243 InstrumentationRuntimeGetType
1244 PluginManager::GetInstrumentationRuntimeGetTypeCallbackAtIndex(uint32_t idx) {
1245  const auto &instances = GetInstrumentationRuntimeInstances().GetInstances();
1246  if (idx < instances.size())
1247  return instances[idx].get_type_callback;
1248  return nullptr;
1249 }
1250 
1252 PluginManager::GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx) {
1254 }
1255 
1256 #pragma mark TypeSystem
1257 
1258 struct TypeSystemInstance : public PluginInstance<TypeSystemCreateInstance> {
1259  TypeSystemInstance(llvm::StringRef name, llvm::StringRef description,
1260  CallbackType create_callback,
1261  LanguageSet supported_languages_for_types,
1262  LanguageSet supported_languages_for_expressions)
1263  : PluginInstance<TypeSystemCreateInstance>(name, description,
1264  create_callback),
1265  supported_languages_for_types(supported_languages_for_types),
1266  supported_languages_for_expressions(
1267  supported_languages_for_expressions) {}
1268 
1271 };
1272 
1274 
1276  static TypeSystemInstances g_instances;
1277  return g_instances;
1278 }
1279 
1280 bool PluginManager::RegisterPlugin(
1281  llvm::StringRef name, llvm::StringRef description,
1282  TypeSystemCreateInstance create_callback,
1283  LanguageSet supported_languages_for_types,
1284  LanguageSet supported_languages_for_expressions) {
1286  name, description, create_callback, supported_languages_for_types,
1287  supported_languages_for_expressions);
1288 }
1289 
1290 bool PluginManager::UnregisterPlugin(TypeSystemCreateInstance create_callback) {
1291  return GetTypeSystemInstances().UnregisterPlugin(create_callback);
1292 }
1293 
1295 PluginManager::GetTypeSystemCreateCallbackAtIndex(uint32_t idx) {
1297 }
1298 
1299 LanguageSet PluginManager::GetAllTypeSystemSupportedLanguagesForTypes() {
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_types.bitvector;
1304  return all;
1305 }
1306 
1307 LanguageSet PluginManager::GetAllTypeSystemSupportedLanguagesForExpressions() {
1308  const auto &instances = GetTypeSystemInstances().GetInstances();
1309  LanguageSet all;
1310  for (unsigned i = 0; i < instances.size(); ++i)
1311  all.bitvector |= instances[i].supported_languages_for_expressions.bitvector;
1312  return all;
1313 }
1314 
1315 #pragma mark REPL
1316 
1317 struct REPLInstance : public PluginInstance<REPLCreateInstance> {
1318  REPLInstance(llvm::StringRef name, llvm::StringRef description,
1319  CallbackType create_callback, LanguageSet supported_languages)
1320  : PluginInstance<REPLCreateInstance>(name, description, create_callback),
1321  supported_languages(supported_languages) {}
1322 
1324 };
1325 
1327 
1329  static REPLInstances g_instances;
1330  return g_instances;
1331 }
1332 
1333 bool PluginManager::RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
1334  REPLCreateInstance create_callback,
1335  LanguageSet supported_languages) {
1336  return GetREPLInstances().RegisterPlugin(name, description, create_callback,
1337  supported_languages);
1338 }
1339 
1340 bool PluginManager::UnregisterPlugin(REPLCreateInstance create_callback) {
1341  return GetREPLInstances().UnregisterPlugin(create_callback);
1342 }
1343 
1344 REPLCreateInstance PluginManager::GetREPLCreateCallbackAtIndex(uint32_t idx) {
1345  return GetREPLInstances().GetCallbackAtIndex(idx);
1346 }
1347 
1348 LanguageSet PluginManager::GetREPLSupportedLanguagesAtIndex(uint32_t idx) {
1349  const auto &instances = GetREPLInstances().GetInstances();
1350  return idx < instances.size() ? instances[idx].supported_languages
1351  : LanguageSet();
1352 }
1353 
1354 LanguageSet PluginManager::GetREPLAllTypeSystemSupportedLanguages() {
1355  const auto &instances = GetREPLInstances().GetInstances();
1356  LanguageSet all;
1357  for (unsigned i = 0; i < instances.size(); ++i)
1358  all.bitvector |= instances[i].supported_languages.bitvector;
1359  return all;
1360 }
1361 
1362 #pragma mark PluginManager
1363 
1364 void PluginManager::DebuggerInitialize(Debugger &debugger) {
1373 }
1374 
1375 // This is the preferred new way to register plugin specific settings. e.g.
1376 // This will put a plugin's settings under e.g.
1377 // "plugin.<plugin_type_name>.<plugin_type_desc>.SETTINGNAME".
1378 static lldb::OptionValuePropertiesSP
1380  ConstString plugin_type_desc, bool can_create) {
1381  lldb::OptionValuePropertiesSP parent_properties_sp(
1382  debugger.GetValueProperties());
1383  if (parent_properties_sp) {
1384  static ConstString g_property_name("plugin");
1385 
1386  OptionValuePropertiesSP plugin_properties_sp =
1387  parent_properties_sp->GetSubProperty(nullptr, g_property_name);
1388  if (!plugin_properties_sp && can_create) {
1389  plugin_properties_sp =
1390  std::make_shared<OptionValueProperties>(g_property_name);
1391  parent_properties_sp->AppendProperty(
1392  g_property_name, ConstString("Settings specify to plugins."), true,
1393  plugin_properties_sp);
1394  }
1395 
1396  if (plugin_properties_sp) {
1397  lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1398  plugin_properties_sp->GetSubProperty(nullptr, plugin_type_name);
1399  if (!plugin_type_properties_sp && can_create) {
1400  plugin_type_properties_sp =
1401  std::make_shared<OptionValueProperties>(plugin_type_name);
1402  plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1403  true, plugin_type_properties_sp);
1404  }
1405  return plugin_type_properties_sp;
1406  }
1407  }
1408  return lldb::OptionValuePropertiesSP();
1409 }
1410 
1411 // This is deprecated way to register plugin specific settings. e.g.
1412 // "<plugin_type_name>.plugin.<plugin_type_desc>.SETTINGNAME" and Platform
1413 // generic settings would be under "platform.SETTINGNAME".
1414 static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPluginsOldStyle(
1415  Debugger &debugger, ConstString plugin_type_name,
1416  ConstString plugin_type_desc, bool can_create) {
1417  static ConstString g_property_name("plugin");
1418  lldb::OptionValuePropertiesSP parent_properties_sp(
1419  debugger.GetValueProperties());
1420  if (parent_properties_sp) {
1421  OptionValuePropertiesSP plugin_properties_sp =
1422  parent_properties_sp->GetSubProperty(nullptr, plugin_type_name);
1423  if (!plugin_properties_sp && can_create) {
1424  plugin_properties_sp =
1425  std::make_shared<OptionValueProperties>(plugin_type_name);
1426  parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1427  true, plugin_properties_sp);
1428  }
1429 
1430  if (plugin_properties_sp) {
1431  lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1432  plugin_properties_sp->GetSubProperty(nullptr, g_property_name);
1433  if (!plugin_type_properties_sp && can_create) {
1434  plugin_type_properties_sp =
1435  std::make_shared<OptionValueProperties>(g_property_name);
1436  plugin_properties_sp->AppendProperty(
1437  g_property_name, ConstString("Settings specific to plugins"), true,
1438  plugin_type_properties_sp);
1439  }
1440  return plugin_type_properties_sp;
1441  }
1442  }
1443  return lldb::OptionValuePropertiesSP();
1444 }
1445 
1446 namespace {
1447 
1448 typedef lldb::OptionValuePropertiesSP
1449 GetDebuggerPropertyForPluginsPtr(Debugger &, ConstString, ConstString,
1450  bool can_create);
1451 }
1452 
1453 static lldb::OptionValuePropertiesSP
1454 GetSettingForPlugin(Debugger &debugger, ConstString setting_name,
1455  ConstString plugin_type_name,
1456  GetDebuggerPropertyForPluginsPtr get_debugger_property =
1458  lldb::OptionValuePropertiesSP properties_sp;
1459  lldb::OptionValuePropertiesSP plugin_type_properties_sp(get_debugger_property(
1460  debugger, plugin_type_name,
1461  ConstString(), // not creating to so we don't need the description
1462  false));
1463  if (plugin_type_properties_sp)
1464  properties_sp =
1465  plugin_type_properties_sp->GetSubProperty(nullptr, setting_name);
1466  return properties_sp;
1467 }
1468 
1469 static bool
1470 CreateSettingForPlugin(Debugger &debugger, ConstString plugin_type_name,
1471  ConstString plugin_type_desc,
1472  const lldb::OptionValuePropertiesSP &properties_sp,
1473  ConstString description, bool is_global_property,
1474  GetDebuggerPropertyForPluginsPtr get_debugger_property =
1476  if (properties_sp) {
1477  lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1478  get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
1479  true));
1480  if (plugin_type_properties_sp) {
1481  plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1482  description, is_global_property,
1483  properties_sp);
1484  return true;
1485  }
1486  }
1487  return false;
1488 }
1489 
1490 static const char *kDynamicLoaderPluginName("dynamic-loader");
1491 static const char *kPlatformPluginName("platform");
1492 static const char *kProcessPluginName("process");
1493 static const char *kSymbolFilePluginName("symbol-file");
1494 static const char *kJITLoaderPluginName("jit-loader");
1495 static const char *kStructuredDataPluginName("structured-data");
1496 
1497 lldb::OptionValuePropertiesSP
1498 PluginManager::GetSettingForDynamicLoaderPlugin(Debugger &debugger,
1499  ConstString setting_name) {
1500  return GetSettingForPlugin(debugger, setting_name,
1502 }
1503 
1504 bool PluginManager::CreateSettingForDynamicLoaderPlugin(
1505  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1506  ConstString description, bool is_global_property) {
1507  return CreateSettingForPlugin(
1509  ConstString("Settings for dynamic loader plug-ins"), properties_sp,
1510  description, is_global_property);
1511 }
1512 
1513 lldb::OptionValuePropertiesSP
1514 PluginManager::GetSettingForPlatformPlugin(Debugger &debugger,
1515  ConstString setting_name) {
1516  return GetSettingForPlugin(debugger, setting_name,
1519 }
1520 
1521 bool PluginManager::CreateSettingForPlatformPlugin(
1522  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1523  ConstString description, bool is_global_property) {
1525  ConstString("Settings for platform plug-ins"),
1526  properties_sp, description, is_global_property,
1528 }
1529 
1530 lldb::OptionValuePropertiesSP
1531 PluginManager::GetSettingForProcessPlugin(Debugger &debugger,
1532  ConstString setting_name) {
1533  return GetSettingForPlugin(debugger, setting_name,
1535 }
1536 
1537 bool PluginManager::CreateSettingForProcessPlugin(
1538  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1539  ConstString description, bool is_global_property) {
1541  ConstString("Settings for process plug-ins"),
1542  properties_sp, description, is_global_property);
1543 }
1544 
1545 lldb::OptionValuePropertiesSP
1546 PluginManager::GetSettingForSymbolFilePlugin(Debugger &debugger,
1547  ConstString setting_name) {
1548  return GetSettingForPlugin(debugger, setting_name,
1550 }
1551 
1552 bool PluginManager::CreateSettingForSymbolFilePlugin(
1553  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1554  ConstString description, bool is_global_property) {
1555  return CreateSettingForPlugin(
1557  ConstString("Settings for symbol file plug-ins"), properties_sp,
1558  description, is_global_property);
1559 }
1560 
1561 lldb::OptionValuePropertiesSP
1562 PluginManager::GetSettingForJITLoaderPlugin(Debugger &debugger,
1563  ConstString setting_name) {
1564  return GetSettingForPlugin(debugger, setting_name,
1566 }
1567 
1568 bool PluginManager::CreateSettingForJITLoaderPlugin(
1569  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1570  ConstString description, bool is_global_property) {
1572  ConstString("Settings for JIT loader plug-ins"),
1573  properties_sp, description, is_global_property);
1574 }
1575 
1576 static const char *kOperatingSystemPluginName("os");
1577 
1578 lldb::OptionValuePropertiesSP
1579 PluginManager::GetSettingForOperatingSystemPlugin(Debugger &debugger,
1580  ConstString setting_name) {
1581  lldb::OptionValuePropertiesSP properties_sp;
1582  lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1585  ConstString(), // not creating to so we don't need the description
1586  false));
1587  if (plugin_type_properties_sp)
1588  properties_sp =
1589  plugin_type_properties_sp->GetSubProperty(nullptr, setting_name);
1590  return properties_sp;
1591 }
1592 
1593 bool PluginManager::CreateSettingForOperatingSystemPlugin(
1594  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1595  ConstString description, bool is_global_property) {
1596  if (properties_sp) {
1597  lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1600  ConstString("Settings for operating system plug-ins"), true));
1601  if (plugin_type_properties_sp) {
1602  plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1603  description, is_global_property,
1604  properties_sp);
1605  return true;
1606  }
1607  }
1608  return false;
1609 }
1610 
1611 lldb::OptionValuePropertiesSP
1612 PluginManager::GetSettingForStructuredDataPlugin(Debugger &debugger,
1613  ConstString setting_name) {
1614  return GetSettingForPlugin(debugger, setting_name,
1616 }
1617 
1618 bool PluginManager::CreateSettingForStructuredDataPlugin(
1619  Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
1620  ConstString description, bool is_global_property) {
1621  return CreateSettingForPlugin(
1623  ConstString("Settings for structured data plug-ins"), properties_sp,
1624  description, is_global_property);
1625 }
OperatingSystemInstances
PluginInstances< OperatingSystemInstance > OperatingSystemInstances
Definition: PluginManager.cpp:470
TypeSystemInstance::supported_languages_for_expressions
LanguageSet supported_languages_for_expressions
Definition: PluginManager.cpp:1270
GetMemoryHistoryInstances
static MemoryHistoryInstances & GetMemoryHistoryInstances()
Definition: PluginManager.cpp:1185
LanguageRuntimeCreateInstance
GetDisassemblerInstances
static DisassemblerInstances & GetDisassemblerInstances()
Definition: PluginManager.cpp:344
MemoryHistoryInstance
PluginInstance< MemoryHistoryCreateInstance > MemoryHistoryInstance
Definition: PluginManager.cpp:1182
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:1112
FileSystem.h
ObjectContainerInstance::ObjectContainerInstance
ObjectContainerInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, ObjectFileGetModuleSpecifications get_module_specifications)
Definition: PluginManager.cpp:722
TypeSystemInstances
PluginInstances< TypeSystemInstance > TypeSystemInstances
Definition: PluginManager.cpp:1273
ScriptInterpreterInstance::ScriptInterpreterInstance
ScriptInterpreterInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, lldb::ScriptLanguage language)
Definition: PluginManager.cpp:867
GetPluginMapMutex
static std::recursive_mutex & GetPluginMapMutex()
Definition: PluginManager.cpp:51
ABIInstances
PluginInstances< ABIInstance > ABIInstances
Definition: PluginManager.cpp:280
kSymbolFilePluginName
static const char * kSymbolFilePluginName("symbol-file")
PluginTerminateMap
std::map< FileSpec, PluginInfo > PluginTerminateMap
Definition: PluginManager.cpp:49
GetREPLInstances
static REPLInstances & GetREPLInstances()
Definition: PluginManager.cpp:1328
GetTraceExporterInstances
static TraceExporterInstances & GetTraceExporterInstances()
Definition: PluginManager.cpp:1117
GetJITLoaderInstances
static JITLoaderInstances & GetJITLoaderInstances()
Definition: PluginManager.cpp:411
ObjectFileInstance::ObjectFileInstance
ObjectFileInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, ObjectFileCreateMemoryInstance create_memory_callback, ObjectFileGetModuleSpecifications get_module_specifications, ObjectFileSaveCore save_core)
Definition: PluginManager.cpp:619
TypeSystemCreateInstance
LanguageRuntimeInstance
Definition: PluginManager.cpp:529
kJITLoaderPluginName
static const char * kJITLoaderPluginName("jit-loader")
PluginInstance::create_callback
Callback create_callback
Definition: PluginManager.cpp:196
GetSettingForPlugin
static lldb::OptionValuePropertiesSP GetSettingForPlugin(Debugger &debugger, ConstString setting_name, ConstString plugin_type_name, GetDebuggerPropertyForPluginsPtr get_debugger_property=GetDebuggerPropertyForPlugins)
Definition: PluginManager.cpp:1454
SymbolFileInstance
PluginInstance< SymbolFileCreateInstance > SymbolFileInstance
Definition: PluginManager.cpp:979
DisassemblerInstances
PluginInstances< DisassemblerInstance > DisassemblerInstances
Definition: PluginManager.cpp:342
GetObjectFileInstances
static ObjectFileInstances & GetObjectFileInstances()
Definition: PluginManager.cpp:637
GetDebuggerPropertyForPluginsOldStyle
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPluginsOldStyle(Debugger &debugger, ConstString plugin_type_name, ConstString plugin_type_desc, bool can_create)
Definition: PluginManager.cpp:1414
kPlatformPluginName
static const char * kPlatformPluginName("platform")
StructuredDataPluginInstances
PluginInstances< StructuredDataPluginInstance > StructuredDataPluginInstances
Definition: PluginManager.cpp:937
ObjectContainerInstance::get_module_specifications
ObjectFileGetModuleSpecifications get_module_specifications
Definition: PluginManager.cpp:730
EmulateInstructionInstance
PluginInstance< EmulateInstructionCreateInstance > EmulateInstructionInstance
Definition: PluginManager.cpp:436
PluginTermCallback
void(* PluginTermCallback)()
Definition: PluginManager.cpp:39
StructuredDataPluginCreateInstance
CreateSettingForPlugin
static bool CreateSettingForPlugin(Debugger &debugger, ConstString plugin_type_name, ConstString plugin_type_desc, const lldb::OptionValuePropertiesSP &properties_sp, ConstString description, bool is_global_property, GetDebuggerPropertyForPluginsPtr get_debugger_property=GetDebuggerPropertyForPlugins)
Definition: PluginManager.cpp:1470
REPLInstance
Definition: PluginManager.cpp:1317
CastToFPtr
static FPtrTy CastToFPtr(void *VPtr)
Definition: PluginManager.cpp:75
PluginInstances::m_instances
std::vector< Instance > m_instances
Definition: PluginManager.cpp:274
InstrumentationRuntimeCreateInstance
lldb_private::Args
Definition: Args.h:33
PluginInstances::RegisterPlugin
bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, typename Instance::CallbackType callback, Args &&...args)
Definition: PluginManager.cpp:203
GetDynamicLoaderInstances
static DynamicLoaderInstances & GetDynamicLoaderInstances()
Definition: PluginManager.cpp:377
Debugger.h
LanguageRuntimeInstance::command_callback
LanguageRuntimeGetCommandObject command_callback
Definition: PluginManager.cpp:542
PluginInstances::GetInstances
const std::vector< Instance > & GetInstances() const
Definition: PluginManager.cpp:264
TraceCreateInstanceForSessionFile
LanguageRuntimeInstances
PluginInstances< LanguageRuntimeInstance > LanguageRuntimeInstances
Definition: PluginManager.cpp:546
Process.h
GetPlatformInstances
static PlatformInstances & GetPlatformInstances()
Definition: PluginManager.cpp:771
kStructuredDataPluginName
static const char * kStructuredDataPluginName("structured-data")
lldb::eScriptLanguageNone
@ eScriptLanguageNone
Definition: lldb-enumerations.h:217
GetLanguageRuntimeInstances
static LanguageRuntimeInstances & GetLanguageRuntimeInstances()
Definition: PluginManager.cpp:548
GetSymbolVendorInstances
static SymbolVendorInstances & GetSymbolVendorInstances()
Definition: PluginManager.cpp:1009
SymbolVendorInstance
PluginInstance< SymbolVendorCreateInstance > SymbolVendorInstance
Definition: PluginManager.cpp:1006
PluginInstances
Definition: PluginManager.cpp:200
PluginInfo
Definition: PluginManager.cpp:41
TraceInstances
PluginInstances< TraceInstance > TraceInstances
Definition: PluginManager.cpp:1049
ObjectFileInstances
PluginInstances< ObjectFileInstance > ObjectFileInstances
Definition: PluginManager.cpp:635
GetUnwindAssemblyInstances
static UnwindAssemblyInstances & GetUnwindAssemblyInstances()
Definition: PluginManager.cpp:1158
lldb_private::FileSpec
Definition: FileSpec.h:56
ObjectFileInstance::save_core
ObjectFileSaveCore save_core
Definition: PluginManager.cpp:633
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
GetStructuredDataPluginInstances
static StructuredDataPluginInstances & GetStructuredDataPluginInstances()
Definition: PluginManager.cpp:939
UnwindAssemblyInstance
PluginInstance< UnwindAssemblyCreateInstance > UnwindAssemblyInstance
Definition: PluginManager.cpp:1155
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:229
TypeSystemInstance::TypeSystemInstance
TypeSystemInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, LanguageSet supported_languages_for_types, LanguageSet supported_languages_for_expressions)
Definition: PluginManager.cpp:1259
PluginInstance::name
llvm::StringRef name
Definition: PluginManager.cpp:194
GetScriptInterpreterInstances
static ScriptInterpreterInstances & GetScriptInterpreterInstances()
Definition: PluginManager.cpp:879
REPLInstance::supported_languages
LanguageSet supported_languages
Definition: PluginManager.cpp:1323
GetTracePluginInstances
static TraceInstances & GetTracePluginInstances()
Definition: PluginManager.cpp:1051
PluginInstances::UnregisterPlugin
bool UnregisterPlugin(typename Instance::CallbackType callback)
Definition: PluginManager.cpp:215
JITLoaderInstances
PluginInstances< JITLoaderInstance > JITLoaderInstances
Definition: PluginManager.cpp:409
ArchitectureInstance
PluginInstance< ArchitectureCreateInstance > ArchitectureInstance
Definition: PluginManager.cpp:303
GetProcessInstances
static ProcessInstances & GetProcessInstances()
Definition: PluginManager.cpp:820
GetTypeSystemInstances
static TypeSystemInstances & GetTypeSystemInstances()
Definition: PluginManager.cpp:1275
DynamicLoaderInstances
PluginInstances< DynamicLoaderInstance > DynamicLoaderInstances
Definition: PluginManager.cpp:375
ObjectContainerInstances
PluginInstances< ObjectContainerInstance > ObjectContainerInstances
Definition: PluginManager.cpp:732
lldb_private::FileSystem::EnumerateDirectoryResult
EnumerateDirectoryResult
Definition: FileSystem.h:166
OperatingSystemInstance
PluginInstance< OperatingSystemCreateInstance > OperatingSystemInstance
Definition: PluginManager.cpp:469
LanguageRuntimeInstance::precondition_callback
LanguageRuntimeGetExceptionPrecondition precondition_callback
Definition: PluginManager.cpp:543
TypeSystemInstance::supported_languages_for_types
LanguageSet supported_languages_for_types
Definition: PluginManager.cpp:1269
TraceInstance::TraceInstance
TraceInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback_for_session_file, TraceCreateInstanceForLiveProcess create_callback_for_live_process, llvm::StringRef schema)
Definition: PluginManager.cpp:1035
lldb_private::ConstString
Definition: ConstString.h:40
TraceInstance::schema
llvm::StringRef schema
Definition: PluginManager.cpp:1045
SymbolFileInstances
PluginInstances< SymbolFileInstance > SymbolFileInstances
Definition: PluginManager.cpp:980
GetLanguageInstances
static LanguageInstances & GetLanguageInstances()
Definition: PluginManager.cpp:506
TraceInstance
Definition: PluginManager.cpp:1033
SymbolVendorInstances
PluginInstances< SymbolVendorInstance > SymbolVendorInstances
Definition: PluginManager.cpp:1007
PluginInstances::PerformDebuggerCallback
void PerformDebuggerCallback(Debugger &debugger)
Definition: PluginManager.cpp:257
PlatformInstances
PluginInstances< PlatformInstance > PlatformInstances
Definition: PluginManager.cpp:769
ScriptInterpreterCreateInstance
ObjectContainerCreateInstance
PluginInstance
Definition: PluginManager.cpp:184
TypeSystemInstance
Definition: PluginManager.cpp:1258
PluginInstances::GetDescriptionAtIndex
llvm::StringRef GetDescriptionAtIndex(uint32_t idx)
Definition: PluginManager.cpp:235
GetABIInstances
static ABIInstances & GetABIInstances()
Definition: PluginManager.cpp:282
InstrumentationRuntimeInstance::InstrumentationRuntimeInstance
InstrumentationRuntimeInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, InstrumentationRuntimeGetType get_type_callback)
Definition: PluginManager.cpp:1211
GetEmulateInstructionInstances
static EmulateInstructionInstances & GetEmulateInstructionInstances()
Definition: PluginManager.cpp:439
lldb_private::Debugger
Definition: Debugger.h:72
HostInfo.h
UnwindAssemblyInstances
PluginInstances< UnwindAssemblyInstance > UnwindAssemblyInstances
Definition: PluginManager.cpp:1156
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
StringList.h
ProcessInstance
PluginInstance< ProcessCreateInstance > ProcessInstance
Definition: PluginManager.cpp:817
PluginInfo::plugin_term_callback
PluginTermCallback plugin_term_callback
Definition: PluginManager.cpp:46
ObjectFileInstance::get_module_specifications
ObjectFileGetModuleSpecifications get_module_specifications
Definition: PluginManager.cpp:632
ScriptInterpreterInstance
Definition: PluginManager.cpp:865
StructuredDataPluginInstance
Definition: PluginManager.cpp:922
OptionValueProperties.h
PluginInstance::PluginInstance
PluginInstance(llvm::StringRef name, llvm::StringRef description, Callback create_callback, DebuggerInitializeCallback debugger_init_callback=nullptr)
Definition: PluginManager.cpp:188
TraceExporterInstance
Definition: PluginManager.cpp:1101
SystemRuntimeInstance
PluginInstance< SystemRuntimeCreateInstance > SystemRuntimeInstance
Definition: PluginManager.cpp:591
PluginInstance::description
llvm::StringRef description
Definition: PluginManager.cpp:195
ObjectFileInstance
Definition: PluginManager.cpp:618
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:1115
PosixApi.h
LanguageRuntimeInstance::LanguageRuntimeInstance
LanguageRuntimeInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, DebuggerInitializeCallback debugger_init_callback, LanguageRuntimeGetCommandObject command_callback, LanguageRuntimeGetExceptionPrecondition precondition_callback)
Definition: PluginManager.cpp:531
StructuredDataPluginInstance::StructuredDataPluginInstance
StructuredDataPluginInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, DebuggerInitializeCallback debugger_init_callback, StructuredDataFilterLaunchInfo filter_callback)
Definition: PluginManager.cpp:924
lldb_private::Status
Definition: Status.h:44
TraceExporterInstance::TraceExporterInstance
TraceExporterInstance(llvm::StringRef name, llvm::StringRef description, TraceExporterCreateInstance create_instance, ThreadTraceExportCommandCreator create_thread_trace_export_command)
Definition: PluginManager.cpp:1103
PluginInfo::plugin_init_callback
PluginInitCallback plugin_init_callback
Definition: PluginManager.cpp:45
ObjectFileInstance::create_memory_callback
ObjectFileCreateMemoryInstance create_memory_callback
Definition: PluginManager.cpp:631
GetSystemRuntimeInstances
static SystemRuntimeInstances & GetSystemRuntimeInstances()
Definition: PluginManager.cpp:594
LanguageInstance
PluginInstance< LanguageCreateInstance > LanguageInstance
Definition: PluginManager.cpp:503
uint32_t
SystemRuntimeInstances
PluginInstances< SystemRuntimeInstance > SystemRuntimeInstances
Definition: PluginManager.cpp:592
GetPluginMap
static PluginTerminateMap & GetPluginMap()
Definition: PluginManager.cpp:56
LanguageInstances
PluginInstances< LanguageInstance > LanguageInstances
Definition: PluginManager.cpp:504
GetOperatingSystemInstances
static OperatingSystemInstances & GetOperatingSystemInstances()
Definition: PluginManager.cpp:472
InstrumentationRuntimeInstances
PluginInstances< InstrumentationRuntimeInstance > InstrumentationRuntimeInstances
Definition: PluginManager.cpp:1223
REPLInstances
PluginInstances< REPLInstance > REPLInstances
Definition: PluginManager.cpp:1326
DynamicLoaderInstance
PluginInstance< DynamicLoaderCreateInstance > DynamicLoaderInstance
Definition: PluginManager.cpp:374
lldb::SaveCoreStyle
SaveCoreStyle
Definition: lldb-enumerations.h:1137
PluginInitCallback
bool(* PluginInitCallback)()
Definition: PluginManager.cpp:38
GetArchitectureInstances
static ArchitectureInstances & GetArchitectureInstances()
Definition: PluginManager.cpp:306
kProcessPluginName
static const char * kProcessPluginName("process")
PluginManager.h
kOperatingSystemPluginName
static const char * kOperatingSystemPluginName("os")
Status.h
JITLoaderInstance
PluginInstance< JITLoaderCreateInstance > JITLoaderInstance
Definition: PluginManager.cpp:408
InstrumentationRuntimeInstance
Definition: PluginManager.cpp:1209
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:818
GetInstrumentationRuntimeInstances
static InstrumentationRuntimeInstances & GetInstrumentationRuntimeInstances()
Definition: PluginManager.cpp:1225
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
PluginInstance::debugger_init_callback
DebuggerInitializeCallback debugger_init_callback
Definition: PluginManager.cpp:197
ConstString.h
MemoryHistoryInstances
PluginInstances< MemoryHistoryInstance > MemoryHistoryInstances
Definition: PluginManager.cpp:1183
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:877
DisassemblerInstance
PluginInstance< DisassemblerCreateInstance > DisassemblerInstance
Definition: PluginManager.cpp:341
EmulateInstructionInstances
PluginInstances< EmulateInstructionInstance > EmulateInstructionInstances
Definition: PluginManager.cpp:437
ObjectContainerInstance
Definition: PluginManager.cpp:720
PluginInstances::GetCallbackForName
Instance::CallbackType GetCallbackForName(llvm::StringRef name)
Definition: PluginManager.cpp:247
ArchitectureInstances
std::vector< ArchitectureInstance > ArchitectureInstances
Definition: PluginManager.cpp:304
TraceInstance::create_callback_for_live_process
TraceCreateInstanceForLiveProcess create_callback_for_live_process
Definition: PluginManager.cpp:1046
PluginInfo::library
llvm::sys::DynamicLibrary library
Definition: PluginManager.cpp:44
REPLCreateInstance
GetSymbolFileInstances
static SymbolFileInstances & GetSymbolFileInstances()
Definition: PluginManager.cpp:982
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:347
TraceExporterCreateInstance
lldb
Definition: SBAddress.h:15
GetObjectContainerInstances
static ObjectContainerInstances & GetObjectContainerInstances()
Definition: PluginManager.cpp:734
GetDebuggerPropertyForPlugins
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPlugins(Debugger &debugger, ConstString plugin_type_name, ConstString plugin_type_desc, bool can_create)
Definition: PluginManager.cpp:1379
SetPluginInfo
static void SetPluginInfo(const FileSpec &plugin_file_spec, const PluginInfo &plugin_info)
Definition: PluginManager.cpp:67
ABIInstance
PluginInstance< ABICreateInstance > ABIInstance
Definition: PluginManager.cpp:279
PluginInstances::GetInstanceAtIndex
Instance * GetInstanceAtIndex(uint32_t idx)
Definition: PluginManager.cpp:267
PluginInstances::GetInstances
std::vector< Instance > & GetInstances()
Definition: PluginManager.cpp:265
kDynamicLoaderPluginName
static const char * kDynamicLoaderPluginName("dynamic-loader")
lldb_private::CompletionRequest
Definition: CompletionRequest.h:100
PlatformInstance
PluginInstance< PlatformCreateInstance > PlatformInstance
Definition: PluginManager.cpp:768
DebuggerInitializeCallback
REPLInstance::REPLInstance
REPLInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, LanguageSet supported_languages)
Definition: PluginManager.cpp:1318
PluginInstances::GetNameAtIndex
llvm::StringRef GetNameAtIndex(uint32_t idx)
Definition: PluginManager.cpp:241