21#include "llvm/ADT/StringRef.h"
22#include "llvm/ADT/Twine.h"
23#include "llvm/Support/DynamicLibrary.h"
24#include "llvm/Support/ErrorExtras.h"
25#include "llvm/Support/FileSystem.h"
26#include "llvm/Support/raw_ostream.h"
56 library = std::move(other.library);
81enum class PluginLifecycle { Uninitialized, Initialized, Terminated };
83struct PluginRegistry {
84 std::recursive_mutex mutex;
88 std::lock_guard<std::recursive_mutex> guard(mutex);
89 lifecycle = PluginLifecycle::Initialized;
93 std::lock_guard<std::recursive_mutex> guard(mutex);
94 lifecycle = PluginLifecycle::Terminated;
101 bool IsTerminated()
const {
return lifecycle == PluginLifecycle::Terminated; }
104 PluginLifecycle lifecycle = PluginLifecycle::Uninitialized;
115 static PluginRegistry *g_registry =
new PluginRegistry();
134 assert(!plugin_map.contains(plugin_file_spec));
135 plugin_map.try_emplace(plugin_file_spec, std::move(plugin_info));
138template <
typename FPtrTy>
static FPtrTy
CastToFPtr(
void *VPtr) {
139 return reinterpret_cast<FPtrTy
>(VPtr);
167 plugin_info.
library = llvm::sys::DynamicLibrary::getPermanentLibrary(
169 if (!plugin_info.
library.isValid())
170 return llvm::createStringError(
error);
177 llvm::StringRef plugin_name = file_name.substr(
g_plugin_prefix.size());
178 std::string init_symbol =
179 llvm::Twine(
"lldb_initialize_" + plugin_name).str();
182 plugin_info.
library.getAddressOfSymbol(init_symbol.c_str()))) {
184 return llvm::createStringErrorV(
"initializer '{0}' returned false",
186 const std::string term_symbol =
187 llvm::Twine(
"lldb_terminate_" + plugin_name).str();
189 plugin_info.
library.getAddressOfSymbol(term_symbol.c_str()));
196 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginInitialize"))) {
198 return llvm::createStringError(
199 "initializer 'LLDBPluginInitialize' returned false");
203 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginTerminate"));
207 return llvm::createStringError(
"no initialize symbol found");
212 llvm::StringRef path) {
213 namespace fs = llvm::sys::fs;
215 static constexpr std::array<llvm::StringLiteral, 3>
216 g_shared_library_extension = {
".dylib",
".so",
".dll"};
222 if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||
223 ft == fs::file_type::type_unknown) {
228 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,
331 "emulate-instruction",
337 "instrumentation-runtime",
403 "register-type-builder",
409 "script-interpreter",
415 "scripted-interface",
475 return PluginNamespaces;
479 llvm::json::Object plugin_stats;
482 llvm::json::Array namespace_stats;
486 llvm::json::Object plugin_json;
487 plugin_json.try_emplace(
"name",
plugin.name);
488 plugin_json.try_emplace(
"enabled",
plugin.enabled);
489 namespace_stats.emplace_back(std::move(plugin_json));
492 if (!namespace_stats.empty())
493 plugin_stats.try_emplace(plugin_ns.name, std::move(namespace_stats));
507 if (pattern == plugin_ns.
name)
511 std::string qualified_name = (plugin_ns.
name +
"." + plugin_info.
name).str();
512 return pattern == qualified_name;
541 llvm::errs() << llvm::formatv(
"Use `image lookup -va {0:x}` to find out "
542 "which callback was not removed\n",
543 instance.create_callback);
545 assert(
m_instances.empty() &&
"forgot to unregister plugin?");
548 template <
typename...
Args>
550 typename Instance::CallbackType callback,
554 assert(!name.empty());
556 std::lock_guard<std::mutex> guard(
m_mutex);
557 m_instances.emplace_back(name, description, callback,
558 std::forward<Args>(args)...);
566 std::lock_guard<std::mutex> guard(
m_mutex);
569 for (; pos != end; ++pos) {
570 if (pos->create_callback == callback) {
580 return instance->description;
586 return instance->name;
592 return instance->create_callback;
597 llvm::SmallVector<Instance> snapshot =
GetSnapshot();
598 llvm::SmallVector<typename Instance::CallbackType> result;
599 result.reserve(snapshot.size());
600 for (
const auto &instance : snapshot)
601 result.push_back(instance.create_callback);
607 if (instance.debugger_init_callback)
608 instance.debugger_init_callback(debugger);
616 llvm::SmallVector<Instance>
GetSnapshot(
bool enabled_only =
true)
const {
617 std::lock_guard<std::mutex> guard(
m_mutex);
619 llvm::SmallVector<Instance> enabled_instances;
622 if (!enabled_only || instance.enabled)
623 enabled_instances.push_back(instance);
625 return enabled_instances;
632 [&](
const Instance &instance) {
return count++ == idx; });
636 bool enabled_only =
true) {
640 auto predicate = [&](
const Instance &instance) {
641 return instance.name == name;
649 std::optional<Instance>
652 if (predicate(instance))
658 std::optional<Instance>
660 std::lock_guard<std::mutex> guard(
m_mutex);
662 if (predicate(instance))
673 std::lock_guard<std::mutex> guard(
m_mutex);
676 llvm::SmallVector<RegisteredPluginInfo> plugin_infos;
680 plugin_infos.push_back(
681 {instance.name, instance.description, instance.enabled});
687 std::lock_guard<std::mutex> guard(
m_mutex);
688 auto it = llvm::find_if(
m_instances, [&](
const Instance &instance) {
689 return instance.name == name;
695 it->enabled = enable;
715 llvm::StringRef description,
728#pragma mark Architecture
739 llvm::StringRef description,
747 instances.UnregisterPlugin(create_callback);
750std::unique_ptr<Architecture>
753 if (
auto plugin_up = instances.create_callback(arch))
759#pragma mark BugReporter
770 llvm::StringRef description,
780std::unique_ptr<BugReporter>
783 if (
auto create_callback =
785 return create_callback();
789 if (
auto plugin_up = instance.create_callback())
795#pragma mark Disassembler
806 llvm::StringRef description,
817llvm::SmallVector<DisassemblerCreateInstance>
824 llvm::StringRef name) {
828#pragma mark DynamicLoader
839 llvm::StringRef name, llvm::StringRef description,
843 name, description, create_callback, debugger_init_callback);
851llvm::SmallVector<DynamicLoaderCreateInstance>
858 llvm::StringRef name) {
862#pragma mark JITLoader
873 llvm::StringRef name, llvm::StringRef description,
877 name, description, create_callback, debugger_init_callback);
884llvm::SmallVector<JITLoaderCreateInstance>
889#pragma mark EmulateInstruction
901 llvm::StringRef name, llvm::StringRef description,
912llvm::SmallVector<EmulateInstructionCreateInstance>
919 llvm::StringRef name) {
923#pragma mark OperatingSystem
934 llvm::StringRef name, llvm::StringRef description,
938 name, description, create_callback, debugger_init_callback);
946llvm::SmallVector<OperatingSystemCreateInstance>
953 llvm::StringRef name) {
968 llvm::StringRef name, llvm::StringRef description,
972 name, description, create_callback, debugger_init_callback);
979llvm::SmallVector<LanguageCreateInstance>
984#pragma mark LanguageRuntime
1011 llvm::StringRef name, llvm::StringRef description,
1016 name, description, create_callback,
nullptr, command_callback,
1017 precondition_callback);
1025llvm::SmallVector<LanguageRuntimeCallbacks>
1028 llvm::SmallVector<LanguageRuntimeCallbacks> result;
1029 result.reserve(instances.size());
1030 for (
auto &instance : instances)
1031 result.push_back({instance.create_callback, instance.command_callback,
1032 instance.precondition_callback});
1036#pragma mark SystemRuntime
1047 llvm::StringRef name, llvm::StringRef description,
1058llvm::SmallVector<SystemRuntimeCreateInstance>
1063#pragma mark ObjectFile
1098 llvm::StringRef name, llvm::StringRef description,
1105 name, description, create_callback, create_memory_callback,
1106 get_module_specifications, save_core, debugger_init_callback);
1115 llvm::SmallVector<ObjectFileCallbacks> result;
1116 result.reserve(instances.size());
1117 for (
auto &instance : instances)
1118 result.push_back({instance.create_callback, instance.create_memory_callback,
1119 instance.get_module_specifications, instance.save_core});
1125 llvm::StringRef name) {
1127 return instance->create_memory_callback;
1149 llvm::Expected<bool> ret =
1158 const auto &plugin_name = options.
GetPluginName().value_or(
"");
1160 for (
auto &instance : instances) {
1161 if (plugin_name.empty() || instance.name == plugin_name) {
1164 if (instance.save_core &&
1176 if (!plugin_name.empty())
1178 "The \"{}\" plugin is not able to save a core for this process.",
1182 "no ObjectFile plugins were able to save a core for this process");
1186 llvm::SmallVector<llvm::StringRef> plugin_names;
1188 for (
auto &instance : instances) {
1189 if (instance.save_core)
1190 plugin_names.emplace_back(instance.name);
1192 return plugin_names;
1195#pragma mark ObjectContainer
1220 llvm::StringRef name, llvm::StringRef description,
1225 name, description, create_callback, create_memory_callback,
1226 get_module_specifications);
1234llvm::SmallVector<ObjectContainerCallbacks>
1237 llvm::SmallVector<ObjectContainerCallbacks> result;
1238 result.reserve(instances.size());
1239 for (
auto &instance : instances)
1240 result.push_back({instance.create_callback, instance.create_memory_callback,
1241 instance.get_module_specifications});
1245#pragma mark Platform
1252 return g_platform_instances;
1256 llvm::StringRef name, llvm::StringRef description,
1260 name, description, create_callback, debugger_init_callback);
1281llvm::SmallVector<PlatformCreateInstance>
1289 if (instance.name.starts_with(name))
1305 llvm::StringRef name, llvm::StringRef description,
1309 name, description, create_callback, debugger_init_callback);
1330llvm::SmallVector<ProcessCreateInstance>
1338 if (instance.name.starts_with(name))
1343#pragma mark ProtocolServer
1354 llvm::StringRef name, llvm::StringRef description,
1375#pragma mark RegisterTypeBuilder
1385typedef PluginInstances<RegisterTypeBuilderInstance>
1394 llvm::StringRef name, llvm::StringRef description,
1411 return instance->create_callback(target);
1414#pragma mark ScriptInterpreter
1438 llvm::StringRef name, llvm::StringRef description,
1443 name, description, create_callback, script_language, get_path_callback);
1451llvm::SmallVector<ScriptInterpreterCreateInstance>
1461 for (
const auto &instance : instances) {
1463 none_instance = instance.create_callback;
1465 if (script_lang == instance.language)
1466 return instance.create_callback(debugger);
1470 assert(none_instance !=
nullptr);
1471 return none_instance(debugger);
1477 for (
const auto &instance : instances) {
1478 if (instance.language == script_lang && instance.get_path_callback)
1479 return instance.get_path_callback();
1484#pragma mark SyntheticFrameProvider
1506 llvm::StringRef name, llvm::StringRef description,
1509 if (create_native_callback)
1511 name, description, create_native_callback);
1512 else if (create_scripted_callback)
1514 name, description, create_scripted_callback);
1530 llvm::StringRef name) {
1534llvm::SmallVector<ScriptedFrameProviderCreateInstance>
1539#pragma mark StructuredDataPlugin
1564 llvm::StringRef name, llvm::StringRef description,
1569 name, description, create_callback, debugger_init_callback,
1578llvm::SmallVector<StructuredDataPluginCallbacks>
1581 llvm::SmallVector<StructuredDataPluginCallbacks> result;
1582 result.reserve(instances.size());
1583 for (
auto &instance : instances)
1584 result.push_back({instance.create_callback, instance.filter_callback});
1588#pragma mark SymbolFile
1599 llvm::StringRef name, llvm::StringRef description,
1603 name, description, create_callback, debugger_init_callback);
1610llvm::SmallVector<SymbolFileCreateInstance>
1615#pragma mark SymbolVendor
1626 llvm::StringRef description,
1637llvm::SmallVector<SymbolVendorCreateInstance>
1642#pragma mark SymbolLocator
1674 llvm::StringRef name, llvm::StringRef description,
1682 name, description, create_callback, locate_executable_object_file,
1683 locate_executable_symbol_file, download_object_symbol_file,
1684 find_symbol_file_in_bundle, debugger_init_callback);
1692llvm::SmallVector<SymbolLocatorCreateInstance>
1701 for (
auto &instance : instances) {
1702 if (instance.locate_executable_object_file) {
1704 std::optional<ModuleSpec> result;
1707 result = instance.locate_executable_object_file(module_spec);
1709 map.
add(instance.name, time.
get().count());
1721 for (
auto &instance : instances) {
1722 if (instance.locate_executable_symbol_file) {
1724 std::optional<FileSpec> result;
1727 result = instance.locate_executable_symbol_file(module_spec,
1728 default_search_paths);
1730 map.
add(instance.name, time.
get().count());
1741 bool copy_executable) {
1743 for (
auto &instance : instances) {
1744 if (instance.download_object_symbol_file) {
1745 if (instance.download_object_symbol_file(module_spec,
error, force_lookup,
1757 for (
auto &instance : instances) {
1758 if (instance.find_symbol_file_in_bundle) {
1759 std::optional<FileSpec> result =
1760 instance.find_symbol_file_in_bundle(symfile_bundle, uuid, arch);
1794 llvm::StringRef name, llvm::StringRef description,
1799 name, description, create_callback_from_bundle,
1800 create_callback_for_live_process, schema, debugger_init_callback);
1806 create_callback_from_bundle);
1816 llvm::StringRef plugin_name) {
1818 return instance->create_callback_for_live_process;
1825 return instance->schema;
1826 return llvm::StringRef();
1831 return instance->schema;
1832 return llvm::StringRef();
1835#pragma mark TraceExporter
1859 llvm::StringRef name, llvm::StringRef description,
1863 name, description, create_callback, create_thread_trace_export_command);
1876llvm::SmallVector<TraceExporterCallbacks>
1879 llvm::SmallVector<TraceExporterCallbacks> result;
1880 result.reserve(instances.size());
1881 for (
auto &instance : instances)
1882 result.push_back({instance.name, instance.create_callback,
1883 instance.create_thread_trace_export_command});
1887#pragma mark UnwindAssembly
1898 llvm::StringRef name, llvm::StringRef description,
1909llvm::SmallVector<UnwindAssemblyCreateInstance>
1914#pragma mark MemoryHistory
1925 llvm::StringRef name, llvm::StringRef description,
1936llvm::SmallVector<MemoryHistoryCreateInstance>
1941#pragma mark InstrumentationRuntime
1960 bool enabled_only) {
1962 return instance->get_type_callback;
1973 llvm::StringRef name, llvm::StringRef description,
1977 name, description, create_callback, get_type_callback);
1985llvm::SmallVector<InstrumentationRuntimeCallbacks>
1989 llvm::SmallVector<InstrumentationRuntimeCallbacks> result;
1990 result.reserve(instances.size());
1991 for (
auto &instance : instances)
1992 result.push_back({instance.create_callback, instance.get_type_callback});
1996#pragma mark TypeSystem
2021 llvm::StringRef name, llvm::StringRef description,
2024 LanguageSet supported_languages_for_expressions) {
2026 name, description, create_callback, supported_languages_for_types,
2027 supported_languages_for_expressions);
2034llvm::SmallVector<TypeSystemCreateInstance>
2042 for (
unsigned i = 0; i < instances.size(); ++i)
2043 all.
bitvector |= instances[i].supported_languages_for_types.bitvector;
2050 for (
unsigned i = 0; i < instances.size(); ++i)
2051 all.
bitvector |= instances[i].supported_languages_for_expressions.bitvector;
2055#pragma mark ScriptedInterfaces
2079 llvm::StringRef name, llvm::StringRef description,
2083 name, description, create_callback, language, usages);
2107 return instance->language;
2114 return instance->usages;
2137 llvm::StringRef description,
2141 supported_languages);
2150 llvm::SmallVector<REPLCallbacks> result;
2151 result.reserve(instances.size());
2152 for (
auto &instance : instances)
2153 result.push_back({instance.create_callback, instance.supported_languages});
2160 for (
unsigned i = 0; i < instances.size(); ++i)
2161 all.
bitvector |= instances[i].supported_languages.bitvector;
2165#pragma mark Highlighter
2182 llvm::StringRef description,
2193llvm::SmallVector<HighlighterCreateInstance>
2198#pragma mark PluginManager
2219 Debugger &debugger, llvm::StringRef plugin_type_name,
2220 llvm::StringRef plugin_type_desc,
bool can_create) {
2223 if (parent_properties_sp) {
2224 static constexpr llvm::StringLiteral g_property_name(
"plugin");
2227 parent_properties_sp->GetSubProperty(
nullptr, g_property_name);
2228 if (!plugin_properties_sp && can_create) {
2229 plugin_properties_sp =
2230 std::make_shared<OptionValueProperties>(g_property_name);
2231 plugin_properties_sp->SetExpectedPath(
"plugin");
2232 parent_properties_sp->AppendProperty(g_property_name,
2233 "Settings specify to plugins.",
true,
2234 plugin_properties_sp);
2237 if (plugin_properties_sp) {
2239 plugin_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
2240 if (!plugin_type_properties_sp && can_create) {
2241 plugin_type_properties_sp =
2242 std::make_shared<OptionValueProperties>(plugin_type_name);
2243 plugin_type_properties_sp->SetExpectedPath(
2244 (
"plugin." + plugin_type_name).str());
2245 plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
2246 true, plugin_type_properties_sp);
2248 return plugin_type_properties_sp;
2258 Debugger &debugger, llvm::StringRef plugin_type_name,
2259 llvm::StringRef plugin_type_desc,
bool can_create) {
2260 static constexpr llvm::StringLiteral g_property_name(
"plugin");
2263 if (parent_properties_sp) {
2265 parent_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
2266 if (!plugin_properties_sp && can_create) {
2267 plugin_properties_sp =
2268 std::make_shared<OptionValueProperties>(plugin_type_name);
2269 plugin_properties_sp->SetExpectedPath(plugin_type_name.str());
2270 parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
2271 true, plugin_properties_sp);
2274 if (plugin_properties_sp) {
2276 plugin_properties_sp->GetSubProperty(
nullptr, g_property_name);
2277 if (!plugin_type_properties_sp && can_create) {
2278 plugin_type_properties_sp =
2279 std::make_shared<OptionValueProperties>(g_property_name);
2280 plugin_type_properties_sp->SetExpectedPath(
2281 (plugin_type_name +
".plugin").str());
2282 plugin_properties_sp->AppendProperty(g_property_name,
2283 "Settings specific to plugins",
2284 true, plugin_type_properties_sp);
2286 return plugin_type_properties_sp;
2295GetDebuggerPropertyForPluginsPtr(
Debugger &, llvm::StringRef, llvm::StringRef,
2301 llvm::StringRef plugin_type_name,
2302 GetDebuggerPropertyForPluginsPtr get_debugger_property =
2306 debugger, plugin_type_name,
2309 if (plugin_type_properties_sp)
2311 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
2312 return properties_sp;
2317 llvm::StringRef plugin_type_desc,
2319 llvm::StringRef description,
bool is_global_property,
2320 GetDebuggerPropertyForPluginsPtr get_debugger_property =
2322 if (properties_sp) {
2324 get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
2326 if (plugin_type_properties_sp) {
2327 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
2328 description, is_global_property,
2344static constexpr llvm::StringLiteral
2350 llvm::StringRef setting_name) {
2356 llvm::StringRef description,
bool is_global_property) {
2358 "Settings for dynamic loader plug-ins",
2359 properties_sp, description, is_global_property);
2364 llvm::StringRef setting_name) {
2371 llvm::StringRef description,
bool is_global_property) {
2373 "Settings for platform plug-ins", properties_sp,
2374 description, is_global_property,
2380 llvm::StringRef setting_name) {
2386 llvm::StringRef description,
bool is_global_property) {
2388 "Settings for process plug-ins", properties_sp,
2389 description, is_global_property);
2394 llvm::StringRef setting_name) {
2400 llvm::StringRef description,
bool is_global_property) {
2402 "Settings for symbol locator plug-ins",
2403 properties_sp, description, is_global_property);
2408 llvm::StringRef description,
bool is_global_property) {
2410 "Settings for trace plug-ins", properties_sp,
2411 description, is_global_property);
2416 llvm::StringRef setting_name) {
2422 llvm::StringRef description,
bool is_global_property) {
2424 "Settings for object file plug-ins",
2425 properties_sp, description, is_global_property);
2430 llvm::StringRef setting_name) {
2436 llvm::StringRef description,
bool is_global_property) {
2438 "Settings for symbol file plug-ins",
2439 properties_sp, description, is_global_property);
2444 llvm::StringRef setting_name) {
2450 llvm::StringRef description,
bool is_global_property) {
2452 "Settings for JIT loader plug-ins",
2453 properties_sp, description, is_global_property);
2459 Debugger &debugger, llvm::StringRef setting_name) {
2466 if (plugin_type_properties_sp)
2468 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
2469 return properties_sp;
2474 llvm::StringRef description,
bool is_global_property) {
2475 if (properties_sp) {
2478 "Settings for operating system plug-ins",
2480 if (plugin_type_properties_sp) {
2481 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
2482 description, is_global_property,
2492 llvm::StringRef setting_name) {
2498 llvm::StringRef description,
bool is_global_property) {
2500 "Settings for structured data plug-ins",
2501 properties_sp, description, is_global_property);
2506 Debugger &debugger, llvm::StringRef setting_name) {
2512 llvm::StringRef description,
bool is_global_property) {
2514 "Settings for CPlusPlus language plug-ins",
2515 properties_sp, description, is_global_property);
2528llvm::SmallVector<RegisteredPluginInfo>
2537llvm::SmallVector<RegisteredPluginInfo>
2546llvm::SmallVector<RegisteredPluginInfo>
2555llvm::SmallVector<RegisteredPluginInfo>
2564llvm::SmallVector<RegisteredPluginInfo>
2573llvm::SmallVector<RegisteredPluginInfo>
2587 llvm_unreachable(
"unhandled PluginDomainKind");
2591 llvm::StringRef name,
bool enable,
Debugger &requesting_debugger,
2594 return llvm::createStringErrorV(
"{} domain is not supported",
2597 return llvm::createStringError(
"plugin could not be found");
2599 return llvm::Error::success();
2602llvm::SmallVector<RegisteredPluginInfo>
2619llvm::SmallVector<RegisteredPluginInfo>
2628llvm::SmallVector<RegisteredPluginInfo>
2637llvm::SmallVector<RegisteredPluginInfo>
2646llvm::SmallVector<RegisteredPluginInfo>
2655llvm::SmallVector<RegisteredPluginInfo>
2686llvm::SmallVector<RegisteredPluginInfo>
2695llvm::SmallVector<RegisteredPluginInfo>
2704llvm::SmallVector<RegisteredPluginInfo>
2713llvm::SmallVector<RegisteredPluginInfo>
2722llvm::SmallVector<RegisteredPluginInfo>
2731llvm::SmallVector<RegisteredPluginInfo>
2740llvm::SmallVector<RegisteredPluginInfo>
2749llvm::SmallVector<RegisteredPluginInfo>
2765llvm::SmallVector<RegisteredPluginInfo>
2774llvm::SmallVector<RegisteredPluginInfo>
2783llvm::SmallVector<RegisteredPluginInfo>
2797 llvm::StringRef ns_name, plugin_prefix;
2798 std::tie(ns_name, plugin_prefix) = name.split(
'.');
2806 if (plugin_ns.name == ns_name) {
2808 llvm::SmallString<128> buf;
2809 if (
plugin.name.starts_with(plugin_prefix))
2811 (plugin_ns.name +
"." +
plugin.name).toStringRef(buf));
2813 }
else if (plugin_ns.name.starts_with(name) &&
2814 !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 BugReporterInstances & GetBugReporterInstances()
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
PluginInstances< BugReporterInstance > BugReporterInstances
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
PluginInstance< BugReporterCreateInstance > BugReporterInstance
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.
A class to manage flag bits.
A class that measures elapsed time in an exception safe way.
llvm::StringRef GetFileNameStrippingExtension() const
Return the filename without the extension part.
llvm::StringRef GetFilename() const
Filename string const get accessor.
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 bool SetBugReporterPluginEnabled(llvm::StringRef name, bool enable)
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 llvm::SmallVector< RegisteredPluginInfo > GetBugReporterPluginInfo()
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 std::unique_ptr< BugReporter > CreateBugReporterInstance(llvm::StringRef name={})
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::unique_ptr< BugReporter >(* BugReporterCreateInstance)()
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