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");
723 llvm::Expected<bool> ret =
726 return Status(ret.takeError());
732 const auto &plugin_name = options.
GetPluginName().value_or(
"");
734 for (
auto &instance : instances) {
735 if (plugin_name.empty() || instance.name == plugin_name) {
736 if (instance.save_core && instance.save_core(process_sp, options,
error))
744 error.SetErrorString(
745 "no ObjectFile plugins were able to save a core for this process");
749#pragma mark ObjectContainer
754 llvm::StringRef name, llvm::StringRef description,
760 create_memory_callback(create_memory_callback),
761 get_module_specifications(get_module_specifications) {}
774 llvm::StringRef name, llvm::StringRef description,
779 name, description, create_callback, create_memory_callback,
780 get_module_specifications);
796 if (idx < instances.size())
797 return instances[idx].create_memory_callback;
805 if (idx < instances.size())
806 return instances[idx].get_module_specifications;
817 return g_platform_instances;
821 llvm::StringRef name, llvm::StringRef description,
825 name, description, create_callback, debugger_init_callback);
854 if (instance.name.starts_with(name))
870 llvm::StringRef name, llvm::StringRef description,
874 name, description, create_callback, debugger_init_callback);
902 if (instance.name.starts_with(name))
907#pragma mark RegisterTypeBuilder
926 llvm::StringRef name, llvm::StringRef description,
942 assert(instances.size());
943 return instances[0].create_callback(target);
946#pragma mark ScriptInterpreter
955 language(language) {}
968 llvm::StringRef name, llvm::StringRef description,
972 name, description, create_callback, script_language);
990 for (
const auto &instance : instances) {
992 none_instance = instance.create_callback;
994 if (script_lang == instance.language)
995 return instance.create_callback(debugger);
999 assert(none_instance !=
nullptr);
1000 return none_instance(debugger);
1003#pragma mark StructuredDataPlugin
1008 llvm::StringRef name, llvm::StringRef description,
1013 name, description, create_callback, debugger_init_callback),
1014 filter_callback(filter_callback) {}
1028 llvm::StringRef name, llvm::StringRef description,
1033 name, description, create_callback, debugger_init_callback,
1049 uint32_t idx,
bool &iteration_complete) {
1051 if (idx < instances.size()) {
1052 iteration_complete =
false;
1053 return instances[idx].filter_callback;
1055 iteration_complete =
true;
1060#pragma mark SymbolFile
1071 llvm::StringRef name, llvm::StringRef description,
1075 name, description, create_callback, debugger_init_callback);
1087#pragma mark SymbolVendor
1098 llvm::StringRef description,
1114#pragma mark SymbolLocator
1119 llvm::StringRef name, llvm::StringRef description,
1127 name, description, create_callback, debugger_init_callback),
1128 locate_executable_object_file(locate_executable_object_file),
1129 locate_executable_symbol_file(locate_executable_symbol_file),
1130 download_object_symbol_file(download_object_symbol_file),
1131 find_symbol_file_in_bundle(find_symbol_file_in_bundle) {}
1146 llvm::StringRef name, llvm::StringRef description,
1154 name, description, create_callback, locate_executable_object_file,
1155 locate_executable_symbol_file, download_object_symbol_file,
1156 find_symbol_file_in_bundle, debugger_init_callback);
1172 for (
auto &instance : instances) {
1173 if (instance.locate_executable_object_file) {
1174 std::optional<ModuleSpec> result =
1175 instance.locate_executable_object_file(module_spec);
1186 for (
auto &instance : instances) {
1187 if (instance.locate_executable_symbol_file) {
1188 std::optional<FileSpec> result = instance.locate_executable_symbol_file(
1189 module_spec, default_search_paths);
1200 bool copy_executable) {
1202 for (
auto &instance : instances) {
1203 if (instance.download_object_symbol_file) {
1204 if (instance.download_object_symbol_file(module_spec,
error, force_lookup,
1216 for (
auto &instance : instances) {
1217 if (instance.find_symbol_file_in_bundle) {
1218 std::optional<FileSpec> result =
1219 instance.find_symbol_file_in_bundle(symfile_bundle, uuid, arch);
1232 llvm::StringRef name, llvm::StringRef description,
1237 name, description, create_callback_from_bundle,
1238 debugger_init_callback),
1240 create_callback_for_live_process(create_callback_for_live_process) {}
1254 llvm::StringRef name, llvm::StringRef description,
1259 name, description, create_callback_from_bundle,
1260 create_callback_for_live_process, schema, debugger_init_callback);
1266 create_callback_from_bundle);
1277 if (instance.name == plugin_name)
1278 return instance.create_callback_for_live_process;
1284 if (instance.name == plugin_name)
1285 return instance.schema;
1286 return llvm::StringRef();
1292 return instance->schema;
1293 return llvm::StringRef();
1296#pragma mark TraceExporter
1301 llvm::StringRef name, llvm::StringRef description,
1306 create_thread_trace_export_command(create_thread_trace_export_command) {
1320 llvm::StringRef name, llvm::StringRef description,
1324 name, description, create_callback, create_thread_trace_export_command);
1341 return instance->create_thread_trace_export_command;
1350#pragma mark UnwindAssembly
1361 llvm::StringRef name, llvm::StringRef description,
1377#pragma mark MemoryHistory
1388 llvm::StringRef name, llvm::StringRef description,
1404#pragma mark InstrumentationRuntime
1409 llvm::StringRef name, llvm::StringRef description,
1414 get_type_callback(get_type_callback) {}
1428 llvm::StringRef name, llvm::StringRef description,
1432 name, description, create_callback, get_type_callback);
1443 if (idx < instances.size())
1444 return instances[idx].get_type_callback;
1453#pragma mark TypeSystem
1462 supported_languages_for_types(supported_languages_for_types),
1463 supported_languages_for_expressions(
1464 supported_languages_for_expressions) {}
1478 llvm::StringRef name, llvm::StringRef description,
1481 LanguageSet supported_languages_for_expressions) {
1483 name, description, create_callback, supported_languages_for_types,
1484 supported_languages_for_expressions);
1499 for (
unsigned i = 0; i < instances.size(); ++i)
1500 all.
bitvector |= instances[i].supported_languages_for_types.bitvector;
1507 for (
unsigned i = 0; i < instances.size(); ++i)
1508 all.
bitvector |= instances[i].supported_languages_for_expressions.bitvector;
1512#pragma mark ScriptedInterfaces
1522 language(language), usages(usages) {}
1536 llvm::StringRef name, llvm::StringRef description,
1540 name, description, create_callback, language, usages);
1564 return idx < instances.size() ? instances[idx].language
1565 : ScriptLanguage::eScriptLanguageNone;
1571 if (idx >= instances.size())
1573 return instances[idx].usages;
1582 supported_languages(supported_languages) {}
1598 supported_languages);
1611 return idx < instances.size() ? instances[idx].supported_languages
1618 for (
unsigned i = 0; i < instances.size(); ++i)
1619 all.
bitvector |= instances[i].supported_languages.bitvector;
1623#pragma mark PluginManager
1644 llvm::StringRef plugin_type_desc,
1648 if (parent_properties_sp) {
1649 static constexpr llvm::StringLiteral g_property_name(
"plugin");
1652 parent_properties_sp->GetSubProperty(
nullptr, g_property_name);
1653 if (!plugin_properties_sp && can_create) {
1654 plugin_properties_sp =
1655 std::make_shared<OptionValueProperties>(g_property_name);
1656 parent_properties_sp->AppendProperty(g_property_name,
1657 "Settings specify to plugins.",
true,
1658 plugin_properties_sp);
1661 if (plugin_properties_sp) {
1663 plugin_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
1664 if (!plugin_type_properties_sp && can_create) {
1665 plugin_type_properties_sp =
1666 std::make_shared<OptionValueProperties>(plugin_type_name);
1667 plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1668 true, plugin_type_properties_sp);
1670 return plugin_type_properties_sp;
1680 Debugger &debugger, llvm::StringRef plugin_type_name,
1681 llvm::StringRef plugin_type_desc,
bool can_create) {
1682 static constexpr llvm::StringLiteral g_property_name(
"plugin");
1685 if (parent_properties_sp) {
1687 parent_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
1688 if (!plugin_properties_sp && can_create) {
1689 plugin_properties_sp =
1690 std::make_shared<OptionValueProperties>(plugin_type_name);
1691 parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
1692 true, plugin_properties_sp);
1695 if (plugin_properties_sp) {
1697 plugin_properties_sp->GetSubProperty(
nullptr, g_property_name);
1698 if (!plugin_type_properties_sp && can_create) {
1699 plugin_type_properties_sp =
1700 std::make_shared<OptionValueProperties>(g_property_name);
1701 plugin_properties_sp->AppendProperty(g_property_name,
1702 "Settings specific to plugins",
1703 true, plugin_type_properties_sp);
1705 return plugin_type_properties_sp;
1714GetDebuggerPropertyForPluginsPtr(
Debugger &, llvm::StringRef, llvm::StringRef,
1720 llvm::StringRef plugin_type_name,
1721 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1725 debugger, plugin_type_name,
1728 if (plugin_type_properties_sp)
1730 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
1731 return properties_sp;
1736 llvm::StringRef plugin_type_desc,
1738 llvm::StringRef description,
bool is_global_property,
1739 GetDebuggerPropertyForPluginsPtr get_debugger_property =
1741 if (properties_sp) {
1743 get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
1745 if (plugin_type_properties_sp) {
1746 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1747 description, is_global_property,
1763static constexpr llvm::StringLiteral
1768 llvm::StringRef setting_name) {
1774 llvm::StringRef description,
bool is_global_property) {
1776 "Settings for dynamic loader plug-ins",
1777 properties_sp, description, is_global_property);
1782 llvm::StringRef setting_name) {
1789 llvm::StringRef description,
bool is_global_property) {
1791 "Settings for platform plug-ins", properties_sp,
1792 description, is_global_property,
1798 llvm::StringRef setting_name) {
1804 llvm::StringRef description,
bool is_global_property) {
1806 "Settings for process plug-ins", properties_sp,
1807 description, is_global_property);
1812 llvm::StringRef setting_name) {
1818 llvm::StringRef description,
bool is_global_property) {
1820 "Settings for symbol locator plug-ins",
1821 properties_sp, description, is_global_property);
1826 llvm::StringRef description,
bool is_global_property) {
1828 "Settings for trace plug-ins", properties_sp,
1829 description, is_global_property);
1834 llvm::StringRef setting_name) {
1840 llvm::StringRef description,
bool is_global_property) {
1842 "Settings for object file plug-ins",
1843 properties_sp, description, is_global_property);
1848 llvm::StringRef setting_name) {
1854 llvm::StringRef description,
bool is_global_property) {
1856 "Settings for symbol file plug-ins",
1857 properties_sp, description, is_global_property);
1862 llvm::StringRef setting_name) {
1868 llvm::StringRef description,
bool is_global_property) {
1870 "Settings for JIT loader plug-ins",
1871 properties_sp, description, is_global_property);
1878 llvm::StringRef setting_name) {
1885 if (plugin_type_properties_sp)
1887 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
1888 return properties_sp;
1893 llvm::StringRef description,
bool is_global_property) {
1894 if (properties_sp) {
1897 "Settings for operating system plug-ins",
1899 if (plugin_type_properties_sp) {
1900 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
1901 description, is_global_property,
1911 llvm::StringRef setting_name) {
1917 llvm::StringRef description,
bool is_global_property) {
1919 "Settings for structured data plug-ins",
1920 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 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 Status SaveCore(const lldb::ProcessSP &process_sp, lldb_private::SaveCoreOptions &core_options)
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
Status EnsureValidConfiguration(lldb::ProcessSP process_sp) const
A class that represents a running process on the host machine.
SymbolVendor *(* SymbolVendorCreateInstance)(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm)
bool(* ObjectFileSaveCore)(const lldb::ProcessSP &process_sp, lldb_private::SaveCoreOptions &options, Status &error)
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