20#include "llvm/ADT/StringRef.h"
21#include "llvm/ADT/Twine.h"
22#include "llvm/Support/DynamicLibrary.h"
23#include "llvm/Support/ErrorExtras.h"
24#include "llvm/Support/FileSystem.h"
25#include "llvm/Support/raw_ostream.h"
55 library = std::move(other.library);
80enum class PluginLifecycle { Uninitialized, Initialized, Terminated };
82struct PluginRegistry {
83 std::recursive_mutex mutex;
87 std::lock_guard<std::recursive_mutex> guard(mutex);
88 lifecycle = PluginLifecycle::Initialized;
92 std::lock_guard<std::recursive_mutex> guard(mutex);
93 lifecycle = PluginLifecycle::Terminated;
100 bool IsTerminated()
const {
return lifecycle == PluginLifecycle::Terminated; }
103 PluginLifecycle lifecycle = PluginLifecycle::Uninitialized;
114 static PluginRegistry *g_registry =
new PluginRegistry();
133 assert(!plugin_map.contains(plugin_file_spec));
134 plugin_map.try_emplace(plugin_file_spec, std::move(plugin_info));
137template <
typename FPtrTy>
static FPtrTy
CastToFPtr(
void *VPtr) {
138 return reinterpret_cast<FPtrTy
>(VPtr);
166 plugin_info.
library = llvm::sys::DynamicLibrary::getPermanentLibrary(
168 if (!plugin_info.
library.isValid())
169 return llvm::createStringError(
error);
176 llvm::StringRef plugin_name = file_name.substr(
g_plugin_prefix.size());
177 std::string init_symbol =
178 llvm::Twine(
"lldb_initialize_" + plugin_name).str();
181 plugin_info.
library.getAddressOfSymbol(init_symbol.c_str()))) {
183 return llvm::createStringErrorV(
"initializer '{0}' returned false",
185 const std::string term_symbol =
186 llvm::Twine(
"lldb_terminate_" + plugin_name).str();
188 plugin_info.
library.getAddressOfSymbol(term_symbol.c_str()));
195 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginInitialize"))) {
197 return llvm::createStringError(
198 "initializer 'LLDBPluginInitialize' returned false");
202 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginTerminate"));
206 return llvm::createStringError(
"no initialize symbol found");
211 llvm::StringRef path) {
212 namespace fs = llvm::sys::fs;
214 static constexpr std::array<llvm::StringLiteral, 3>
215 g_shared_library_extension = {
".dylib",
".so",
".dll"};
221 if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||
222 ft == fs::file_type::type_unknown) {
227 if (!llvm::is_contained(g_shared_library_extension,
243 llvm::Expected<PluginInfo> plugin_info =
252 "could not load plugin: {0}");
258 if (ft == fs::file_type::directory_file ||
259 ft == fs::file_type::symlink_file || ft == fs::file_type::type_unknown) {
273 static const bool find_directories =
true;
274 static const bool find_files =
true;
275 static const bool find_other =
true;
281 const std::array<PluginDir, 3> plugin_dirs = {
286 for (
const PluginDir &plugin_dir : plugin_dirs) {
289 plugin_dir.path.GetPath().c_str(), find_directories, find_files,
325 "emulate-instruction",
331 "instrumentation-runtime",
397 "register-type-builder",
403 "script-interpreter",
409 "scripted-interface",
469 return PluginNamespaces;
473 llvm::json::Object plugin_stats;
476 llvm::json::Array namespace_stats;
480 llvm::json::Object plugin_json;
481 plugin_json.try_emplace(
"name",
plugin.name);
482 plugin_json.try_emplace(
"enabled",
plugin.enabled);
483 namespace_stats.emplace_back(std::move(plugin_json));
486 if (!namespace_stats.empty())
487 plugin_stats.try_emplace(plugin_ns.name, std::move(namespace_stats));
501 if (pattern == plugin_ns.
name)
505 std::string qualified_name = (plugin_ns.
name +
"." + plugin_info.
name).str();
506 return pattern == qualified_name;
535 llvm::errs() << llvm::formatv(
"Use `image lookup -va {0:x}` to find out "
536 "which callback was not removed\n",
537 instance.create_callback);
539 assert(
m_instances.empty() &&
"forgot to unregister plugin?");
542 template <
typename...
Args>
544 typename Instance::CallbackType callback,
548 assert(!name.empty());
550 std::lock_guard<std::mutex> guard(
m_mutex);
551 m_instances.emplace_back(name, description, callback,
552 std::forward<Args>(args)...);
560 std::lock_guard<std::mutex> guard(
m_mutex);
563 for (; pos != end; ++pos) {
564 if (pos->create_callback == callback) {
574 return instance->description;
580 return instance->name;
586 return instance->create_callback;
591 llvm::SmallVector<Instance> snapshot =
GetSnapshot();
592 llvm::SmallVector<typename Instance::CallbackType> result;
593 result.reserve(snapshot.size());
594 for (
const auto &instance : snapshot)
595 result.push_back(instance.create_callback);
601 if (instance.debugger_init_callback)
602 instance.debugger_init_callback(debugger);
610 llvm::SmallVector<Instance>
GetSnapshot(
bool enabled_only =
true)
const {
611 std::lock_guard<std::mutex> guard(
m_mutex);
613 llvm::SmallVector<Instance> enabled_instances;
616 if (!enabled_only || instance.enabled)
617 enabled_instances.push_back(instance);
619 return enabled_instances;
626 [&](
const Instance &instance) {
return count++ == idx; });
630 bool enabled_only =
true) {
634 auto predicate = [&](
const Instance &instance) {
635 return instance.name == name;
643 std::optional<Instance>
646 if (predicate(instance))
652 std::optional<Instance>
654 std::lock_guard<std::mutex> guard(
m_mutex);
656 if (predicate(instance))
667 std::lock_guard<std::mutex> guard(
m_mutex);
670 llvm::SmallVector<RegisteredPluginInfo> plugin_infos;
674 plugin_infos.push_back(
675 {instance.name, instance.description, instance.enabled});
681 std::lock_guard<std::mutex> guard(
m_mutex);
682 auto it = llvm::find_if(
m_instances, [&](
const Instance &instance) {
683 return instance.name == name;
689 it->enabled = enable;
709 llvm::StringRef description,
722#pragma mark Architecture
733 llvm::StringRef description,
741 instances.UnregisterPlugin(create_callback);
744std::unique_ptr<Architecture>
747 if (
auto plugin_up = instances.create_callback(arch))
753#pragma mark Disassembler
764 llvm::StringRef description,
775llvm::SmallVector<DisassemblerCreateInstance>
782 llvm::StringRef name) {
786#pragma mark DynamicLoader
797 llvm::StringRef name, llvm::StringRef description,
801 name, description, create_callback, debugger_init_callback);
809llvm::SmallVector<DynamicLoaderCreateInstance>
816 llvm::StringRef name) {
820#pragma mark JITLoader
831 llvm::StringRef name, llvm::StringRef description,
835 name, description, create_callback, debugger_init_callback);
842llvm::SmallVector<JITLoaderCreateInstance>
847#pragma mark EmulateInstruction
859 llvm::StringRef name, llvm::StringRef description,
870llvm::SmallVector<EmulateInstructionCreateInstance>
877 llvm::StringRef name) {
881#pragma mark OperatingSystem
892 llvm::StringRef name, llvm::StringRef description,
896 name, description, create_callback, debugger_init_callback);
904llvm::SmallVector<OperatingSystemCreateInstance>
911 llvm::StringRef name) {
926 llvm::StringRef name, llvm::StringRef description,
930 name, description, create_callback, debugger_init_callback);
937llvm::SmallVector<LanguageCreateInstance>
942#pragma mark LanguageRuntime
969 llvm::StringRef name, llvm::StringRef description,
974 name, description, create_callback,
nullptr, command_callback,
975 precondition_callback);
983llvm::SmallVector<LanguageRuntimeCallbacks>
986 llvm::SmallVector<LanguageRuntimeCallbacks> result;
987 result.reserve(instances.size());
988 for (
auto &instance : instances)
989 result.push_back({instance.create_callback, instance.command_callback,
990 instance.precondition_callback});
994#pragma mark SystemRuntime
1005 llvm::StringRef name, llvm::StringRef description,
1016llvm::SmallVector<SystemRuntimeCreateInstance>
1021#pragma mark ObjectFile
1056 llvm::StringRef name, llvm::StringRef description,
1063 name, description, create_callback, create_memory_callback,
1064 get_module_specifications, save_core, debugger_init_callback);
1073 llvm::SmallVector<ObjectFileCallbacks> result;
1074 result.reserve(instances.size());
1075 for (
auto &instance : instances)
1076 result.push_back({instance.create_callback, instance.create_memory_callback,
1077 instance.get_module_specifications, instance.save_core});
1083 llvm::StringRef name) {
1085 return instance->create_memory_callback;
1107 llvm::Expected<bool> ret =
1116 const auto &plugin_name = options.
GetPluginName().value_or(
"");
1118 for (
auto &instance : instances) {
1119 if (plugin_name.empty() || instance.name == plugin_name) {
1122 if (instance.save_core &&
1134 if (!plugin_name.empty())
1136 "The \"{}\" plugin is not able to save a core for this process.",
1140 "no ObjectFile plugins were able to save a core for this process");
1144 llvm::SmallVector<llvm::StringRef> plugin_names;
1146 for (
auto &instance : instances) {
1147 if (instance.save_core)
1148 plugin_names.emplace_back(instance.name);
1150 return plugin_names;
1153#pragma mark ObjectContainer
1178 llvm::StringRef name, llvm::StringRef description,
1183 name, description, create_callback, create_memory_callback,
1184 get_module_specifications);
1192llvm::SmallVector<ObjectContainerCallbacks>
1195 llvm::SmallVector<ObjectContainerCallbacks> result;
1196 result.reserve(instances.size());
1197 for (
auto &instance : instances)
1198 result.push_back({instance.create_callback, instance.create_memory_callback,
1199 instance.get_module_specifications});
1203#pragma mark Platform
1210 return g_platform_instances;
1214 llvm::StringRef name, llvm::StringRef description,
1218 name, description, create_callback, debugger_init_callback);
1239llvm::SmallVector<PlatformCreateInstance>
1247 if (instance.name.starts_with(name))
1263 llvm::StringRef name, llvm::StringRef description,
1267 name, description, create_callback, debugger_init_callback);
1288llvm::SmallVector<ProcessCreateInstance>
1296 if (instance.name.starts_with(name))
1301#pragma mark ProtocolServer
1312 llvm::StringRef name, llvm::StringRef description,
1333#pragma mark RegisterTypeBuilder
1343typedef PluginInstances<RegisterTypeBuilderInstance>
1352 llvm::StringRef name, llvm::StringRef description,
1369 return instance->create_callback(target);
1372#pragma mark ScriptInterpreter
1396 llvm::StringRef name, llvm::StringRef description,
1401 name, description, create_callback, script_language, get_path_callback);
1409llvm::SmallVector<ScriptInterpreterCreateInstance>
1419 for (
const auto &instance : instances) {
1421 none_instance = instance.create_callback;
1423 if (script_lang == instance.language)
1424 return instance.create_callback(debugger);
1428 assert(none_instance !=
nullptr);
1429 return none_instance(debugger);
1435 for (
const auto &instance : instances) {
1436 if (instance.language == script_lang && instance.get_path_callback)
1437 return instance.get_path_callback();
1442#pragma mark SyntheticFrameProvider
1464 llvm::StringRef name, llvm::StringRef description,
1467 if (create_native_callback)
1469 name, description, create_native_callback);
1470 else if (create_scripted_callback)
1472 name, description, create_scripted_callback);
1488 llvm::StringRef name) {
1492llvm::SmallVector<ScriptedFrameProviderCreateInstance>
1497#pragma mark StructuredDataPlugin
1522 llvm::StringRef name, llvm::StringRef description,
1527 name, description, create_callback, debugger_init_callback,
1536llvm::SmallVector<StructuredDataPluginCallbacks>
1539 llvm::SmallVector<StructuredDataPluginCallbacks> result;
1540 result.reserve(instances.size());
1541 for (
auto &instance : instances)
1542 result.push_back({instance.create_callback, instance.filter_callback});
1546#pragma mark SymbolFile
1557 llvm::StringRef name, llvm::StringRef description,
1561 name, description, create_callback, debugger_init_callback);
1568llvm::SmallVector<SymbolFileCreateInstance>
1573#pragma mark SymbolVendor
1584 llvm::StringRef description,
1595llvm::SmallVector<SymbolVendorCreateInstance>
1600#pragma mark SymbolLocator
1632 llvm::StringRef name, llvm::StringRef description,
1640 name, description, create_callback, locate_executable_object_file,
1641 locate_executable_symbol_file, download_object_symbol_file,
1642 find_symbol_file_in_bundle, debugger_init_callback);
1650llvm::SmallVector<SymbolLocatorCreateInstance>
1659 for (
auto &instance : instances) {
1660 if (instance.locate_executable_object_file) {
1662 std::optional<ModuleSpec> result;
1665 result = instance.locate_executable_object_file(module_spec);
1667 map.
add(instance.name, time.
get().count());
1679 for (
auto &instance : instances) {
1680 if (instance.locate_executable_symbol_file) {
1682 std::optional<FileSpec> result;
1685 result = instance.locate_executable_symbol_file(module_spec,
1686 default_search_paths);
1688 map.
add(instance.name, time.
get().count());
1699 bool copy_executable) {
1701 for (
auto &instance : instances) {
1702 if (instance.download_object_symbol_file) {
1703 if (instance.download_object_symbol_file(module_spec,
error, force_lookup,
1715 for (
auto &instance : instances) {
1716 if (instance.find_symbol_file_in_bundle) {
1717 std::optional<FileSpec> result =
1718 instance.find_symbol_file_in_bundle(symfile_bundle, uuid, arch);
1752 llvm::StringRef name, llvm::StringRef description,
1757 name, description, create_callback_from_bundle,
1758 create_callback_for_live_process, schema, debugger_init_callback);
1764 create_callback_from_bundle);
1774 llvm::StringRef plugin_name) {
1776 return instance->create_callback_for_live_process;
1783 return instance->schema;
1784 return llvm::StringRef();
1789 return instance->schema;
1790 return llvm::StringRef();
1793#pragma mark TraceExporter
1817 llvm::StringRef name, llvm::StringRef description,
1821 name, description, create_callback, create_thread_trace_export_command);
1834llvm::SmallVector<TraceExporterCallbacks>
1837 llvm::SmallVector<TraceExporterCallbacks> result;
1838 result.reserve(instances.size());
1839 for (
auto &instance : instances)
1840 result.push_back({instance.name, instance.create_callback,
1841 instance.create_thread_trace_export_command});
1845#pragma mark UnwindAssembly
1856 llvm::StringRef name, llvm::StringRef description,
1867llvm::SmallVector<UnwindAssemblyCreateInstance>
1872#pragma mark MemoryHistory
1883 llvm::StringRef name, llvm::StringRef description,
1894llvm::SmallVector<MemoryHistoryCreateInstance>
1899#pragma mark InstrumentationRuntime
1918 bool enabled_only) {
1920 return instance->get_type_callback;
1931 llvm::StringRef name, llvm::StringRef description,
1935 name, description, create_callback, get_type_callback);
1943llvm::SmallVector<InstrumentationRuntimeCallbacks>
1947 llvm::SmallVector<InstrumentationRuntimeCallbacks> result;
1948 result.reserve(instances.size());
1949 for (
auto &instance : instances)
1950 result.push_back({instance.create_callback, instance.get_type_callback});
1954#pragma mark TypeSystem
1979 llvm::StringRef name, llvm::StringRef description,
1982 LanguageSet supported_languages_for_expressions) {
1984 name, description, create_callback, supported_languages_for_types,
1985 supported_languages_for_expressions);
1992llvm::SmallVector<TypeSystemCreateInstance>
2000 for (
unsigned i = 0; i < instances.size(); ++i)
2001 all.
bitvector |= instances[i].supported_languages_for_types.bitvector;
2008 for (
unsigned i = 0; i < instances.size(); ++i)
2009 all.
bitvector |= instances[i].supported_languages_for_expressions.bitvector;
2013#pragma mark ScriptedInterfaces
2037 llvm::StringRef name, llvm::StringRef description,
2041 name, description, create_callback, language, usages);
2065 return instance->language;
2072 return instance->usages;
2095 llvm::StringRef description,
2099 supported_languages);
2108 llvm::SmallVector<REPLCallbacks> result;
2109 result.reserve(instances.size());
2110 for (
auto &instance : instances)
2111 result.push_back({instance.create_callback, instance.supported_languages});
2118 for (
unsigned i = 0; i < instances.size(); ++i)
2119 all.
bitvector |= instances[i].supported_languages.bitvector;
2123#pragma mark Highlighter
2140 llvm::StringRef description,
2151llvm::SmallVector<HighlighterCreateInstance>
2156#pragma mark PluginManager
2177 Debugger &debugger, llvm::StringRef plugin_type_name,
2178 llvm::StringRef plugin_type_desc,
bool can_create) {
2181 if (parent_properties_sp) {
2182 static constexpr llvm::StringLiteral g_property_name(
"plugin");
2185 parent_properties_sp->GetSubProperty(
nullptr, g_property_name);
2186 if (!plugin_properties_sp && can_create) {
2187 plugin_properties_sp =
2188 std::make_shared<OptionValueProperties>(g_property_name);
2189 plugin_properties_sp->SetExpectedPath(
"plugin");
2190 parent_properties_sp->AppendProperty(g_property_name,
2191 "Settings specify to plugins.",
true,
2192 plugin_properties_sp);
2195 if (plugin_properties_sp) {
2197 plugin_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
2198 if (!plugin_type_properties_sp && can_create) {
2199 plugin_type_properties_sp =
2200 std::make_shared<OptionValueProperties>(plugin_type_name);
2201 plugin_type_properties_sp->SetExpectedPath(
2202 (
"plugin." + plugin_type_name).str());
2203 plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
2204 true, plugin_type_properties_sp);
2206 return plugin_type_properties_sp;
2216 Debugger &debugger, llvm::StringRef plugin_type_name,
2217 llvm::StringRef plugin_type_desc,
bool can_create) {
2218 static constexpr llvm::StringLiteral g_property_name(
"plugin");
2221 if (parent_properties_sp) {
2223 parent_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
2224 if (!plugin_properties_sp && can_create) {
2225 plugin_properties_sp =
2226 std::make_shared<OptionValueProperties>(plugin_type_name);
2227 plugin_properties_sp->SetExpectedPath(plugin_type_name.str());
2228 parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
2229 true, plugin_properties_sp);
2232 if (plugin_properties_sp) {
2234 plugin_properties_sp->GetSubProperty(
nullptr, g_property_name);
2235 if (!plugin_type_properties_sp && can_create) {
2236 plugin_type_properties_sp =
2237 std::make_shared<OptionValueProperties>(g_property_name);
2238 plugin_type_properties_sp->SetExpectedPath(
2239 (plugin_type_name +
".plugin").str());
2240 plugin_properties_sp->AppendProperty(g_property_name,
2241 "Settings specific to plugins",
2242 true, plugin_type_properties_sp);
2244 return plugin_type_properties_sp;
2253GetDebuggerPropertyForPluginsPtr(
Debugger &, llvm::StringRef, llvm::StringRef,
2259 llvm::StringRef plugin_type_name,
2260 GetDebuggerPropertyForPluginsPtr get_debugger_property =
2264 debugger, plugin_type_name,
2267 if (plugin_type_properties_sp)
2269 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
2270 return properties_sp;
2275 llvm::StringRef plugin_type_desc,
2277 llvm::StringRef description,
bool is_global_property,
2278 GetDebuggerPropertyForPluginsPtr get_debugger_property =
2280 if (properties_sp) {
2282 get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
2284 if (plugin_type_properties_sp) {
2285 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
2286 description, is_global_property,
2302static constexpr llvm::StringLiteral
2308 llvm::StringRef setting_name) {
2314 llvm::StringRef description,
bool is_global_property) {
2316 "Settings for dynamic loader plug-ins",
2317 properties_sp, description, is_global_property);
2322 llvm::StringRef setting_name) {
2329 llvm::StringRef description,
bool is_global_property) {
2331 "Settings for platform plug-ins", properties_sp,
2332 description, is_global_property,
2338 llvm::StringRef setting_name) {
2344 llvm::StringRef description,
bool is_global_property) {
2346 "Settings for process plug-ins", properties_sp,
2347 description, is_global_property);
2352 llvm::StringRef setting_name) {
2358 llvm::StringRef description,
bool is_global_property) {
2360 "Settings for symbol locator plug-ins",
2361 properties_sp, description, is_global_property);
2366 llvm::StringRef description,
bool is_global_property) {
2368 "Settings for trace plug-ins", properties_sp,
2369 description, is_global_property);
2374 llvm::StringRef setting_name) {
2380 llvm::StringRef description,
bool is_global_property) {
2382 "Settings for object file plug-ins",
2383 properties_sp, description, is_global_property);
2388 llvm::StringRef setting_name) {
2394 llvm::StringRef description,
bool is_global_property) {
2396 "Settings for symbol file plug-ins",
2397 properties_sp, description, is_global_property);
2402 llvm::StringRef setting_name) {
2408 llvm::StringRef description,
bool is_global_property) {
2410 "Settings for JIT loader plug-ins",
2411 properties_sp, description, is_global_property);
2417 Debugger &debugger, llvm::StringRef setting_name) {
2424 if (plugin_type_properties_sp)
2426 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
2427 return properties_sp;
2432 llvm::StringRef description,
bool is_global_property) {
2433 if (properties_sp) {
2436 "Settings for operating system plug-ins",
2438 if (plugin_type_properties_sp) {
2439 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
2440 description, is_global_property,
2450 llvm::StringRef setting_name) {
2456 llvm::StringRef description,
bool is_global_property) {
2458 "Settings for structured data plug-ins",
2459 properties_sp, description, is_global_property);
2464 Debugger &debugger, llvm::StringRef setting_name) {
2470 llvm::StringRef description,
bool is_global_property) {
2472 "Settings for CPlusPlus language plug-ins",
2473 properties_sp, description, is_global_property);
2486llvm::SmallVector<RegisteredPluginInfo>
2495llvm::SmallVector<RegisteredPluginInfo>
2504llvm::SmallVector<RegisteredPluginInfo>
2513llvm::SmallVector<RegisteredPluginInfo>
2522llvm::SmallVector<RegisteredPluginInfo>
2536 llvm_unreachable(
"unhandled PluginDomainKind");
2540 llvm::StringRef name,
bool enable,
Debugger &requesting_debugger,
2543 return llvm::createStringErrorV(
"{} domain is not supported",
2546 return llvm::createStringError(
"plugin could not be found");
2548 return llvm::Error::success();
2551llvm::SmallVector<RegisteredPluginInfo>
2568llvm::SmallVector<RegisteredPluginInfo>
2577llvm::SmallVector<RegisteredPluginInfo>
2586llvm::SmallVector<RegisteredPluginInfo>
2595llvm::SmallVector<RegisteredPluginInfo>
2604llvm::SmallVector<RegisteredPluginInfo>
2635llvm::SmallVector<RegisteredPluginInfo>
2644llvm::SmallVector<RegisteredPluginInfo>
2653llvm::SmallVector<RegisteredPluginInfo>
2662llvm::SmallVector<RegisteredPluginInfo>
2671llvm::SmallVector<RegisteredPluginInfo>
2680llvm::SmallVector<RegisteredPluginInfo>
2689llvm::SmallVector<RegisteredPluginInfo>
2698llvm::SmallVector<RegisteredPluginInfo>
2714llvm::SmallVector<RegisteredPluginInfo>
2723llvm::SmallVector<RegisteredPluginInfo>
2732llvm::SmallVector<RegisteredPluginInfo>
2746 llvm::StringRef ns_name, plugin_prefix;
2747 std::tie(ns_name, plugin_prefix) = name.split(
'.');
2755 if (plugin_ns.name == ns_name) {
2757 llvm::SmallString<128> buf;
2758 if (
plugin.name.starts_with(plugin_prefix))
2760 (plugin_ns.name +
"." +
plugin.name).toStringRef(buf));
2762 }
else if (plugin_ns.name.starts_with(name) &&
2763 !plugin_ns.get_info().empty()) {
static llvm::raw_ostream & error(Stream &strm)
static FileSystem::EnumerateDirectoryResult LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft, llvm::StringRef path)
#define LLDB_LOG_ERROR(log, error,...)
static DisassemblerInstances & GetDisassemblerInstances()
PluginInstances< ProtocolServerInstance > ProtocolServerInstances
static TraceInstances & GetTracePluginInstances()
static ObjectContainerInstances & GetObjectContainerInstances()
PluginInstances< JITLoaderInstance > JITLoaderInstances
static MemoryHistoryInstances & GetMemoryHistoryInstances()
PluginInstance< PlatformCreateInstance > PlatformInstance
PluginInstances< HighlighterInstance > HighlighterInstances
static DynamicLoaderInstances & GetDynamicLoaderInstances()
PluginInstances< SymbolFileInstance > SymbolFileInstances
PluginInstances< TypeSystemInstance > TypeSystemInstances
PluginInstance< ABICreateInstance > ABIInstance
static SystemRuntimeInstances & GetSystemRuntimeInstances()
PluginInstances< TraceExporterInstance > TraceExporterInstances
static constexpr llvm::StringLiteral kPlatformPluginName("platform")
static constexpr llvm::StringLiteral g_plugin_prefix
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
static constexpr llvm::StringLiteral kCPlusPlusLanguagePlugin("cplusplus")
PluginInstances< SystemRuntimeInstance > SystemRuntimeInstances
static TraceExporterInstances & GetTraceExporterInstances()
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< ArchitectureInstance > ArchitectureInstances
PluginInstances< StructuredDataPluginInstance > StructuredDataPluginInstances
static constexpr llvm::StringLiteral kStructuredDataPluginName("structured-data")
PluginInstance< MemoryHistoryCreateInstance > MemoryHistoryInstance
static const char * kOperatingSystemPluginName("os")
static SymbolLocatorInstances & GetSymbolLocatorInstances()
PluginInstance< ProtocolServerCreateInstance > ProtocolServerInstance
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")
static ScriptedFrameProviderInstances & GetScriptedFrameProviderInstances()
PluginInstances< OperatingSystemInstance > OperatingSystemInstances
static LanguageRuntimeInstances & GetLanguageRuntimeInstances()
PluginInstances< LanguageRuntimeInstance > LanguageRuntimeInstances
static InstrumentationRuntimeInstances & GetInstrumentationRuntimeInstances()
PluginInstances< ProcessInstance > ProcessInstances
PluginInstances< SyntheticFrameProviderInstance > SyntheticFrameProviderInstances
PluginInstances< REPLInstance > REPLInstances
static ArchitectureInstances & GetArchitectureInstances()
static DynamicPluginMap & GetPluginMap()
PluginInstances< ScriptedFrameProviderInstance > ScriptedFrameProviderInstances
static PluginRegistry & GetPluginRegistry()
static RegisterTypeBuilderInstances & GetRegisterTypeBuilderInstances()
static std::recursive_mutex & GetPluginMapMutex()
llvm::SmallDenseMap< FileSpec, PluginInfo > DynamicPluginMap
static HighlighterInstances & GetHighlighterInstances()
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
PluginInstance< SyntheticFrameProviderCreateInstance > SyntheticFrameProviderInstance
static JITLoaderInstances & GetJITLoaderInstances()
PluginInstances< DisassemblerInstance > DisassemblerInstances
PluginInstance< ProcessCreateInstance > ProcessInstance
static UnwindAssemblyInstances & GetUnwindAssemblyInstances()
static void SetPluginInfo(const FileSpec &plugin_file_spec, PluginInfo plugin_info)
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")
PluginInstance< ScriptedFrameProviderCreateInstance > ScriptedFrameProviderInstance
PluginInstances< ScriptInterpreterInstance > ScriptInterpreterInstances
static SyntheticFrameProviderInstances & GetSyntheticFrameProviderInstances()
bool(* PluginInitCallback)()
PluginInstance< DisassemblerCreateInstance > DisassemblerInstance
static SymbolVendorInstances & GetSymbolVendorInstances()
PluginInstances< ObjectContainerInstance > ObjectContainerInstances
static ProtocolServerInstances & GetProtocolServerInstances()
PluginInstances< RegisterTypeBuilderInstance > RegisterTypeBuilderInstances
static REPLInstances & GetREPLInstances()
static double elapsed(const StatsTimepoint &start, const StatsTimepoint &end)
bool UnregisterPlugin(typename Instance::CallbackType callback)
std::optional< ABIInstance > FindInstance(std::function< bool(const ABIInstance &)> predicate) const
llvm::StringRef GetNameAtIndex(uint32_t idx)
llvm::SmallVector< ABIInstance > m_instances
llvm::StringRef GetDescriptionAtIndex(uint32_t idx)
llvm::SmallVector< typename Instance::CallbackType > GetCreateCallbacks()
std::optional< ABIInstance > GetInstanceAtIndex(uint32_t idx)
llvm::SmallVector< RegisteredPluginInfo > GetPluginInfoForAllInstances()
Instance::CallbackType GetCallbackForName(llvm::StringRef name)
llvm::SmallVector< ABIInstance > GetSnapshot(bool enabled_only=true) const
bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, typename Instance::CallbackType callback, Args &&...args)
void PerformDebuggerCallback(Debugger &debugger)
std::optional< ABIInstance > FindEnabledInstance(std::function< bool(const ABIInstance &)> predicate) const
std::optional< ABIInstance > GetInstanceForName(llvm::StringRef name, bool enabled_only=true)
bool SetInstanceEnabled(llvm::StringRef name, bool enable)
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.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
A class to manage flag bits.
A class that measures elapsed time in an exception safe way.
const ConstString & GetFilename() const
Filename string const get accessor.
llvm::StringRef GetFileNameStrippingExtension() const
Return the filename without the extension part.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
llvm::StringRef GetFileNameExtension() const
Extract the extension of the file.
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.
bool Exists(const FileSpec &file_spec) const
Returns whether the given file exists.
static FileSystem & Instance()
void Resolve(llvm::SmallVectorImpl< char > &path, bool force_make_absolute=false)
Resolve path to make it canonical.
static bool SetArchitecturePluginEnabled(llvm::StringRef name, bool enable)
static llvm::StringRef GetPlatformPluginDescriptionAtIndex(uint32_t idx)
static bool SetPlatformPluginEnabled(llvm::StringRef name, bool enable)
static bool SetScriptInterpreterPluginEnabled(llvm::StringRef name, bool enable)
static bool MatchPluginName(llvm::StringRef pattern, const PluginNamespace &plugin_ns, const RegisteredPluginInfo &plugin)
static lldb::OptionValuePropertiesSP GetSettingForStructuredDataPlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool SetMemoryHistoryPluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< RegisteredPluginInfo > GetSystemRuntimePluginInfo()
static llvm::SmallVector< RegisteredPluginInfo > GetTypeSystemPluginInfo()
static bool CreateSettingForJITLoaderPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static bool SetRegisterTypeBuilderPluginEnabled(llvm::StringRef name, bool enable)
static llvm::StringRef PluginDomainKindToStr(lldb::PluginDomainKind kind)
static bool SetTraceExporterPluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< RegisteredPluginInfo > GetArchitecturePluginInfo()
static LanguageSet GetAllTypeSystemSupportedLanguagesForExpressions()
static bool CreateSettingForOperatingSystemPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static llvm::SmallVector< UnwindAssemblyCreateInstance > GetUnwindAssemblyCreateCallbacks()
static lldb::OptionValuePropertiesSP GetSettingForObjectFilePlugin(Debugger &debugger, llvm::StringRef setting_name)
static llvm::SmallVector< RegisteredPluginInfo > GetEmulateInstructionPluginInfo()
static void AutoCompletePlatformName(llvm::StringRef partial_name, CompletionRequest &request)
static TraceExporterCreateInstance GetTraceExporterCreateCallback(llvm::StringRef plugin_name)
static bool SetDynamicLoaderPluginEnabled(llvm::StringRef name, bool enable)
static llvm::json::Object GetJSON(llvm::StringRef pattern="")
static bool CreateSettingForObjectFilePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static bool SetScriptedInterfacePluginEnabled(llvm::StringRef name, bool enable)
static bool SetOperatingSystemPluginEnabled(llvm::StringRef name, bool enable)
static lldb::ScriptInterpreterSP GetScriptInterpreterForLanguage(lldb::ScriptLanguage script_lang, Debugger &debugger)
static llvm::SmallVector< ABICreateInstance > GetABICreateCallbacks()
static llvm::SmallVector< InstrumentationRuntimeCallbacks > GetInstrumentationRuntimeCallbacks(bool enabled_only=true)
static void AutoCompleteProcessName(llvm::StringRef partial_name, CompletionRequest &request)
static llvm::SmallVector< RegisteredPluginInfo > GetScriptInterpreterPluginInfo()
static llvm::SmallVector< RegisteredPluginInfo > GetABIPluginInfo()
static llvm::SmallVector< RegisteredPluginInfo > GetLanguagePluginInfo()
static LanguageSet GetREPLAllTypeSystemSupportedLanguages()
static llvm::SmallVector< OperatingSystemCreateInstance > GetOperatingSystemCreateCallbacks()
static bool CreateSettingForTracePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static llvm::SmallVector< RegisteredPluginInfo > GetDynamicLoaderPluginInfo()
static lldb::OptionValuePropertiesSP GetSettingForOperatingSystemPlugin(Debugger &debugger, llvm::StringRef setting_name)
static llvm::Error SetInstrumentationRuntimePluginEnabled(llvm::StringRef name, bool enable, Debugger &requesting_debugger, lldb::PluginDomainKind domain)
static llvm::SmallVector< ProcessCreateInstance > GetProcessCreateCallbacks()
static llvm::SmallVector< RegisteredPluginInfo > GetObjectContainerPluginInfo()
static bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec, Status &error, bool force_lookup=true, bool copy_executable=true)
static llvm::SmallVector< RegisteredPluginInfo > GetDisassemblerPluginInfo()
static llvm::SmallVector< LanguageRuntimeCallbacks > GetLanguageRuntimeCallbacks()
static llvm::SmallVector< SymbolFileCreateInstance > GetSymbolFileCreateCallbacks()
static bool SetLanguageRuntimePluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< RegisteredPluginInfo > GetObjectFilePluginInfo()
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static lldb::ScriptLanguage GetScriptedInterfaceLanguageAtIndex(uint32_t idx)
static llvm::SmallVector< RegisteredPluginInfo > GetSymbolLocatorPluginInfo()
static llvm::StringRef GetTraceSchema(llvm::StringRef plugin_name)
Get the JSON schema for a trace bundle description file corresponding to the given plugin.
static llvm::SmallVector< SymbolVendorCreateInstance > GetSymbolVendorCreateCallbacks()
static bool SetUnwindAssemblyPluginEnabled(llvm::StringRef name, bool enable)
static lldb::OptionValuePropertiesSP GetSettingForCPlusPlusLanguagePlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool SetDisassemblerPluginEnabled(llvm::StringRef name, bool enable)
static bool SetSystemRuntimePluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< RegisteredPluginInfo > GetTracePluginInfo()
static llvm::SmallVector< JITLoaderCreateInstance > GetJITLoaderCreateCallbacks()
static llvm::SmallVector< RegisteredPluginInfo > GetProcessPluginInfo()
static TraceCreateInstanceForLiveProcess GetTraceCreateCallbackForLiveProcess(llvm::StringRef plugin_name)
static std::unique_ptr< Architecture > CreateArchitectureInstance(const ArchSpec &arch)
static llvm::SmallVector< DisassemblerCreateInstance > GetDisassemblerCreateCallbacks()
static lldb::OptionValuePropertiesSP GetSettingForSymbolLocatorPlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool SetStructuredDataPluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< ObjectFileCallbacks > GetObjectFileCallbacks()
static uint32_t GetNumScriptedInterfaces()
static llvm::SmallVector< RegisteredPluginInfo > GetLanguageRuntimePluginInfo()
static bool SetObjectContainerPluginEnabled(llvm::StringRef name, bool enable)
static bool CreateSettingForProcessPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static llvm::SmallVector< RegisteredPluginInfo > GetPlatformPluginInfo()
static llvm::SmallVector< RegisteredPluginInfo > GetMemoryHistoryPluginInfo()
static llvm::SmallVector< TypeSystemCreateInstance > GetTypeSystemCreateCallbacks()
static lldb::OptionValuePropertiesSP GetSettingForPlatformPlugin(Debugger &debugger, llvm::StringRef setting_name)
static llvm::SmallVector< RegisteredPluginInfo > GetSymbolFilePluginInfo()
static SyntheticFrameProviderCreateInstance GetSyntheticFrameProviderCreateCallbackForPluginName(llvm::StringRef name)
static llvm::SmallVector< SymbolLocatorCreateInstance > GetSymbolLocatorCreateCallbacks()
static llvm::ArrayRef< PluginNamespace > GetPluginNamespaces()
static bool SetTypeSystemPluginEnabled(llvm::StringRef name, bool enable)
static bool SetTracePluginEnabled(llvm::StringRef name, bool enable)
static Status SaveCore(lldb_private::SaveCoreOptions &core_options)
static llvm::SmallVector< RegisteredPluginInfo > GetTraceExporterPluginInfo()
static FileSpec LocateExecutableSymbolFile(const ModuleSpec &module_spec, const FileSpecList &default_search_paths, StatisticsMap &map)
static bool SetEmulateInstructionPluginEnabled(llvm::StringRef name, bool enable)
static lldb::OptionValuePropertiesSP GetSettingForJITLoaderPlugin(Debugger &debugger, llvm::StringRef setting_name)
static DisassemblerCreateInstance GetDisassemblerCreateCallbackForPluginName(llvm::StringRef name)
static bool SetJITLoaderPluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< RegisteredPluginInfo > GetInstrumentationRuntimePluginInfo()
static llvm::SmallVector< REPLCallbacks > GetREPLCallbacks()
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 bool SetSymbolFilePluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< ScriptInterpreterCreateInstance > GetScriptInterpreterCreateCallbacks()
static llvm::SmallVector< RegisteredPluginInfo > GetRegisterTypeBuilderPluginInfo()
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 bool CreateSettingForCPlusPlusLanguagePlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static llvm::SmallVector< TraceExporterCallbacks > GetTraceExporterCallbacks()
static llvm::SmallVector< RegisteredPluginInfo > GetSymbolVendorPluginInfo()
static DynamicLoaderCreateInstance GetDynamicLoaderCreateCallbackForPluginName(llvm::StringRef name)
static llvm::SmallVector< EmulateInstructionCreateInstance > GetEmulateInstructionCreateCallbacks()
static PlatformCreateInstance GetPlatformCreateCallbackForPluginName(llvm::StringRef name)
static bool SetProcessPluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< llvm::StringRef > GetSaveCorePluginNames()
static llvm::SmallVector< RegisteredPluginInfo > GetOperatingSystemPluginInfo()
static llvm::SmallVector< ScriptedFrameProviderCreateInstance > GetScriptedFrameProviderCreateCallbacks()
static bool SetABIPluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< RegisteredPluginInfo > GetScriptedInterfacePluginInfo()
static lldb::OptionValuePropertiesSP GetSettingForProcessPlugin(Debugger &debugger, llvm::StringRef setting_name)
static ProcessCreateInstance GetProcessCreateCallbackForPluginName(llvm::StringRef name)
static void AutoCompletePluginName(llvm::StringRef partial_name, CompletionRequest &request)
static llvm::StringRef GetScriptedInterfaceDescriptionAtIndex(uint32_t idx)
static llvm::StringRef GetProcessPluginDescriptionAtIndex(uint32_t idx)
static llvm::StringRef GetProtocolServerPluginNameAtIndex(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 bool SetLanguagePluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< RegisteredPluginInfo > GetREPLPluginInfo()
static bool SetREPLPluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< HighlighterCreateInstance > GetHighlighterCreateCallbacks()
static llvm::SmallVector< RegisteredPluginInfo > GetUnwindAssemblyPluginInfo()
static llvm::StringRef GetPlatformPluginNameAtIndex(uint32_t idx)
static bool SetSymbolVendorPluginEnabled(llvm::StringRef name, bool enable)
static TraceCreateInstanceFromBundle GetTraceCreateCallback(llvm::StringRef plugin_name)
static void DebuggerInitialize(Debugger &debugger)
static llvm::StringRef GetScriptedInterfaceNameAtIndex(uint32_t idx)
static llvm::SmallVector< ObjectContainerCallbacks > GetObjectContainerCallbacks()
static llvm::StringRef GetProcessPluginNameAtIndex(uint32_t idx)
static ModuleSpec LocateExecutableObjectFile(const ModuleSpec &module_spec, StatisticsMap &map)
static llvm::SmallVector< StructuredDataPluginCallbacks > GetStructuredDataPluginCallbacks()
static LanguageSet GetAllTypeSystemSupportedLanguagesForTypes()
static llvm::SmallVector< SystemRuntimeCreateInstance > GetSystemRuntimeCreateCallbacks()
static FileSpec GetScriptInterpreterLibraryPath(lldb::ScriptLanguage script_lang)
static bool UnregisterPlugin(ABICreateInstance create_callback)
static FileSpec FindSymbolFileInBundle(const FileSpec &dsym_bundle_fspec, const UUID *uuid, const ArchSpec *arch)
static llvm::SmallVector< RegisteredPluginInfo > GetStructuredDataPluginInfo()
static bool SetSymbolLocatorPluginEnabled(llvm::StringRef name, bool enable)
static ProtocolServerCreateInstance GetProtocolCreateCallbackForPluginName(llvm::StringRef name)
static llvm::SmallVector< LanguageCreateInstance > GetLanguageCreateCallbacks()
static llvm::SmallVector< DynamicLoaderCreateInstance > GetDynamicLoaderCreateCallbacks()
static lldb::RegisterTypeBuilderSP GetRegisterTypeBuilder(Target &target)
static llvm::SmallVector< MemoryHistoryCreateInstance > GetMemoryHistoryCreateCallbacks()
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 llvm::SmallVector< RegisteredPluginInfo > GetJITLoaderPluginInfo()
static bool SetObjectFilePluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< PlatformCreateInstance > GetPlatformCreateCallbacks()
lldb::OptionValuePropertiesSP GetValueProperties() const
const std::optional< lldb_private::FileSpec > GetOutputFile() const
Status EnsureValidConfiguration() const
std::optional< std::string > GetPluginName() const
lldb::ProcessSP GetProcess() const
A class to count time for plugins.
void add(llvm::StringRef key, double value)
static Status FromErrorString(const char *str)
static Status static Status FromErrorStringWithFormatv(const char *format, Args &&...args)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
Represents UUID's of various sizes.
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
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)
FileSpec(* ScriptInterpreterGetPath)()
lldb::RegisterTypeBuilderSP(* RegisterTypeBuilderCreateInstance)(Target &target)
lldb::ProtocolServerUP(* ProtocolServerCreateInstance)()
LanguageRuntime *(* LanguageRuntimeCreateInstance)(Process *process, lldb::LanguageType language)
lldb::InstrumentationRuntimeType(* InstrumentationRuntimeGetType)()
llvm::Expected< lldb::TraceSP >(* TraceCreateInstanceFromBundle)(const llvm::json::Value &trace_bundle_description, llvm::StringRef session_file_dir, lldb_private::Debugger &debugger)
Trace.
lldb::DisassemblerSP(* DisassemblerCreateInstance)(const ArchSpec &arch, const char *flavor, const char *cpu, const char *features)
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)
void(* DebuggerInitializeCallback)(Debugger &debugger)
std::unique_ptr< Architecture >(* ArchitectureCreateInstance)(const ArchSpec &arch)
lldb::ScriptInterpreterSP(* ScriptInterpreterCreateInstance)(Debugger &debugger)
lldb::PlatformSP(* PlatformCreateInstance)(bool force, const ArchSpec *arch)
bool(* ScriptedInterfaceCreateInstance)(lldb::ScriptLanguage language, ScriptedInterfaceUsages usages)
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::TypeSystemSP(* TypeSystemCreateInstance)(lldb::LanguageType language, Module *module, Target *target)
lldb::BreakpointPreconditionSP(* LanguageRuntimeGetExceptionPrecondition)(lldb::LanguageType language, bool throw_bp)
ObjectContainer *(* ObjectContainerCreateInstance)(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, const FileSpec *file, lldb::offset_t offset, lldb::offset_t length)
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)
SymbolLocator *(* SymbolLocatorCreateInstance)()
std::optional< ModuleSpec >(* SymbolLocatorLocateExecutableObjectFile)(const ModuleSpec &module_spec)
@ Partial
The current token has been partially completed.
lldb::CommandObjectSP(* LanguageRuntimeGetCommandObject)(CommandInterpreter &interpreter)
DynamicLoader *(* DynamicLoaderCreateInstance)(Process *process, bool force)
lldb::StructuredDataPluginSP(* StructuredDataPluginCreateInstance)(Process &process)
lldb::JITLoaderSP(* JITLoaderCreateInstance)(Process *process, bool force)
llvm::Expected< lldb::SyntheticFrameProviderSP >(* SyntheticFrameProviderCreateInstance)(lldb::StackFrameListSP input_frames, const std::vector< lldb_private::ThreadSpec > &thread_specs)
OperatingSystem *(* OperatingSystemCreateInstance)(Process *process, bool force)
lldb::REPLSP(* REPLCreateInstance)(Status &error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options)
SymbolFile *(* SymbolFileCreateInstance)(lldb::ObjectFileSP objfile_sp)
llvm::Expected< lldb::TraceExporterUP >(* TraceExporterCreateInstance)()
Highlighter *(* HighlighterCreateInstance)(lldb::LanguageType language)
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)
ObjectFile *(* ObjectFileCreateInstance)(const lldb::ModuleSP &module_sp, lldb::DataExtractorSP extractor_sp, lldb::offset_t data_offset, const FileSpec *file, lldb::offset_t file_offset, lldb::offset_t length)
ModuleSpecList(* ObjectFileGetModuleSpecifications)(const FileSpec &file, lldb::DataExtractorSP &extractor_sp, lldb::offset_t file_offset, lldb::offset_t length)
lldb::ABISP(* ABICreateInstance)(lldb::ProcessSP process_sp, const ArchSpec &arch)
llvm::Expected< lldb::SyntheticFrameProviderSP >(* ScriptedFrameProviderCreateInstance)(lldb::StackFrameListSP input_frames, const lldb_private::ScriptedFrameProviderDescriptor &descriptor)
lldb::CommandObjectSP(* ThreadTraceExportCommandCreator)(CommandInterpreter &interpreter)
lldb::InstrumentationRuntimeSP(* InstrumentationRuntimeCreateInstance)(const lldb::ProcessSP &process_sp)
ScriptLanguage
Script interpreter types.
std::shared_ptr< lldb_private::OptionValueProperties > OptionValuePropertiesSP
std::shared_ptr< lldb_private::ScriptInterpreter > ScriptInterpreterSP
@ ePluginDomainKindTarget
@ ePluginDomainKindGlobal
@ ePluginDomainKindDebugger
std::shared_ptr< lldb_private::RegisterTypeBuilder > RegisterTypeBuilderSP
HighlighterInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback)
InstrumentationRuntimeGetType get_type_callback
InstrumentationRuntimeInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, InstrumentationRuntimeGetType get_type_callback)
InstrumentationRuntimeGetType GetTypeCallbackForName(llvm::StringRef name, bool enabled_only)
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
PluginDir(FileSpec path, LoadPolicy policy)
const LoadPolicy policy
Filter when looking for plugins.
const FileSpec path
The path to the plugin directory.
@ LoadOnlyWithLLDBPrefix
Only load shared libraries who's filename start with g_plugin_prefix.
@ LoadAnyDylib
Try to load anything that looks like a shared library.
PluginTermCallback plugin_term_callback
llvm::sys::DynamicLibrary library
PluginInfo & operator=(PluginInfo &&other)
PluginInitCallback plugin_init_callback
PluginInfo(const PluginInfo &)=delete
PluginInfo(PluginInfo &&other)
static llvm::Expected< PluginInfo > Create(const FileSpec &path)
PluginInfo & operator=(const PluginInfo &)=delete
llvm::StringRef description
DebuggerInitializeCallback debugger_init_callback
ABICreateInstance create_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, ScriptInterpreterGetPath get_path_callback)
lldb::ScriptLanguage language
ScriptInterpreterGetPath get_path_callback
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)
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