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"
52 static std::recursive_mutex g_plugin_map_mutex;
53 return g_plugin_map_mutex;
64 return plugin_map.find(plugin_file_spec) != plugin_map.end();
71 assert(plugin_map.find(plugin_file_spec) == plugin_map.end());
72 plugin_map[plugin_file_spec] = plugin_info;
75template <
typename FPtrTy>
static FPtrTy
CastToFPtr(
void *VPtr) {
76 return reinterpret_cast<FPtrTy
>(VPtr);
81 llvm::StringRef path) {
84 namespace fs = llvm::sys::fs;
89 if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||
90 ft == fs::file_type::type_unknown) {
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;
105 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginInitialize"));
114 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginTerminate"));
132 if (ft == fs::file_type::directory_file ||
133 ft == fs::file_type::symlink_file || ft == fs::file_type::type_unknown) {
145 const bool find_directories =
true;
146 const bool find_files =
true;
147 const bool find_other =
true;
149 if (
FileSpec dir_spec = HostInfo::GetSystemPluginDir()) {
151 dir_spec.GetPath(dir_path,
sizeof(dir_path))) {
153 find_files, find_other,
158 if (
FileSpec dir_spec = HostInfo::GetUserPluginDir()) {
160 dir_spec.GetPath(dir_path,
sizeof(dir_path))) {
162 find_files, find_other,
172 PluginTerminateMap::const_iterator pos, end = plugin_map.end();
173 for (pos = plugin_map.begin(); pos != end; ++pos) {
176 if (pos->second.library.isValid()) {
177 if (pos->second.plugin_term_callback)
178 pos->second.plugin_term_callback();
189 Callback create_callback,
191 : name(name), description(description), create_callback(create_callback),
192 debugger_init_callback(debugger_init_callback) {}
202 template <
typename...
Args>
204 typename Instance::CallbackType callback,
208 assert(!name.empty());
210 Instance(name, description, callback, std::forward<Args>(args)...);
211 m_instances.push_back(instance);
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);
230 if (Instance *instance = GetInstanceAtIndex(idx))
231 return instance->create_callback;
236 if (Instance *instance = GetInstanceAtIndex(idx))
237 return instance->description;
242 if (Instance *instance = GetInstanceAtIndex(idx))
243 return instance->name;
250 for (
auto &instance : m_instances) {
251 if (name == instance.name)
252 return instance.create_callback;
258 for (
auto &instance : m_instances) {
259 if (instance.debugger_init_callback)
260 instance.debugger_init_callback(debugger);
264 const std::vector<Instance> &
GetInstances()
const {
return m_instances; }
268 if (idx < m_instances.size())
269 return &m_instances[idx];
288 llvm::StringRef description,
289 ABICreateInstance create_callback) {
301#pragma mark Architecture
312 llvm::StringRef description,
313 ArchitectureCreateInstance create_callback) {
318 ArchitectureCreateInstance create_callback) {
321 for (
auto pos = instances.begin(), end = instances.end(); pos != end; ++pos) {
322 if (pos->create_callback == create_callback) {
323 instances.erase(pos);
327 llvm_unreachable(
"Plugin not found");
330std::unique_ptr<Architecture>
333 if (
auto plugin_up = instances.create_callback(arch))
339#pragma mark Disassembler
350 llvm::StringRef description,
351 DisassemblerCreateInstance create_callback) {
357 DisassemblerCreateInstance create_callback) {
361DisassemblerCreateInstance
366DisassemblerCreateInstance
368 llvm::StringRef name) {
372#pragma mark DynamicLoader
383 llvm::StringRef name, llvm::StringRef description,
384 DynamicLoaderCreateInstance create_callback,
387 name, description, create_callback, debugger_init_callback);
391 DynamicLoaderCreateInstance create_callback) {
395DynamicLoaderCreateInstance
400DynamicLoaderCreateInstance
402 llvm::StringRef name) {
406#pragma mark JITLoader
417 llvm::StringRef name, llvm::StringRef description,
418 JITLoaderCreateInstance create_callback,
421 name, description, create_callback, debugger_init_callback);
428JITLoaderCreateInstance
433#pragma mark EmulateInstruction
445 llvm::StringRef name, llvm::StringRef description,
446 EmulateInstructionCreateInstance create_callback) {
452 EmulateInstructionCreateInstance create_callback) {
456EmulateInstructionCreateInstance
461EmulateInstructionCreateInstance
463 llvm::StringRef name) {
467#pragma mark OperatingSystem
478 llvm::StringRef name, llvm::StringRef description,
479 OperatingSystemCreateInstance create_callback,
482 name, description, create_callback, debugger_init_callback);
486 OperatingSystemCreateInstance create_callback) {
490OperatingSystemCreateInstance
495OperatingSystemCreateInstance
497 llvm::StringRef name) {
512 llvm::StringRef description,
513 LanguageCreateInstance create_callback) {
522LanguageCreateInstance
527#pragma mark LanguageRuntime
532 llvm::StringRef name, llvm::StringRef description,
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) {}
554 llvm::StringRef name, llvm::StringRef description,
556 LanguageRuntimeGetCommandObject command_callback,
557 LanguageRuntimeGetExceptionPrecondition precondition_callback) {
559 name, description, create_callback,
nullptr, command_callback,
560 precondition_callback);
573LanguageRuntimeGetCommandObject
576 if (idx < instances.size())
577 return instances[idx].command_callback;
581LanguageRuntimeGetExceptionPrecondition
584 if (idx < instances.size())
585 return instances[idx].precondition_callback;
589#pragma mark SystemRuntime
600 llvm::StringRef name, llvm::StringRef description,
601 SystemRuntimeCreateInstance create_callback) {
607 SystemRuntimeCreateInstance create_callback) {
611SystemRuntimeCreateInstance
616#pragma mark ObjectFile
620 llvm::StringRef name, llvm::StringRef description,
622 ObjectFileCreateMemoryInstance create_memory_callback,
623 ObjectFileGetModuleSpecifications get_module_specifications,
624 ObjectFileSaveCore save_core,
627 name, description, create_callback, debugger_init_callback),
628 create_memory_callback(create_memory_callback),
629 get_module_specifications(get_module_specifications),
630 save_core(save_core) {}
644 llvm::StringRef name, llvm::StringRef description,
646 ObjectFileCreateMemoryInstance create_memory_callback,
647 ObjectFileGetModuleSpecifications get_module_specifications,
648 ObjectFileSaveCore save_core,
651 name, description, create_callback, create_memory_callback,
652 get_module_specifications, save_core, debugger_init_callback);
664ObjectFileCreateMemoryInstance
667 if (idx < instances.size())
668 return instances[idx].create_memory_callback;
672ObjectFileGetModuleSpecifications
676 if (idx < instances.size())
677 return instances[idx].get_module_specifications;
681ObjectFileCreateMemoryInstance
683 llvm::StringRef name) {
685 for (
auto &instance : instances) {
686 if (instance.name == name)
687 return instance.create_memory_callback;
695 llvm::StringRef plugin_name) {
696 if (plugin_name.empty()) {
698 llvm::Expected<bool> ret = process_sp->SaveCore(outfile.
GetPath());
700 return Status(ret.takeError());
708 for (
auto &instance : instances) {
709 if (plugin_name.empty() || instance.name == plugin_name) {
710 if (instance.save_core &&
711 instance.save_core(process_sp, outfile, core_style,
error))
715 error.SetErrorString(
716 "no ObjectFile plugins were able to save a core for this process");
720#pragma mark ObjectContainer
725 llvm::StringRef name, llvm::StringRef description,
727 ObjectContainerCreateMemoryInstance create_memory_callback,
728 ObjectFileGetModuleSpecifications get_module_specifications)
731 create_memory_callback(create_memory_callback),
732 get_module_specifications(get_module_specifications) {}
745 llvm::StringRef name, llvm::StringRef description,
747 ObjectFileGetModuleSpecifications get_module_specifications,
748 ObjectContainerCreateMemoryInstance create_memory_callback) {
750 name, description, create_callback, create_memory_callback,
751 get_module_specifications);
764ObjectContainerCreateMemoryInstance
767 if (idx < instances.size())
768 return instances[idx].create_memory_callback;
772ObjectFileGetModuleSpecifications
776 if (idx < instances.size())
777 return instances[idx].get_module_specifications;
788 return g_platform_instances;
792 llvm::StringRef name, llvm::StringRef description,
793 PlatformCreateInstance create_callback,
796 name, description, create_callback, debugger_init_callback);
812PlatformCreateInstance
817PlatformCreateInstance
825 if (instance.name.startswith(name))
841 llvm::StringRef name, llvm::StringRef description,
842 ProcessCreateInstance create_callback,
845 name, description, create_callback, debugger_init_callback);
873 if (instance.name.startswith(name))
878#pragma mark RegisterTypeBuilder
897 llvm::StringRef name, llvm::StringRef description,
908lldb::RegisterTypeBuilderSP
913 assert(instances.size());
914 return instances[0].create_callback(target);
917#pragma mark ScriptInterpreter
926 language(language) {}
939 llvm::StringRef name, llvm::StringRef description,
943 name, description, create_callback, script_language);
956lldb::ScriptInterpreterSP
961 for (
const auto &instance : instances) {
963 none_instance = instance.create_callback;
965 if (script_lang == instance.language)
966 return instance.create_callback(debugger);
970 assert(none_instance !=
nullptr);
971 return none_instance(debugger);
974#pragma mark StructuredDataPlugin
979 llvm::StringRef name, llvm::StringRef description,
982 StructuredDataFilterLaunchInfo filter_callback)
984 name, description, create_callback, debugger_init_callback),
985 filter_callback(filter_callback) {}
987 StructuredDataFilterLaunchInfo filter_callback =
nullptr;
999 llvm::StringRef name, llvm::StringRef description,
1002 StructuredDataFilterLaunchInfo filter_callback) {
1004 name, description, create_callback, debugger_init_callback,
1018StructuredDataFilterLaunchInfo
1020 uint32_t idx,
bool &iteration_complete) {
1022 if (idx < instances.size()) {
1023 iteration_complete =
false;
1024 return instances[idx].filter_callback;
1026 iteration_complete =
true;
1031#pragma mark SymbolFile
1042 llvm::StringRef name, llvm::StringRef description,
1043 SymbolFileCreateInstance create_callback,
1046 name, description, create_callback, debugger_init_callback);
1053SymbolFileCreateInstance
1058#pragma mark SymbolVendor
1069 llvm::StringRef description,
1070 SymbolVendorCreateInstance create_callback) {
1076 SymbolVendorCreateInstance create_callback) {
1080SymbolVendorCreateInstance
1090 llvm::StringRef name, llvm::StringRef description,
1092 TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1095 name, description, create_callback_from_bundle,
1096 debugger_init_callback),
1098 create_callback_for_live_process(create_callback_for_live_process) {}
1112 llvm::StringRef name, llvm::StringRef description,
1114 TraceCreateInstanceForLiveProcess create_callback_for_live_process,
1117 name, description, create_callback_from_bundle,
1118 create_callback_for_live_process, schema, debugger_init_callback);
1124 create_callback_from_bundle);
1132TraceCreateInstanceForLiveProcess
1135 if (instance.name == plugin_name)
1136 return instance.create_callback_for_live_process;
1142 if (instance.name == plugin_name)
1143 return instance.schema;
1144 return llvm::StringRef();
1150 return instance->schema;
1151 return llvm::StringRef();
1154#pragma mark TraceExporter
1159 llvm::StringRef name, llvm::StringRef description,
1161 ThreadTraceExportCommandCreator create_thread_trace_export_command)
1164 create_thread_trace_export_command(create_thread_trace_export_command) {
1178 llvm::StringRef name, llvm::StringRef description,
1180 ThreadTraceExportCommandCreator create_thread_trace_export_command) {
1182 name, description, create_callback, create_thread_trace_export_command);
1195ThreadTraceExportCommandCreator
1199 return instance->create_thread_trace_export_command;
1208#pragma mark UnwindAssembly
1219 llvm::StringRef name, llvm::StringRef description,
1220 UnwindAssemblyCreateInstance create_callback) {
1226 UnwindAssemblyCreateInstance create_callback) {
1230UnwindAssemblyCreateInstance
1235#pragma mark MemoryHistory
1246 llvm::StringRef name, llvm::StringRef description,
1247 MemoryHistoryCreateInstance create_callback) {
1253 MemoryHistoryCreateInstance create_callback) {
1257MemoryHistoryCreateInstance
1262#pragma mark InstrumentationRuntime
1267 llvm::StringRef name, llvm::StringRef description,
1269 InstrumentationRuntimeGetType get_type_callback)
1272 get_type_callback(get_type_callback) {}
1274 InstrumentationRuntimeGetType get_type_callback =
nullptr;
1286 llvm::StringRef name, llvm::StringRef description,
1288 InstrumentationRuntimeGetType get_type_callback) {
1290 name, description, create_callback, get_type_callback);
1298InstrumentationRuntimeGetType
1301 if (idx < instances.size())
1302 return instances[idx].get_type_callback;
1311#pragma mark TypeSystem
1320 supported_languages_for_types(supported_languages_for_types),
1321 supported_languages_for_expressions(
1322 supported_languages_for_expressions) {}
1336 llvm::StringRef name, llvm::StringRef description,
1339 LanguageSet supported_languages_for_expressions) {
1341 name, description, create_callback, supported_languages_for_types,
1342 supported_languages_for_expressions);
1357 for (
unsigned i = 0; i < instances.size(); ++i)
1358 all.
bitvector |= instances[i].supported_languages_for_types.bitvector;
1365 for (
unsigned i = 0; i < instances.size(); ++i)
1366 all.
bitvector |= instances[i].supported_languages_for_expressions.bitvector;
1376 supported_languages(supported_languages) {}
1392 supported_languages);
1405 return idx < instances.size() ? instances[idx].supported_languages
1412 for (
unsigned i = 0; i < instances.size(); ++i)
1413 all.
bitvector |= instances[i].supported_languages.bitvector;
1417#pragma mark PluginManager
1434static lldb::OptionValuePropertiesSP
1436 llvm::StringRef plugin_type_desc,
1438 lldb::OptionValuePropertiesSP parent_properties_sp(
1440 if (parent_properties_sp) {
1443 OptionValuePropertiesSP plugin_properties_sp =
1444 parent_properties_sp->GetSubProperty(
nullptr, g_property_name);
1445 if (!plugin_properties_sp && can_create) {
1446 plugin_properties_sp =
1447 std::make_shared<OptionValueProperties>(g_property_name);
1448 parent_properties_sp->AppendProperty(g_property_name,
1449 "Settings specify to plugins.",
true,
1450 plugin_properties_sp);
1453 if (plugin_properties_sp) {
1454 lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1455 plugin_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
1456 if (!plugin_type_properties_sp && can_create) {
1457 plugin_type_properties_sp =
1458 std::make_shared<OptionValueProperties>(plugin_type_name);
1459 plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1460 true, plugin_type_properties_sp);
1462 return plugin_type_properties_sp;
1465 return lldb::OptionValuePropertiesSP();
1473 llvm::StringRef plugin_type_desc,
bool can_create) {
1475 lldb::OptionValuePropertiesSP parent_properties_sp(
1477 if (parent_properties_sp) {
1478 OptionValuePropertiesSP plugin_properties_sp =
1479 parent_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
1480 if (!plugin_properties_sp && can_create) {
1481 plugin_properties_sp =
1482 std::make_shared<OptionValueProperties>(plugin_type_name);
1483 parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1484 true, plugin_properties_sp);
1487 if (plugin_properties_sp) {
1488 lldb::OptionValuePropertiesSP plugin_type_properties_sp =
1489 plugin_properties_sp->GetSubProperty(
nullptr, g_property_name);
1490 if (!plugin_type_properties_sp && can_create) {
1491 plugin_type_properties_sp =
1492 std::make_shared<OptionValueProperties>(g_property_name);
1493 plugin_properties_sp->AppendProperty(g_property_name,
1494 "Settings specific to plugins",
1495 true, plugin_type_properties_sp);
1497 return plugin_type_properties_sp;
1500 return lldb::OptionValuePropertiesSP();
1505typedef lldb::OptionValuePropertiesSP
1510static lldb::OptionValuePropertiesSP
1513 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1515 lldb::OptionValuePropertiesSP properties_sp;
1516 lldb::OptionValuePropertiesSP plugin_type_properties_sp(get_debugger_property(
1517 debugger, plugin_type_name,
1520 if (plugin_type_properties_sp)
1522 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
1523 return properties_sp;
1528 llvm::StringRef plugin_type_desc,
1529 const lldb::OptionValuePropertiesSP &properties_sp,
1530 llvm::StringRef description,
bool is_global_property,
1531 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1533 if (properties_sp) {
1534 lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1535 get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
1537 if (plugin_type_properties_sp) {
1538 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1539 description, is_global_property,
1556lldb::OptionValuePropertiesSP
1564 Debugger &debugger,
const lldb::OptionValuePropertiesSP &properties_sp,
1565 llvm::StringRef description,
bool is_global_property) {
1567 "Settings for dynamic loader plug-ins",
1568 properties_sp, description, is_global_property);
1571lldb::OptionValuePropertiesSP
1580 Debugger &debugger,
const lldb::OptionValuePropertiesSP &properties_sp,
1581 llvm::StringRef description,
bool is_global_property) {
1583 "Settings for platform plug-ins", properties_sp,
1584 description, is_global_property,
1588lldb::OptionValuePropertiesSP
1596 Debugger &debugger,
const lldb::OptionValuePropertiesSP &properties_sp,
1597 llvm::StringRef description,
bool is_global_property) {
1599 "Settings for process plug-ins", properties_sp,
1600 description, is_global_property);
1604 Debugger &debugger,
const lldb::OptionValuePropertiesSP &properties_sp,
1605 llvm::StringRef description,
bool is_global_property) {
1607 "Settings for trace plug-ins", properties_sp,
1608 description, is_global_property);
1611lldb::OptionValuePropertiesSP
1619 Debugger &debugger,
const lldb::OptionValuePropertiesSP &properties_sp,
1620 llvm::StringRef description,
bool is_global_property) {
1622 "Settings for object file plug-ins",
1623 properties_sp, description, is_global_property);
1626lldb::OptionValuePropertiesSP
1634 Debugger &debugger,
const lldb::OptionValuePropertiesSP &properties_sp,
1635 llvm::StringRef description,
bool is_global_property) {
1637 "Settings for symbol file plug-ins",
1638 properties_sp, description, is_global_property);
1641lldb::OptionValuePropertiesSP
1649 Debugger &debugger,
const lldb::OptionValuePropertiesSP &properties_sp,
1650 llvm::StringRef description,
bool is_global_property) {
1652 "Settings for JIT loader plug-ins",
1653 properties_sp, description, is_global_property);
1658lldb::OptionValuePropertiesSP
1661 lldb::OptionValuePropertiesSP properties_sp;
1662 lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1667 if (plugin_type_properties_sp)
1669 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
1670 return properties_sp;
1674 Debugger &debugger,
const lldb::OptionValuePropertiesSP &properties_sp,
1675 llvm::StringRef description,
bool is_global_property) {
1676 if (properties_sp) {
1677 lldb::OptionValuePropertiesSP plugin_type_properties_sp(
1680 "Settings for operating system plug-ins",
true));
1681 if (plugin_type_properties_sp) {
1682 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1683 description, is_global_property,
1691lldb::OptionValuePropertiesSP
1699 Debugger &debugger,
const lldb::OptionValuePropertiesSP &properties_sp,
1700 llvm::StringRef description,
bool is_global_property) {
1703 "Settings for structured data plug-ins",
1704 properties_sp, description, is_global_property);
static llvm::raw_ostream & error(Stream &strm)
static FileSystem::EnumerateDirectoryResult LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft, llvm::StringRef path)
static DisassemblerInstances & GetDisassemblerInstances()
static TraceInstances & GetTracePluginInstances()
static ObjectContainerInstances & GetObjectContainerInstances()
PluginInstances< JITLoaderInstance > JITLoaderInstances
static MemoryHistoryInstances & GetMemoryHistoryInstances()
PluginInstance< PlatformCreateInstance > PlatformInstance
PluginInstances< InstrumentationRuntimeInstance > InstrumentationRuntimeInstances
static DynamicLoaderInstances & GetDynamicLoaderInstances()
PluginInstances< SymbolFileInstance > SymbolFileInstances
std::map< FileSpec, PluginInfo > PluginTerminateMap
PluginInstances< TypeSystemInstance > TypeSystemInstances
PluginInstance< ABICreateInstance > ABIInstance
static SystemRuntimeInstances & GetSystemRuntimeInstances()
PluginInstances< TraceExporterInstance > TraceExporterInstances
PluginInstance< EmulateInstructionCreateInstance > EmulateInstructionInstance
static ABIInstances & GetABIInstances()
PluginInstances< SymbolVendorInstance > SymbolVendorInstances
static ScriptInterpreterInstances & GetScriptInterpreterInstances()
static const char * kPlatformPluginName("platform")
PluginInstance< DynamicLoaderCreateInstance > DynamicLoaderInstance
PluginInstances< PlatformInstance > PlatformInstances
PluginInstance< JITLoaderCreateInstance > JITLoaderInstance
PluginInstance< ArchitectureCreateInstance > ArchitectureInstance
PluginInstances< SystemRuntimeInstance > SystemRuntimeInstances
static const char * kDynamicLoaderPluginName("dynamic-loader")
static TraceExporterInstances & GetTraceExporterInstances()
static void SetPluginInfo(const FileSpec &plugin_file_spec, const PluginInfo &plugin_info)
static PluginTerminateMap & GetPluginMap()
static const char * kJITLoaderPluginName("jit-loader")
PluginInstance< LanguageCreateInstance > LanguageInstance
PluginInstance< SymbolFileCreateInstance > SymbolFileInstance
PluginInstances< ObjectFileInstance > ObjectFileInstances
void(* PluginTermCallback)()
static StructuredDataPluginInstances & GetStructuredDataPluginInstances()
PluginInstances< MemoryHistoryInstance > MemoryHistoryInstances
PluginInstances< DynamicLoaderInstance > DynamicLoaderInstances
PluginInstances< LanguageInstance > LanguageInstances
PluginInstances< TraceInstance > TraceInstances
PluginInstances< StructuredDataPluginInstance > StructuredDataPluginInstances
PluginInstance< MemoryHistoryCreateInstance > MemoryHistoryInstance
static const char * kOperatingSystemPluginName("os")
PluginInstance< OperatingSystemCreateInstance > OperatingSystemInstance
static ObjectFileInstances & GetObjectFileInstances()
PluginInstance< SystemRuntimeCreateInstance > SystemRuntimeInstance
PluginInstance< SymbolVendorCreateInstance > SymbolVendorInstance
static EmulateInstructionInstances & GetEmulateInstructionInstances()
PluginInstance< UnwindAssemblyCreateInstance > UnwindAssemblyInstance
static LanguageInstances & GetLanguageInstances()
static const char * kObjectFilePluginName("object-file")
PluginInstances< OperatingSystemInstance > OperatingSystemInstances
static LanguageRuntimeInstances & GetLanguageRuntimeInstances()
PluginInstances< LanguageRuntimeInstance > LanguageRuntimeInstances
static InstrumentationRuntimeInstances & GetInstrumentationRuntimeInstances()
PluginInstances< ProcessInstance > ProcessInstances
PluginInstances< REPLInstance > REPLInstances
std::vector< ArchitectureInstance > ArchitectureInstances
static ArchitectureInstances & GetArchitectureInstances()
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPluginsOldStyle(Debugger &debugger, ConstString plugin_type_name, llvm::StringRef plugin_type_desc, bool can_create)
static lldb::OptionValuePropertiesSP GetSettingForPlugin(Debugger &debugger, ConstString setting_name, ConstString plugin_type_name, GetDebuggerPropertyForPluginsPtr get_debugger_property=GetDebuggerPropertyForPlugins)
static RegisterTypeBuilderInstances & GetRegisterTypeBuilderInstances()
static std::recursive_mutex & GetPluginMapMutex()
static const char * kProcessPluginName("process")
static TypeSystemInstances & GetTypeSystemInstances()
static PlatformInstances & GetPlatformInstances()
static FileSystem::EnumerateDirectoryResult LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft, llvm::StringRef path)
static const char * kTracePluginName("trace")
PluginInstances< EmulateInstructionInstance > EmulateInstructionInstances
static JITLoaderInstances & GetJITLoaderInstances()
static bool CreateSettingForPlugin(Debugger &debugger, ConstString plugin_type_name, llvm::StringRef plugin_type_desc, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property, GetDebuggerPropertyForPluginsPtr get_debugger_property=GetDebuggerPropertyForPlugins)
PluginInstances< DisassemblerInstance > DisassemblerInstances
PluginInstance< ProcessCreateInstance > ProcessInstance
static UnwindAssemblyInstances & GetUnwindAssemblyInstances()
PluginInstances< UnwindAssemblyInstance > UnwindAssemblyInstances
static SymbolFileInstances & GetSymbolFileInstances()
PluginInstances< ABIInstance > ABIInstances
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPlugins(Debugger &debugger, ConstString plugin_type_name, llvm::StringRef plugin_type_desc, bool can_create)
static FPtrTy CastToFPtr(void *VPtr)
static ProcessInstances & GetProcessInstances()
static bool PluginIsLoaded(const FileSpec &plugin_file_spec)
static OperatingSystemInstances & GetOperatingSystemInstances()
PluginInstances< ScriptInterpreterInstance > ScriptInterpreterInstances
bool(* PluginInitCallback)()
PluginInstance< DisassemblerCreateInstance > DisassemblerInstance
static const char * kSymbolFilePluginName("symbol-file")
static SymbolVendorInstances & GetSymbolVendorInstances()
PluginInstances< ObjectContainerInstance > ObjectContainerInstances
static const char * kStructuredDataPluginName("structured-data")
PluginInstances< RegisterTypeBuilderInstance > RegisterTypeBuilderInstances
static REPLInstances & GetREPLInstances()
bool UnregisterPlugin(typename Instance::CallbackType callback)
llvm::StringRef GetNameAtIndex(uint32_t idx)
Instance::CallbackType GetCallbackAtIndex(uint32_t idx)
llvm::StringRef GetDescriptionAtIndex(uint32_t idx)
Instance * GetInstanceAtIndex(uint32_t idx)
Instance::CallbackType GetCallbackForName(llvm::StringRef name)
bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, typename Instance::CallbackType callback, Args &&...args)
std::vector< Instance > m_instances
const std::vector< Instance > & GetInstances() const
void PerformDebuggerCallback(Debugger &debugger)
std::vector< Instance > & GetInstances()
An architecture specification class.
A command line argument class.
"lldb/Utility/ArgCompletionRequest.h"
void AddCompletion(llvm::StringRef completion, llvm::StringRef description="", CompletionMode mode=CompletionMode::Normal)
Adds a possible completion string.
A uniqued constant string class.
A class to manage flag bits.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
void Resolve(llvm::SmallVectorImpl< char > &path)
Resolve path to make it canonical.
void EnumerateDirectory(llvm::Twine path, bool find_directories, bool find_files, bool find_other, EnumerateDirectoryCallbackType callback, void *callback_baton)
@ eEnumerateDirectoryResultEnter
Recurse into the current entry if it is a directory or symlink, or next if not.
@ eEnumerateDirectoryResultNext
Enumerate next entry in the current directory.
static FileSystem & Instance()
static llvm::StringRef GetPlatformPluginDescriptionAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForJITLoaderPlugin(Debugger &debugger, ConstString setting_name)
static llvm::StringRef GetTraceExporterPluginNameAtIndex(uint32_t index)
static bool CreateSettingForJITLoaderPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static lldb::OptionValuePropertiesSP GetSettingForObjectFilePlugin(Debugger &debugger, ConstString setting_name)
static ProcessCreateInstance GetProcessCreateCallbackAtIndex(uint32_t idx)
static JITLoaderCreateInstance GetJITLoaderCreateCallbackAtIndex(uint32_t idx)
static ABICreateInstance GetABICreateCallbackAtIndex(uint32_t idx)
static LanguageSet GetAllTypeSystemSupportedLanguagesForExpressions()
static bool CreateSettingForOperatingSystemPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static void AutoCompletePlatformName(llvm::StringRef partial_name, CompletionRequest &request)
static TraceExporterCreateInstance GetTraceExporterCreateCallback(llvm::StringRef plugin_name)
static bool CreateSettingForObjectFilePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static lldb::ScriptInterpreterSP GetScriptInterpreterForLanguage(lldb::ScriptLanguage script_lang, Debugger &debugger)
static void AutoCompleteProcessName(llvm::StringRef partial_name, CompletionRequest &request)
static ThreadTraceExportCommandCreator GetThreadTraceExportCommandCreatorAtIndex(uint32_t index)
Return the callback used to create the CommandObject that will be listed under "thread trace export".
static LanguageSet GetREPLAllTypeSystemSupportedLanguages()
static PlatformCreateInstance GetPlatformCreateCallbackAtIndex(uint32_t idx)
static bool CreateSettingForTracePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static UnwindAssemblyCreateInstance GetUnwindAssemblyCreateCallbackAtIndex(uint32_t idx)
static SymbolFileCreateInstance GetSymbolFileCreateCallbackAtIndex(uint32_t idx)
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static TypeSystemCreateInstance GetTypeSystemCreateCallbackAtIndex(uint32_t idx)
static InstrumentationRuntimeGetType GetInstrumentationRuntimeGetTypeCallbackAtIndex(uint32_t idx)
static llvm::StringRef GetTraceSchema(llvm::StringRef plugin_name)
Get the JSON schema for a trace bundle description file corresponding to the given plugin.
static TraceCreateInstanceForLiveProcess GetTraceCreateCallbackForLiveProcess(llvm::StringRef plugin_name)
static lldb::OptionValuePropertiesSP GetSettingForProcessPlugin(Debugger &debugger, ConstString setting_name)
static LanguageRuntimeCreateInstance GetLanguageRuntimeCreateCallbackAtIndex(uint32_t idx)
static std::unique_ptr< Architecture > CreateArchitectureInstance(const ArchSpec &arch)
static SystemRuntimeCreateInstance GetSystemRuntimeCreateCallbackAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForOperatingSystemPlugin(Debugger &debugger, ConstString setting_name)
static bool CreateSettingForProcessPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static lldb::OptionValuePropertiesSP GetSettingForPlatformPlugin(Debugger &debugger, ConstString setting_name)
static SymbolVendorCreateInstance GetSymbolVendorCreateCallbackAtIndex(uint32_t idx)
static LanguageRuntimeGetCommandObject GetLanguageRuntimeGetCommandObjectAtIndex(uint32_t idx)
static OperatingSystemCreateInstance GetOperatingSystemCreateCallbackAtIndex(uint32_t idx)
static LanguageRuntimeGetExceptionPrecondition GetLanguageRuntimeGetExceptionPreconditionAtIndex(uint32_t idx)
static REPLCreateInstance GetREPLCreateCallbackAtIndex(uint32_t idx)
static ObjectFileCreateMemoryInstance GetObjectFileCreateMemoryCallbackAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForSymbolFilePlugin(Debugger &debugger, ConstString setting_name)
static DisassemblerCreateInstance GetDisassemblerCreateCallbackForPluginName(llvm::StringRef name)
static MemoryHistoryCreateInstance GetMemoryHistoryCreateCallbackAtIndex(uint32_t idx)
static bool CreateSettingForSymbolFilePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static bool CreateSettingForPlatformPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static OperatingSystemCreateInstance GetOperatingSystemCreateCallbackForPluginName(llvm::StringRef name)
static DisassemblerCreateInstance GetDisassemblerCreateCallbackAtIndex(uint32_t idx)
static ObjectContainerCreateInstance GetObjectContainerCreateCallbackAtIndex(uint32_t idx)
static ObjectFileCreateInstance GetObjectFileCreateCallbackAtIndex(uint32_t idx)
static EmulateInstructionCreateInstance GetEmulateInstructionCreateCallbackForPluginName(llvm::StringRef name)
static bool CreateSettingForStructuredDataPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static DynamicLoaderCreateInstance GetDynamicLoaderCreateCallbackAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForDynamicLoaderPlugin(Debugger &debugger, ConstString setting_name)
static ObjectFileGetModuleSpecifications GetObjectContainerGetModuleSpecificationsCallbackAtIndex(uint32_t idx)
static DynamicLoaderCreateInstance GetDynamicLoaderCreateCallbackForPluginName(llvm::StringRef name)
static PlatformCreateInstance GetPlatformCreateCallbackForPluginName(llvm::StringRef name)
static ScriptInterpreterCreateInstance GetScriptInterpreterCreateCallbackAtIndex(uint32_t idx)
static LanguageCreateInstance GetLanguageCreateCallbackAtIndex(uint32_t idx)
static Status SaveCore(const lldb::ProcessSP &process_sp, const FileSpec &outfile, lldb::SaveCoreStyle &core_style, llvm::StringRef plugin_name)
static ProcessCreateInstance GetProcessCreateCallbackForPluginName(llvm::StringRef name)
static lldb::OptionValuePropertiesSP GetSettingForStructuredDataPlugin(Debugger &debugger, ConstString setting_name)
static llvm::StringRef GetProcessPluginDescriptionAtIndex(uint32_t idx)
static bool CreateSettingForDynamicLoaderPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static StructuredDataPluginCreateInstance GetStructuredDataPluginCreateCallbackAtIndex(uint32_t idx)
static ObjectFileGetModuleSpecifications GetObjectFileGetModuleSpecificationsCallbackAtIndex(uint32_t idx)
static llvm::StringRef GetPlatformPluginNameAtIndex(uint32_t idx)
static TraceCreateInstanceFromBundle GetTraceCreateCallback(llvm::StringRef plugin_name)
static void DebuggerInitialize(Debugger &debugger)
static llvm::StringRef GetProcessPluginNameAtIndex(uint32_t idx)
static LanguageSet GetAllTypeSystemSupportedLanguagesForTypes()
static bool UnregisterPlugin(ABICreateInstance create_callback)
static ObjectContainerCreateMemoryInstance GetObjectContainerCreateMemoryCallbackAtIndex(uint32_t idx)
static StructuredDataFilterLaunchInfo GetStructuredDataFilterCallbackAtIndex(uint32_t idx, bool &iteration_complete)
static InstrumentationRuntimeCreateInstance GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx)
static LanguageSet GetREPLSupportedLanguagesAtIndex(uint32_t idx)
static lldb::RegisterTypeBuilderSP GetRegisterTypeBuilder(Target &target)
static ObjectFileCreateMemoryInstance GetObjectFileCreateMemoryCallbackForPluginName(llvm::StringRef name)
static EmulateInstructionCreateInstance GetEmulateInstructionCreateCallbackAtIndex(uint32_t idx)
virtual lldb::OptionValuePropertiesSP GetValueProperties() const
A class that represents a running process on the host machine.
ScriptLanguage
Script interpreter types.
InstrumentationRuntimeInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, InstrumentationRuntimeGetType get_type_callback)
LanguageRuntimeGetExceptionPrecondition precondition_callback
LanguageRuntimeInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, DebuggerInitializeCallback debugger_init_callback, LanguageRuntimeGetCommandObject command_callback, LanguageRuntimeGetExceptionPrecondition precondition_callback)
LanguageRuntimeGetCommandObject command_callback
ObjectFileGetModuleSpecifications get_module_specifications
ObjectContainerInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, ObjectContainerCreateMemoryInstance create_memory_callback, ObjectFileGetModuleSpecifications get_module_specifications)
ObjectContainerCreateMemoryInstance create_memory_callback
ObjectFileCreateMemoryInstance create_memory_callback
ObjectFileGetModuleSpecifications get_module_specifications
ObjectFileInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, ObjectFileCreateMemoryInstance create_memory_callback, ObjectFileGetModuleSpecifications get_module_specifications, ObjectFileSaveCore save_core, DebuggerInitializeCallback debugger_init_callback)
ObjectFileSaveCore save_core
PluginTermCallback plugin_term_callback
llvm::sys::DynamicLibrary library
PluginInitCallback plugin_init_callback
llvm::StringRef description
DebuggerInitializeCallback debugger_init_callback
PluginInstance(llvm::StringRef name, llvm::StringRef description, Callback create_callback, DebuggerInitializeCallback debugger_init_callback=nullptr)
LanguageSet supported_languages
REPLInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, LanguageSet supported_languages)
RegisterTypeBuilderInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback)
ScriptInterpreterInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, lldb::ScriptLanguage language)
StructuredDataPluginInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, DebuggerInitializeCallback debugger_init_callback, StructuredDataFilterLaunchInfo filter_callback)
ThreadTraceExportCommandCreator create_thread_trace_export_command
TraceExporterInstance(llvm::StringRef name, llvm::StringRef description, TraceExporterCreateInstance create_instance, ThreadTraceExportCommandCreator create_thread_trace_export_command)
TraceInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback_from_bundle, TraceCreateInstanceForLiveProcess create_callback_for_live_process, llvm::StringRef schema, DebuggerInitializeCallback debugger_init_callback)
TraceCreateInstanceForLiveProcess create_callback_for_live_process
LanguageSet supported_languages_for_expressions
LanguageSet supported_languages_for_types
TypeSystemInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, LanguageSet supported_languages_for_types, LanguageSet supported_languages_for_expressions)
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
llvm::SmallBitVector bitvector