19#include "llvm/ADT/StringRef.h"
20#include "llvm/Support/DynamicLibrary.h"
21#include "llvm/Support/FileSystem.h"
22#include "llvm/Support/raw_ostream.h"
51 static std::recursive_mutex g_plugin_map_mutex;
52 return g_plugin_map_mutex;
63 return plugin_map.find(plugin_file_spec) != plugin_map.end();
70 assert(plugin_map.find(plugin_file_spec) == plugin_map.end());
71 plugin_map[plugin_file_spec] = plugin_info;
74template <
typename FPtrTy>
static FPtrTy
CastToFPtr(
void *VPtr) {
75 return reinterpret_cast<FPtrTy
>(VPtr);
80 llvm::StringRef path) {
83 namespace fs = llvm::sys::fs;
88 if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||
89 ft == fs::file_type::type_unknown) {
98 std::string pluginLoadError;
99 plugin_info.
library = llvm::sys::DynamicLibrary::getPermanentLibrary(
100 plugin_file_spec.
GetPath().c_str(), &pluginLoadError);
101 if (plugin_info.
library.isValid()) {
102 bool success =
false;
104 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginInitialize"));
113 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginTerminate"));
131 if (ft == fs::file_type::directory_file ||
132 ft == fs::file_type::symlink_file || ft == fs::file_type::type_unknown) {
144 const bool find_directories =
true;
145 const bool find_files =
true;
146 const bool find_other =
true;
148 if (
FileSpec dir_spec = HostInfo::GetSystemPluginDir()) {
150 dir_spec.GetPath(dir_path,
sizeof(dir_path))) {
152 find_files, find_other,
157 if (
FileSpec dir_spec = HostInfo::GetUserPluginDir()) {
159 dir_spec.GetPath(dir_path,
sizeof(dir_path))) {
161 find_files, find_other,
171 PluginTerminateMap::const_iterator pos, end = plugin_map.end();
172 for (pos = plugin_map.begin(); pos != end; ++pos) {
175 if (pos->second.library.isValid()) {
176 if (pos->second.plugin_term_callback)
177 pos->second.plugin_term_callback();
188 Callback create_callback,
190 : name(name), description(description), create_callback(create_callback),
191 debugger_init_callback(debugger_init_callback) {}
201 template <
typename...
Args>
203 typename Instance::CallbackType callback,
207 assert(!name.empty());
209 Instance(name, description, callback, std::forward<Args>(args)...);
210 m_instances.push_back(instance);
217 auto pos = m_instances.begin();
218 auto end = m_instances.end();
219 for (; pos != end; ++pos) {
220 if (pos->create_callback == callback) {
221 m_instances.erase(pos);
229 if (Instance *instance = GetInstanceAtIndex(idx))
230 return instance->create_callback;
235 if (Instance *instance = GetInstanceAtIndex(idx))
236 return instance->description;
241 if (Instance *instance = GetInstanceAtIndex(idx))
242 return instance->name;
249 for (
auto &instance : m_instances) {
250 if (name == instance.name)
251 return instance.create_callback;
257 for (
auto &instance : m_instances) {
258 if (instance.debugger_init_callback)
259 instance.debugger_init_callback(debugger);
263 const std::vector<Instance> &
GetInstances()
const {
return m_instances; }
267 if (idx < m_instances.size())
268 return &m_instances[idx];
287 llvm::StringRef description,
300#pragma mark Architecture
311 llvm::StringRef description,
320 for (
auto pos = instances.begin(), end = instances.end(); pos != end; ++pos) {
321 if (pos->create_callback == create_callback) {
322 instances.erase(pos);
326 llvm_unreachable(
"Plugin not found");
329std::unique_ptr<Architecture>
332 if (
auto plugin_up = instances.create_callback(arch))
338#pragma mark Disassembler
349 llvm::StringRef description,
367 llvm::StringRef name) {
371#pragma mark DynamicLoader
382 llvm::StringRef name, llvm::StringRef description,
386 name, description, create_callback, debugger_init_callback);
401 llvm::StringRef name) {
405#pragma mark JITLoader
416 llvm::StringRef name, llvm::StringRef description,
420 name, description, create_callback, debugger_init_callback);
432#pragma mark EmulateInstruction
444 llvm::StringRef name, llvm::StringRef description,
462 llvm::StringRef name) {
466#pragma mark OperatingSystem
477 llvm::StringRef name, llvm::StringRef description,
481 name, description, create_callback, debugger_init_callback);
496 llvm::StringRef name) {
511 llvm::StringRef description,
526#pragma mark LanguageRuntime
531 llvm::StringRef name, llvm::StringRef description,
537 name, description, create_callback, debugger_init_callback),
538 command_callback(command_callback),
539 precondition_callback(precondition_callback) {}
553 llvm::StringRef name, llvm::StringRef description,
558 name, description, create_callback,
nullptr, command_callback,
559 precondition_callback);
575 if (idx < instances.size())
576 return instances[idx].command_callback;
583 if (idx < instances.size())
584 return instances[idx].precondition_callback;
588#pragma mark SystemRuntime
599 llvm::StringRef name, llvm::StringRef description,
615#pragma mark ObjectFile
619 llvm::StringRef name, llvm::StringRef description,
626 name, description, create_callback, debugger_init_callback),
627 create_memory_callback(create_memory_callback),
628 get_module_specifications(get_module_specifications),
629 save_core(save_core) {}
643 llvm::StringRef name, llvm::StringRef description,
650 name, description, create_callback, create_memory_callback,
651 get_module_specifications, save_core, debugger_init_callback);
666 if (idx < instances.size())
667 return instances[idx].create_memory_callback;
675 if (idx < instances.size())
676 return instances[idx].get_module_specifications;
682 llvm::StringRef name) {
684 for (
auto &instance : instances) {
685 if (instance.name == name)
686 return instance.create_memory_callback;
694 llvm::StringRef plugin_name) {
695 if (plugin_name.empty()) {
697 llvm::Expected<bool> ret = process_sp->SaveCore(outfile.
GetPath());
699 return Status(ret.takeError());
707 for (
auto &instance : instances) {
708 if (plugin_name.empty() || instance.name == plugin_name) {
709 if (instance.save_core &&
710 instance.save_core(process_sp, outfile, core_style,
error))
714 error.SetErrorString(
715 "no ObjectFile plugins were able to save a core for this process");
719#pragma mark ObjectContainer
724 llvm::StringRef name, llvm::StringRef description,
730 create_memory_callback(create_memory_callback),
731 get_module_specifications(get_module_specifications) {}
744 llvm::StringRef name, llvm::StringRef description,
749 name, description, create_callback, create_memory_callback,
750 get_module_specifications);
766 if (idx < instances.size())
767 return instances[idx].create_memory_callback;
775 if (idx < instances.size())
776 return instances[idx].get_module_specifications;
787 return g_platform_instances;
791 llvm::StringRef name, llvm::StringRef description,
795 name, description, create_callback, debugger_init_callback);
824 if (instance.name.startswith(name))
840 llvm::StringRef name, llvm::StringRef description,
844 name, description, create_callback, debugger_init_callback);
872 if (instance.name.startswith(name))
877#pragma mark RegisterTypeBuilder
896 llvm::StringRef name, llvm::StringRef description,
912 assert(instances.size());
913 return instances[0].create_callback(target);
916#pragma mark ScriptInterpreter
925 language(language) {}
938 llvm::StringRef name, llvm::StringRef description,
942 name, description, create_callback, script_language);
960 for (
const auto &instance : instances) {
962 none_instance = instance.create_callback;
964 if (script_lang == instance.language)
965 return instance.create_callback(debugger);
969 assert(none_instance !=
nullptr);
970 return none_instance(debugger);
973#pragma mark StructuredDataPlugin
978 llvm::StringRef name, llvm::StringRef description,
983 name, description, create_callback, debugger_init_callback),
984 filter_callback(filter_callback) {}
998 llvm::StringRef name, llvm::StringRef description,
1003 name, description, create_callback, debugger_init_callback,
1019 uint32_t idx,
bool &iteration_complete) {
1021 if (idx < instances.size()) {
1022 iteration_complete =
false;
1023 return instances[idx].filter_callback;
1025 iteration_complete =
true;
1030#pragma mark SymbolFile
1041 llvm::StringRef name, llvm::StringRef description,
1045 name, description, create_callback, debugger_init_callback);
1057#pragma mark SymbolVendor
1068 llvm::StringRef description,
1084#pragma mark SymbolLocator
1089 llvm::StringRef name, llvm::StringRef description,
1097 name, description, create_callback, debugger_init_callback),
1098 locate_executable_object_file(locate_executable_object_file),
1099 locate_executable_symbol_file(locate_executable_symbol_file),
1100 download_object_symbol_file(download_object_symbol_file),
1101 find_symbol_file_in_bundle(find_symbol_file_in_bundle) {}
1116 llvm::StringRef name, llvm::StringRef description,
1124 name, description, create_callback, locate_executable_object_file,
1125 locate_executable_symbol_file, download_object_symbol_file,
1126 find_symbol_file_in_bundle, debugger_init_callback);
1142 for (
auto &instance : instances) {
1143 if (instance.locate_executable_object_file) {
1144 std::optional<ModuleSpec> result =
1145 instance.locate_executable_object_file(module_spec);
1156 for (
auto &instance : instances) {
1157 if (instance.locate_executable_symbol_file) {
1158 std::optional<FileSpec> result = instance.locate_executable_symbol_file(
1159 module_spec, default_search_paths);
1170 bool copy_executable) {
1172 for (
auto &instance : instances) {
1173 if (instance.download_object_symbol_file) {
1174 if (instance.download_object_symbol_file(module_spec,
error, force_lookup,
1186 for (
auto &instance : instances) {
1187 if (instance.find_symbol_file_in_bundle) {
1188 std::optional<FileSpec> result =
1189 instance.find_symbol_file_in_bundle(symfile_bundle, uuid, arch);
1202 llvm::StringRef name, llvm::StringRef description,
1207 name, description, create_callback_from_bundle,
1208 debugger_init_callback),
1210 create_callback_for_live_process(create_callback_for_live_process) {}
1224 llvm::StringRef name, llvm::StringRef description,
1229 name, description, create_callback_from_bundle,
1230 create_callback_for_live_process, schema, debugger_init_callback);
1236 create_callback_from_bundle);
1247 if (instance.name == plugin_name)
1248 return instance.create_callback_for_live_process;
1254 if (instance.name == plugin_name)
1255 return instance.schema;
1256 return llvm::StringRef();
1262 return instance->schema;
1263 return llvm::StringRef();
1266#pragma mark TraceExporter
1271 llvm::StringRef name, llvm::StringRef description,
1276 create_thread_trace_export_command(create_thread_trace_export_command) {
1290 llvm::StringRef name, llvm::StringRef description,
1294 name, description, create_callback, create_thread_trace_export_command);
1311 return instance->create_thread_trace_export_command;
1320#pragma mark UnwindAssembly
1331 llvm::StringRef name, llvm::StringRef description,
1347#pragma mark MemoryHistory
1358 llvm::StringRef name, llvm::StringRef description,
1374#pragma mark InstrumentationRuntime
1379 llvm::StringRef name, llvm::StringRef description,
1384 get_type_callback(get_type_callback) {}
1398 llvm::StringRef name, llvm::StringRef description,
1402 name, description, create_callback, get_type_callback);
1413 if (idx < instances.size())
1414 return instances[idx].get_type_callback;
1423#pragma mark TypeSystem
1432 supported_languages_for_types(supported_languages_for_types),
1433 supported_languages_for_expressions(
1434 supported_languages_for_expressions) {}
1448 llvm::StringRef name, llvm::StringRef description,
1451 LanguageSet supported_languages_for_expressions) {
1453 name, description, create_callback, supported_languages_for_types,
1454 supported_languages_for_expressions);
1469 for (
unsigned i = 0; i < instances.size(); ++i)
1470 all.
bitvector |= instances[i].supported_languages_for_types.bitvector;
1477 for (
unsigned i = 0; i < instances.size(); ++i)
1478 all.
bitvector |= instances[i].supported_languages_for_expressions.bitvector;
1488 supported_languages(supported_languages) {}
1504 supported_languages);
1517 return idx < instances.size() ? instances[idx].supported_languages
1524 for (
unsigned i = 0; i < instances.size(); ++i)
1525 all.
bitvector |= instances[i].supported_languages.bitvector;
1529#pragma mark PluginManager
1549 llvm::StringRef plugin_type_desc,
1553 if (parent_properties_sp) {
1554 static constexpr llvm::StringLiteral g_property_name(
"plugin");
1557 parent_properties_sp->GetSubProperty(
nullptr, g_property_name);
1558 if (!plugin_properties_sp && can_create) {
1559 plugin_properties_sp =
1560 std::make_shared<OptionValueProperties>(g_property_name);
1561 parent_properties_sp->AppendProperty(g_property_name,
1562 "Settings specify to plugins.",
true,
1563 plugin_properties_sp);
1566 if (plugin_properties_sp) {
1568 plugin_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
1569 if (!plugin_type_properties_sp && can_create) {
1570 plugin_type_properties_sp =
1571 std::make_shared<OptionValueProperties>(plugin_type_name);
1572 plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1573 true, plugin_type_properties_sp);
1575 return plugin_type_properties_sp;
1585 Debugger &debugger, llvm::StringRef plugin_type_name,
1586 llvm::StringRef plugin_type_desc,
bool can_create) {
1587 static constexpr llvm::StringLiteral g_property_name(
"plugin");
1590 if (parent_properties_sp) {
1592 parent_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
1593 if (!plugin_properties_sp && can_create) {
1594 plugin_properties_sp =
1595 std::make_shared<OptionValueProperties>(plugin_type_name);
1596 parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1597 true, plugin_properties_sp);
1600 if (plugin_properties_sp) {
1602 plugin_properties_sp->GetSubProperty(
nullptr, g_property_name);
1603 if (!plugin_type_properties_sp && can_create) {
1604 plugin_type_properties_sp =
1605 std::make_shared<OptionValueProperties>(g_property_name);
1606 plugin_properties_sp->AppendProperty(g_property_name,
1607 "Settings specific to plugins",
1608 true, plugin_type_properties_sp);
1610 return plugin_type_properties_sp;
1619GetDebuggerPropertyForPluginsPtr(
Debugger &, llvm::StringRef, llvm::StringRef,
1625 llvm::StringRef plugin_type_name,
1626 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1630 debugger, plugin_type_name,
1633 if (plugin_type_properties_sp)
1635 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
1636 return properties_sp;
1641 llvm::StringRef plugin_type_desc,
1643 llvm::StringRef description,
bool is_global_property,
1644 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1646 if (properties_sp) {
1648 get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
1650 if (plugin_type_properties_sp) {
1651 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1652 description, is_global_property,
1668static constexpr llvm::StringLiteral
1673 llvm::StringRef setting_name) {
1679 llvm::StringRef description,
bool is_global_property) {
1681 "Settings for dynamic loader plug-ins",
1682 properties_sp, description, is_global_property);
1687 llvm::StringRef setting_name) {
1694 llvm::StringRef description,
bool is_global_property) {
1696 "Settings for platform plug-ins", properties_sp,
1697 description, is_global_property,
1703 llvm::StringRef setting_name) {
1709 llvm::StringRef description,
bool is_global_property) {
1711 "Settings for process plug-ins", properties_sp,
1712 description, is_global_property);
1717 llvm::StringRef setting_name) {
1723 llvm::StringRef description,
bool is_global_property) {
1725 "Settings for symbol locator plug-ins",
1726 properties_sp, description, is_global_property);
1731 llvm::StringRef description,
bool is_global_property) {
1733 "Settings for trace plug-ins", properties_sp,
1734 description, is_global_property);
1739 llvm::StringRef setting_name) {
1745 llvm::StringRef description,
bool is_global_property) {
1747 "Settings for object file plug-ins",
1748 properties_sp, description, is_global_property);
1753 llvm::StringRef setting_name) {
1759 llvm::StringRef description,
bool is_global_property) {
1761 "Settings for symbol file plug-ins",
1762 properties_sp, description, is_global_property);
1767 llvm::StringRef setting_name) {
1773 llvm::StringRef description,
bool is_global_property) {
1775 "Settings for JIT loader plug-ins",
1776 properties_sp, description, is_global_property);
1783 llvm::StringRef setting_name) {
1790 if (plugin_type_properties_sp)
1792 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
1793 return properties_sp;
1798 llvm::StringRef description,
bool is_global_property) {
1799 if (properties_sp) {
1802 "Settings for operating system plug-ins",
1804 if (plugin_type_properties_sp) {
1805 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1806 description, is_global_property,
1816 llvm::StringRef setting_name) {
1822 llvm::StringRef description,
bool is_global_property) {
1824 "Settings for structured data plug-ins",
1825 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 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< 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 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 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 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 Status SaveCore(const lldb::ProcessSP &process_sp, const FileSpec &outfile, lldb::SaveCoreStyle &core_style, llvm::StringRef plugin_name)
static lldb::OptionValuePropertiesSP GetSettingForProcessPlugin(Debugger &debugger, llvm::StringRef setting_name)
static ProcessCreateInstance GetProcessCreateCallbackForPluginName(llvm::StringRef name)
static llvm::StringRef GetProcessPluginDescriptionAtIndex(uint32_t idx)
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 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 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
A class that represents a running process on the host machine.
SymbolVendor *(* SymbolVendorCreateInstance)(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm)
llvm::Expected< lldb::TraceSP >(* TraceCreateInstanceForLiveProcess)(Process &process)
bool(* ObjectFileSaveCore)(const lldb::ProcessSP &process_sp, const FileSpec &outfile, lldb::SaveCoreStyle &core_style, Status &error)
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)
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