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,
301#pragma mark Architecture
312 llvm::StringRef description,
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,
368 llvm::StringRef name) {
372#pragma mark DynamicLoader
383 llvm::StringRef name, llvm::StringRef description,
387 name, description, create_callback, debugger_init_callback);
402 llvm::StringRef name) {
406#pragma mark JITLoader
417 llvm::StringRef name, llvm::StringRef description,
421 name, description, create_callback, debugger_init_callback);
433#pragma mark EmulateInstruction
445 llvm::StringRef name, llvm::StringRef description,
463 llvm::StringRef name) {
467#pragma mark OperatingSystem
478 llvm::StringRef name, llvm::StringRef description,
482 name, description, create_callback, debugger_init_callback);
497 llvm::StringRef name) {
512 llvm::StringRef description,
527#pragma mark LanguageRuntime
532 llvm::StringRef name, llvm::StringRef description,
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,
559 name, description, create_callback,
nullptr, command_callback,
560 precondition_callback);
576 if (idx < instances.size())
577 return instances[idx].command_callback;
584 if (idx < instances.size())
585 return instances[idx].precondition_callback;
589#pragma mark SystemRuntime
600 llvm::StringRef name, llvm::StringRef description,
616#pragma mark ObjectFile
620 llvm::StringRef name, llvm::StringRef description,
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) {}
648 for (
auto &instance : instances) {
649 if (instance.name == name)
656 llvm::StringRef name, llvm::StringRef description,
663 name, description, create_callback, create_memory_callback,
664 get_module_specifications, save_core, debugger_init_callback);
679 if (idx < instances.size())
680 return instances[idx].create_memory_callback;
688 if (idx < instances.size())
689 return instances[idx].get_module_specifications;
695 llvm::StringRef name) {
697 for (
auto &instance : instances) {
698 if (instance.name == name)
699 return instance.create_memory_callback;
708 error.SetErrorString(
"No output file specified");
713 error.SetErrorString(
"Invalid process");
719 llvm::Expected<bool> ret =
722 return Status(ret.takeError());
728 const auto &plugin_name = options.
GetPluginName().value_or(
"");
730 for (
auto &instance : instances) {
731 if (plugin_name.empty() || instance.name == plugin_name) {
732 if (instance.save_core && instance.save_core(process_sp, options,
error))
740 error.SetErrorString(
741 "no ObjectFile plugins were able to save a core for this process");
745#pragma mark ObjectContainer
750 llvm::StringRef name, llvm::StringRef description,
756 create_memory_callback(create_memory_callback),
757 get_module_specifications(get_module_specifications) {}
770 llvm::StringRef name, llvm::StringRef description,
775 name, description, create_callback, create_memory_callback,
776 get_module_specifications);
792 if (idx < instances.size())
793 return instances[idx].create_memory_callback;
801 if (idx < instances.size())
802 return instances[idx].get_module_specifications;
813 return g_platform_instances;
817 llvm::StringRef name, llvm::StringRef description,
821 name, description, create_callback, debugger_init_callback);
850 if (instance.name.starts_with(name))
866 llvm::StringRef name, llvm::StringRef description,
870 name, description, create_callback, debugger_init_callback);
898 if (instance.name.starts_with(name))
903#pragma mark RegisterTypeBuilder
922 llvm::StringRef name, llvm::StringRef description,
938 assert(instances.size());
939 return instances[0].create_callback(target);
942#pragma mark ScriptInterpreter
951 language(language) {}
964 llvm::StringRef name, llvm::StringRef description,
968 name, description, create_callback, script_language);
986 for (
const auto &instance : instances) {
988 none_instance = instance.create_callback;
990 if (script_lang == instance.language)
991 return instance.create_callback(debugger);
995 assert(none_instance !=
nullptr);
996 return none_instance(debugger);
999#pragma mark StructuredDataPlugin
1004 llvm::StringRef name, llvm::StringRef description,
1009 name, description, create_callback, debugger_init_callback),
1010 filter_callback(filter_callback) {}
1024 llvm::StringRef name, llvm::StringRef description,
1029 name, description, create_callback, debugger_init_callback,
1045 uint32_t idx,
bool &iteration_complete) {
1047 if (idx < instances.size()) {
1048 iteration_complete =
false;
1049 return instances[idx].filter_callback;
1051 iteration_complete =
true;
1056#pragma mark SymbolFile
1067 llvm::StringRef name, llvm::StringRef description,
1071 name, description, create_callback, debugger_init_callback);
1083#pragma mark SymbolVendor
1094 llvm::StringRef description,
1110#pragma mark SymbolLocator
1115 llvm::StringRef name, llvm::StringRef description,
1123 name, description, create_callback, debugger_init_callback),
1124 locate_executable_object_file(locate_executable_object_file),
1125 locate_executable_symbol_file(locate_executable_symbol_file),
1126 download_object_symbol_file(download_object_symbol_file),
1127 find_symbol_file_in_bundle(find_symbol_file_in_bundle) {}
1142 llvm::StringRef name, llvm::StringRef description,
1150 name, description, create_callback, locate_executable_object_file,
1151 locate_executable_symbol_file, download_object_symbol_file,
1152 find_symbol_file_in_bundle, debugger_init_callback);
1168 for (
auto &instance : instances) {
1169 if (instance.locate_executable_object_file) {
1170 std::optional<ModuleSpec> result =
1171 instance.locate_executable_object_file(module_spec);
1182 for (
auto &instance : instances) {
1183 if (instance.locate_executable_symbol_file) {
1184 std::optional<FileSpec> result = instance.locate_executable_symbol_file(
1185 module_spec, default_search_paths);
1196 bool copy_executable) {
1198 for (
auto &instance : instances) {
1199 if (instance.download_object_symbol_file) {
1200 if (instance.download_object_symbol_file(module_spec,
error, force_lookup,
1212 for (
auto &instance : instances) {
1213 if (instance.find_symbol_file_in_bundle) {
1214 std::optional<FileSpec> result =
1215 instance.find_symbol_file_in_bundle(symfile_bundle, uuid, arch);
1228 llvm::StringRef name, llvm::StringRef description,
1233 name, description, create_callback_from_bundle,
1234 debugger_init_callback),
1236 create_callback_for_live_process(create_callback_for_live_process) {}
1250 llvm::StringRef name, llvm::StringRef description,
1255 name, description, create_callback_from_bundle,
1256 create_callback_for_live_process, schema, debugger_init_callback);
1262 create_callback_from_bundle);
1273 if (instance.name == plugin_name)
1274 return instance.create_callback_for_live_process;
1280 if (instance.name == plugin_name)
1281 return instance.schema;
1282 return llvm::StringRef();
1288 return instance->schema;
1289 return llvm::StringRef();
1292#pragma mark TraceExporter
1297 llvm::StringRef name, llvm::StringRef description,
1302 create_thread_trace_export_command(create_thread_trace_export_command) {
1316 llvm::StringRef name, llvm::StringRef description,
1320 name, description, create_callback, create_thread_trace_export_command);
1337 return instance->create_thread_trace_export_command;
1346#pragma mark UnwindAssembly
1357 llvm::StringRef name, llvm::StringRef description,
1373#pragma mark MemoryHistory
1384 llvm::StringRef name, llvm::StringRef description,
1400#pragma mark InstrumentationRuntime
1405 llvm::StringRef name, llvm::StringRef description,
1410 get_type_callback(get_type_callback) {}
1424 llvm::StringRef name, llvm::StringRef description,
1428 name, description, create_callback, get_type_callback);
1439 if (idx < instances.size())
1440 return instances[idx].get_type_callback;
1449#pragma mark TypeSystem
1458 supported_languages_for_types(supported_languages_for_types),
1459 supported_languages_for_expressions(
1460 supported_languages_for_expressions) {}
1474 llvm::StringRef name, llvm::StringRef description,
1477 LanguageSet supported_languages_for_expressions) {
1479 name, description, create_callback, supported_languages_for_types,
1480 supported_languages_for_expressions);
1495 for (
unsigned i = 0; i < instances.size(); ++i)
1496 all.
bitvector |= instances[i].supported_languages_for_types.bitvector;
1503 for (
unsigned i = 0; i < instances.size(); ++i)
1504 all.
bitvector |= instances[i].supported_languages_for_expressions.bitvector;
1508#pragma mark ScriptedInterfaces
1518 language(language), usages(usages) {}
1532 llvm::StringRef name, llvm::StringRef description,
1536 name, description, create_callback, language, usages);
1560 return idx < instances.size() ? instances[idx].language
1561 : ScriptLanguage::eScriptLanguageNone;
1567 if (idx >= instances.size())
1569 return instances[idx].usages;
1578 supported_languages(supported_languages) {}
1594 supported_languages);
1607 return idx < instances.size() ? instances[idx].supported_languages
1614 for (
unsigned i = 0; i < instances.size(); ++i)
1615 all.
bitvector |= instances[i].supported_languages.bitvector;
1619#pragma mark PluginManager
1640 llvm::StringRef plugin_type_desc,
1644 if (parent_properties_sp) {
1645 static constexpr llvm::StringLiteral g_property_name(
"plugin");
1648 parent_properties_sp->GetSubProperty(
nullptr, g_property_name);
1649 if (!plugin_properties_sp && can_create) {
1650 plugin_properties_sp =
1651 std::make_shared<OptionValueProperties>(g_property_name);
1652 parent_properties_sp->AppendProperty(g_property_name,
1653 "Settings specify to plugins.",
true,
1654 plugin_properties_sp);
1657 if (plugin_properties_sp) {
1659 plugin_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
1660 if (!plugin_type_properties_sp && can_create) {
1661 plugin_type_properties_sp =
1662 std::make_shared<OptionValueProperties>(plugin_type_name);
1663 plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1664 true, plugin_type_properties_sp);
1666 return plugin_type_properties_sp;
1676 Debugger &debugger, llvm::StringRef plugin_type_name,
1677 llvm::StringRef plugin_type_desc,
bool can_create) {
1678 static constexpr llvm::StringLiteral g_property_name(
"plugin");
1681 if (parent_properties_sp) {
1683 parent_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
1684 if (!plugin_properties_sp && can_create) {
1685 plugin_properties_sp =
1686 std::make_shared<OptionValueProperties>(plugin_type_name);
1687 parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1688 true, plugin_properties_sp);
1691 if (plugin_properties_sp) {
1693 plugin_properties_sp->GetSubProperty(
nullptr, g_property_name);
1694 if (!plugin_type_properties_sp && can_create) {
1695 plugin_type_properties_sp =
1696 std::make_shared<OptionValueProperties>(g_property_name);
1697 plugin_properties_sp->AppendProperty(g_property_name,
1698 "Settings specific to plugins",
1699 true, plugin_type_properties_sp);
1701 return plugin_type_properties_sp;
1710GetDebuggerPropertyForPluginsPtr(
Debugger &, llvm::StringRef, llvm::StringRef,
1716 llvm::StringRef plugin_type_name,
1717 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1721 debugger, plugin_type_name,
1724 if (plugin_type_properties_sp)
1726 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
1727 return properties_sp;
1732 llvm::StringRef plugin_type_desc,
1734 llvm::StringRef description,
bool is_global_property,
1735 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1737 if (properties_sp) {
1739 get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
1741 if (plugin_type_properties_sp) {
1742 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1743 description, is_global_property,
1759static constexpr llvm::StringLiteral
1764 llvm::StringRef setting_name) {
1770 llvm::StringRef description,
bool is_global_property) {
1772 "Settings for dynamic loader plug-ins",
1773 properties_sp, description, is_global_property);
1778 llvm::StringRef setting_name) {
1785 llvm::StringRef description,
bool is_global_property) {
1787 "Settings for platform plug-ins", properties_sp,
1788 description, is_global_property,
1794 llvm::StringRef setting_name) {
1800 llvm::StringRef description,
bool is_global_property) {
1802 "Settings for process plug-ins", properties_sp,
1803 description, is_global_property);
1808 llvm::StringRef setting_name) {
1814 llvm::StringRef description,
bool is_global_property) {
1816 "Settings for symbol locator plug-ins",
1817 properties_sp, description, is_global_property);
1822 llvm::StringRef description,
bool is_global_property) {
1824 "Settings for trace plug-ins", properties_sp,
1825 description, is_global_property);
1830 llvm::StringRef setting_name) {
1836 llvm::StringRef description,
bool is_global_property) {
1838 "Settings for object file plug-ins",
1839 properties_sp, description, is_global_property);
1844 llvm::StringRef setting_name) {
1850 llvm::StringRef description,
bool is_global_property) {
1852 "Settings for symbol file plug-ins",
1853 properties_sp, description, is_global_property);
1858 llvm::StringRef setting_name) {
1864 llvm::StringRef description,
bool is_global_property) {
1866 "Settings for JIT loader plug-ins",
1867 properties_sp, description, is_global_property);
1874 llvm::StringRef setting_name) {
1881 if (plugin_type_properties_sp)
1883 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
1884 return properties_sp;
1889 llvm::StringRef description,
bool is_global_property) {
1890 if (properties_sp) {
1893 "Settings for operating system plug-ins",
1895 if (plugin_type_properties_sp) {
1896 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1897 description, is_global_property,
1907 llvm::StringRef setting_name) {
1913 llvm::StringRef description,
bool is_global_property) {
1915 "Settings for structured data plug-ins",
1916 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
static constexpr llvm::StringLiteral kPlatformPluginName("platform")
PluginInstance< EmulateInstructionCreateInstance > EmulateInstructionInstance
static ABIInstances & GetABIInstances()
static constexpr llvm::StringLiteral kProcessPluginName("process")
PluginInstances< SymbolVendorInstance > SymbolVendorInstances
static constexpr llvm::StringLiteral kDynamicLoaderPluginName("dynamic-loader")
static lldb::OptionValuePropertiesSP GetSettingForPlugin(Debugger &debugger, llvm::StringRef setting_name, llvm::StringRef plugin_type_name, GetDebuggerPropertyForPluginsPtr get_debugger_property=GetDebuggerPropertyForPlugins)
static ScriptInterpreterInstances & GetScriptInterpreterInstances()
PluginInstance< DynamicLoaderCreateInstance > DynamicLoaderInstance
PluginInstances< PlatformInstance > PlatformInstances
PluginInstance< JITLoaderCreateInstance > JITLoaderInstance
PluginInstance< ArchitectureCreateInstance > ArchitectureInstance
PluginInstances< SystemRuntimeInstance > SystemRuntimeInstances
static TraceExporterInstances & GetTraceExporterInstances()
static void SetPluginInfo(const FileSpec &plugin_file_spec, const PluginInfo &plugin_info)
static PluginTerminateMap & GetPluginMap()
PluginInstance< LanguageCreateInstance > LanguageInstance
PluginInstance< SymbolFileCreateInstance > SymbolFileInstance
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPlugins(Debugger &debugger, llvm::StringRef plugin_type_name, llvm::StringRef plugin_type_desc, bool can_create)
static constexpr llvm::StringLiteral kSymbolLocatorPluginName("symbol-locator")
PluginInstances< ObjectFileInstance > ObjectFileInstances
void(* PluginTermCallback)()
static StructuredDataPluginInstances & GetStructuredDataPluginInstances()
static constexpr llvm::StringLiteral kObjectFilePluginName("object-file")
PluginInstances< MemoryHistoryInstance > MemoryHistoryInstances
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPluginsOldStyle(Debugger &debugger, llvm::StringRef plugin_type_name, llvm::StringRef plugin_type_desc, bool can_create)
PluginInstances< DynamicLoaderInstance > DynamicLoaderInstances
PluginInstances< LanguageInstance > LanguageInstances
PluginInstances< TraceInstance > TraceInstances
PluginInstances< StructuredDataPluginInstance > StructuredDataPluginInstances
static constexpr llvm::StringLiteral kStructuredDataPluginName("structured-data")
PluginInstance< MemoryHistoryCreateInstance > MemoryHistoryInstance
static const char * kOperatingSystemPluginName("os")
static SymbolLocatorInstances & GetSymbolLocatorInstances()
PluginInstance< OperatingSystemCreateInstance > OperatingSystemInstance
static ObjectFileInstances & GetObjectFileInstances()
static constexpr llvm::StringLiteral kSymbolFilePluginName("symbol-file")
PluginInstances< SymbolLocatorInstance > SymbolLocatorInstances
PluginInstance< SystemRuntimeCreateInstance > SystemRuntimeInstance
PluginInstance< SymbolVendorCreateInstance > SymbolVendorInstance
static EmulateInstructionInstances & GetEmulateInstructionInstances()
PluginInstance< UnwindAssemblyCreateInstance > UnwindAssemblyInstance
static LanguageInstances & GetLanguageInstances()
static constexpr llvm::StringLiteral kJITLoaderPluginName("jit-loader")
PluginInstances< OperatingSystemInstance > OperatingSystemInstances
static LanguageRuntimeInstances & GetLanguageRuntimeInstances()
PluginInstances< LanguageRuntimeInstance > LanguageRuntimeInstances
static InstrumentationRuntimeInstances & GetInstrumentationRuntimeInstances()
PluginInstances< ProcessInstance > ProcessInstances
PluginInstances< REPLInstance > REPLInstances
std::vector< ArchitectureInstance > ArchitectureInstances
static ArchitectureInstances & GetArchitectureInstances()
static RegisterTypeBuilderInstances & GetRegisterTypeBuilderInstances()
static std::recursive_mutex & GetPluginMapMutex()
static TypeSystemInstances & GetTypeSystemInstances()
static PlatformInstances & GetPlatformInstances()
static ScriptedInterfaceInstances & GetScriptedInterfaceInstances()
static FileSystem::EnumerateDirectoryResult LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft, llvm::StringRef path)
PluginInstances< EmulateInstructionInstance > EmulateInstructionInstances
static JITLoaderInstances & GetJITLoaderInstances()
PluginInstances< DisassemblerInstance > DisassemblerInstances
PluginInstance< ProcessCreateInstance > ProcessInstance
static UnwindAssemblyInstances & GetUnwindAssemblyInstances()
PluginInstances< ScriptedInterfaceInstance > ScriptedInterfaceInstances
PluginInstances< UnwindAssemblyInstance > UnwindAssemblyInstances
static SymbolFileInstances & GetSymbolFileInstances()
static bool CreateSettingForPlugin(Debugger &debugger, llvm::StringRef plugin_type_name, llvm::StringRef plugin_type_desc, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property, GetDebuggerPropertyForPluginsPtr get_debugger_property=GetDebuggerPropertyForPlugins)
PluginInstances< ABIInstance > ABIInstances
static FPtrTy CastToFPtr(void *VPtr)
static ProcessInstances & GetProcessInstances()
static bool PluginIsLoaded(const FileSpec &plugin_file_spec)
static OperatingSystemInstances & GetOperatingSystemInstances()
static constexpr llvm::StringLiteral kTracePluginName("trace")
PluginInstances< ScriptInterpreterInstance > ScriptInterpreterInstances
bool(* PluginInitCallback)()
PluginInstance< DisassemblerCreateInstance > DisassemblerInstance
static SymbolVendorInstances & GetSymbolVendorInstances()
PluginInstances< ObjectContainerInstance > ObjectContainerInstances
PluginInstances< RegisterTypeBuilderInstance > RegisterTypeBuilderInstances
static REPLInstances & GetREPLInstances()
bool UnregisterPlugin(typename Instance::CallbackType callback)
llvm::StringRef GetNameAtIndex(uint32_t idx)
Instance::CallbackType GetCallbackAtIndex(uint32_t idx)
llvm::StringRef GetDescriptionAtIndex(uint32_t idx)
Instance * GetInstanceAtIndex(uint32_t idx)
Instance::CallbackType GetCallbackForName(llvm::StringRef name)
bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, typename Instance::CallbackType callback, Args &&...args)
std::vector< Instance > m_instances
const std::vector< Instance > & GetInstances() const
void PerformDebuggerCallback(Debugger &debugger)
std::vector< Instance > & GetInstances()
An architecture specification class.
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 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 GetSettingForStructuredDataPlugin(Debugger &debugger, llvm::StringRef setting_name)
static llvm::StringRef GetTraceExporterPluginNameAtIndex(uint32_t index)
static bool CreateSettingForJITLoaderPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static ProcessCreateInstance GetProcessCreateCallbackAtIndex(uint32_t idx)
static JITLoaderCreateInstance GetJITLoaderCreateCallbackAtIndex(uint32_t idx)
static ABICreateInstance GetABICreateCallbackAtIndex(uint32_t idx)
static LanguageSet GetAllTypeSystemSupportedLanguagesForExpressions()
static bool CreateSettingForOperatingSystemPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static lldb::OptionValuePropertiesSP GetSettingForObjectFilePlugin(Debugger &debugger, llvm::StringRef setting_name)
static void AutoCompletePlatformName(llvm::StringRef partial_name, CompletionRequest &request)
static TraceExporterCreateInstance GetTraceExporterCreateCallback(llvm::StringRef plugin_name)
static bool CreateSettingForObjectFilePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static lldb::ScriptInterpreterSP GetScriptInterpreterForLanguage(lldb::ScriptLanguage script_lang, Debugger &debugger)
static void AutoCompleteProcessName(llvm::StringRef partial_name, CompletionRequest &request)
static ThreadTraceExportCommandCreator GetThreadTraceExportCommandCreatorAtIndex(uint32_t index)
Return the callback used to create the CommandObject that will be listed under "thread trace export".
static LanguageSet GetREPLAllTypeSystemSupportedLanguages()
static PlatformCreateInstance GetPlatformCreateCallbackAtIndex(uint32_t idx)
static bool CreateSettingForTracePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static UnwindAssemblyCreateInstance GetUnwindAssemblyCreateCallbackAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForOperatingSystemPlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec, Status &error, bool force_lookup=true, bool copy_executable=true)
static Status SaveCore(const lldb::ProcessSP &process_sp, const lldb_private::SaveCoreOptions &core_options)
static SymbolFileCreateInstance GetSymbolFileCreateCallbackAtIndex(uint32_t idx)
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static lldb::ScriptLanguage GetScriptedInterfaceLanguageAtIndex(uint32_t idx)
static TypeSystemCreateInstance GetTypeSystemCreateCallbackAtIndex(uint32_t idx)
static InstrumentationRuntimeGetType GetInstrumentationRuntimeGetTypeCallbackAtIndex(uint32_t idx)
static llvm::StringRef GetTraceSchema(llvm::StringRef plugin_name)
Get the JSON schema for a trace bundle description file corresponding to the given plugin.
static SymbolLocatorCreateInstance GetSymbolLocatorCreateCallbackAtIndex(uint32_t idx)
static TraceCreateInstanceForLiveProcess GetTraceCreateCallbackForLiveProcess(llvm::StringRef plugin_name)
static LanguageRuntimeCreateInstance GetLanguageRuntimeCreateCallbackAtIndex(uint32_t idx)
static std::unique_ptr< Architecture > CreateArchitectureInstance(const ArchSpec &arch)
static SystemRuntimeCreateInstance GetSystemRuntimeCreateCallbackAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForSymbolLocatorPlugin(Debugger &debugger, llvm::StringRef setting_name)
static uint32_t GetNumScriptedInterfaces()
static bool CreateSettingForProcessPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static SymbolVendorCreateInstance GetSymbolVendorCreateCallbackAtIndex(uint32_t idx)
static LanguageRuntimeGetCommandObject GetLanguageRuntimeGetCommandObjectAtIndex(uint32_t idx)
static OperatingSystemCreateInstance GetOperatingSystemCreateCallbackAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForPlatformPlugin(Debugger &debugger, llvm::StringRef setting_name)
static LanguageRuntimeGetExceptionPrecondition GetLanguageRuntimeGetExceptionPreconditionAtIndex(uint32_t idx)
static ModuleSpec LocateExecutableObjectFile(const ModuleSpec &module_spec)
static REPLCreateInstance GetREPLCreateCallbackAtIndex(uint32_t idx)
static ObjectFileCreateMemoryInstance GetObjectFileCreateMemoryCallbackAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForJITLoaderPlugin(Debugger &debugger, llvm::StringRef setting_name)
static DisassemblerCreateInstance GetDisassemblerCreateCallbackForPluginName(llvm::StringRef name)
static MemoryHistoryCreateInstance GetMemoryHistoryCreateCallbackAtIndex(uint32_t idx)
static bool CreateSettingForSymbolFilePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static bool CreateSettingForPlatformPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static OperatingSystemCreateInstance GetOperatingSystemCreateCallbackForPluginName(llvm::StringRef name)
static DisassemblerCreateInstance GetDisassemblerCreateCallbackAtIndex(uint32_t idx)
static ObjectContainerCreateInstance GetObjectContainerCreateCallbackAtIndex(uint32_t idx)
static ObjectFileCreateInstance GetObjectFileCreateCallbackAtIndex(uint32_t idx)
static EmulateInstructionCreateInstance GetEmulateInstructionCreateCallbackForPluginName(llvm::StringRef name)
static lldb::OptionValuePropertiesSP GetSettingForSymbolFilePlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool CreateSettingForStructuredDataPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static DynamicLoaderCreateInstance GetDynamicLoaderCreateCallbackAtIndex(uint32_t idx)
static ObjectFileGetModuleSpecifications GetObjectContainerGetModuleSpecificationsCallbackAtIndex(uint32_t idx)
static DynamicLoaderCreateInstance GetDynamicLoaderCreateCallbackForPluginName(llvm::StringRef name)
static PlatformCreateInstance GetPlatformCreateCallbackForPluginName(llvm::StringRef name)
static ScriptInterpreterCreateInstance GetScriptInterpreterCreateCallbackAtIndex(uint32_t idx)
static LanguageCreateInstance GetLanguageCreateCallbackAtIndex(uint32_t idx)
static lldb::OptionValuePropertiesSP GetSettingForProcessPlugin(Debugger &debugger, llvm::StringRef setting_name)
static ProcessCreateInstance GetProcessCreateCallbackForPluginName(llvm::StringRef name)
static llvm::StringRef GetScriptedInterfaceDescriptionAtIndex(uint32_t idx)
static llvm::StringRef GetProcessPluginDescriptionAtIndex(uint32_t idx)
static bool IsRegisteredObjectFilePluginName(llvm::StringRef name)
static lldb::OptionValuePropertiesSP GetSettingForDynamicLoaderPlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool CreateSettingForDynamicLoaderPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static StructuredDataPluginCreateInstance GetStructuredDataPluginCreateCallbackAtIndex(uint32_t idx)
static FileSpec LocateExecutableSymbolFile(const ModuleSpec &module_spec, const FileSpecList &default_search_paths)
static ObjectFileGetModuleSpecifications GetObjectFileGetModuleSpecificationsCallbackAtIndex(uint32_t idx)
static llvm::StringRef GetPlatformPluginNameAtIndex(uint32_t idx)
static TraceCreateInstanceFromBundle GetTraceCreateCallback(llvm::StringRef plugin_name)
static void DebuggerInitialize(Debugger &debugger)
static llvm::StringRef GetScriptedInterfaceNameAtIndex(uint32_t idx)
static llvm::StringRef GetProcessPluginNameAtIndex(uint32_t idx)
static LanguageSet GetAllTypeSystemSupportedLanguagesForTypes()
static bool UnregisterPlugin(ABICreateInstance create_callback)
static FileSpec FindSymbolFileInBundle(const FileSpec &dsym_bundle_fspec, const UUID *uuid, const ArchSpec *arch)
static ObjectContainerCreateMemoryInstance GetObjectContainerCreateMemoryCallbackAtIndex(uint32_t idx)
static StructuredDataFilterLaunchInfo GetStructuredDataFilterCallbackAtIndex(uint32_t idx, bool &iteration_complete)
static InstrumentationRuntimeCreateInstance GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx)
static LanguageSet GetREPLSupportedLanguagesAtIndex(uint32_t idx)
static lldb::RegisterTypeBuilderSP GetRegisterTypeBuilder(Target &target)
static ScriptedInterfaceUsages GetScriptedInterfaceUsagesAtIndex(uint32_t idx)
static ObjectFileCreateMemoryInstance GetObjectFileCreateMemoryCallbackForPluginName(llvm::StringRef name)
static bool CreateSettingForSymbolLocatorPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static EmulateInstructionCreateInstance GetEmulateInstructionCreateCallbackAtIndex(uint32_t idx)
virtual lldb::OptionValuePropertiesSP GetValueProperties() const
const std::optional< lldb_private::FileSpec > GetOutputFile() const
std::optional< std::string > GetPluginName() const
A class that represents a running process on the host machine.
bool(* ObjectFileSaveCore)(const lldb::ProcessSP &process_sp, const lldb_private::SaveCoreOptions &options, Status &error)
SymbolVendor *(* SymbolVendorCreateInstance)(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm)
llvm::Expected< lldb::TraceSP >(* TraceCreateInstanceForLiveProcess)(Process &process)
lldb::InstrumentationRuntimeType(* InstrumentationRuntimeGetType)()
std::optional< FileSpec >(* SymbolLocatorLocateExecutableSymbolFile)(const ModuleSpec &module_spec, const FileSpecList &default_search_paths)
EmulateInstruction *(* EmulateInstructionCreateInstance)(const ArchSpec &arch, InstructionType inst_type)
ObjectContainer *(* ObjectContainerCreateMemoryInstance)(const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t offset)
size_t(* ObjectFileGetModuleSpecifications)(const FileSpec &file, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, lldb::offset_t file_offset, lldb::offset_t length, ModuleSpecList &module_specs)
void(* DebuggerInitializeCallback)(Debugger &debugger)
std::unique_ptr< Architecture >(* ArchitectureCreateInstance)(const ArchSpec &arch)
lldb::PlatformSP(* PlatformCreateInstance)(bool force, const ArchSpec *arch)
SystemRuntime *(* SystemRuntimeCreateInstance)(Process *process)
lldb::ProcessSP(* ProcessCreateInstance)(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec *crash_file_path, bool can_connect)
UnwindAssembly *(* UnwindAssemblyCreateInstance)(const ArchSpec &arch)
lldb::BreakpointPreconditionSP(* LanguageRuntimeGetExceptionPrecondition)(lldb::LanguageType language, bool throw_bp)
lldb::MemoryHistorySP(* MemoryHistoryCreateInstance)(const lldb::ProcessSP &process_sp)
ObjectFile *(* ObjectFileCreateMemoryInstance)(const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t offset)
std::optional< ModuleSpec >(* SymbolLocatorLocateExecutableObjectFile)(const ModuleSpec &module_spec)
lldb::CommandObjectSP(* LanguageRuntimeGetCommandObject)(CommandInterpreter &interpreter)
DynamicLoader *(* DynamicLoaderCreateInstance)(Process *process, bool force)
lldb::JITLoaderSP(* JITLoaderCreateInstance)(Process *process, bool force)
OperatingSystem *(* OperatingSystemCreateInstance)(Process *process, bool force)
SymbolFile *(* SymbolFileCreateInstance)(lldb::ObjectFileSP objfile_sp)
std::optional< FileSpec >(* SymbolLocatorFindSymbolFileInBundle)(const FileSpec &dsym_bundle_fspec, const UUID *uuid, const ArchSpec *arch)
bool(* SymbolLocatorDownloadObjectAndSymbolFile)(ModuleSpec &module_spec, Status &error, bool force_lookup, bool copy_executable)
Language *(* LanguageCreateInstance)(lldb::LanguageType language)
Status(* StructuredDataFilterLaunchInfo)(ProcessLaunchInfo &launch_info, Target *target)
lldb::ABISP(* ABICreateInstance)(lldb::ProcessSP process_sp, const ArchSpec &arch)
lldb::DisassemblerSP(* DisassemblerCreateInstance)(const ArchSpec &arch, const char *flavor)
lldb::CommandObjectSP(* ThreadTraceExportCommandCreator)(CommandInterpreter &interpreter)
ScriptLanguage
Script interpreter types.
std::shared_ptr< lldb_private::OptionValueProperties > OptionValuePropertiesSP
std::shared_ptr< lldb_private::ScriptInterpreter > ScriptInterpreterSP
std::shared_ptr< lldb_private::RegisterTypeBuilder > RegisterTypeBuilderSP
std::shared_ptr< lldb_private::Process > ProcessSP
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)
ScriptedInterfaceUsages usages
lldb::ScriptLanguage language
ScriptedInterfaceInstance(llvm::StringRef name, llvm::StringRef description, ScriptedInterfaceCreateInstance create_callback, lldb::ScriptLanguage language, ScriptedInterfaceUsages usages)
StructuredDataPluginInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, DebuggerInitializeCallback debugger_init_callback, StructuredDataFilterLaunchInfo filter_callback)
SymbolLocatorFindSymbolFileInBundle find_symbol_file_in_bundle
SymbolLocatorInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, SymbolLocatorLocateExecutableObjectFile locate_executable_object_file, SymbolLocatorLocateExecutableSymbolFile locate_executable_symbol_file, SymbolLocatorDownloadObjectAndSymbolFile download_object_symbol_file, SymbolLocatorFindSymbolFileInBundle find_symbol_file_in_bundle, DebuggerInitializeCallback debugger_init_callback)
SymbolLocatorLocateExecutableSymbolFile locate_executable_symbol_file
SymbolLocatorDownloadObjectAndSymbolFile download_object_symbol_file
SymbolLocatorLocateExecutableObjectFile locate_executable_object_file
ThreadTraceExportCommandCreator create_thread_trace_export_command
TraceExporterInstance(llvm::StringRef name, llvm::StringRef description, TraceExporterCreateInstance create_instance, ThreadTraceExportCommandCreator create_thread_trace_export_command)
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