22#include "llvm/ADT/StringRef.h"
23#include "llvm/ADT/StringSet.h"
24#include "llvm/ADT/Twine.h"
25#include "llvm/Support/DynamicLibrary.h"
26#include "llvm/Support/ErrorExtras.h"
27#include "llvm/Support/FileSystem.h"
28#include "llvm/Support/raw_ostream.h"
58 library = std::move(other.library);
83enum class PluginLifecycle { Uninitialized, Initialized, Terminated };
85struct PluginRegistry {
86 std::recursive_mutex mutex;
90 std::lock_guard<std::recursive_mutex> guard(mutex);
91 lifecycle = PluginLifecycle::Initialized;
95 std::lock_guard<std::recursive_mutex> guard(mutex);
96 lifecycle = PluginLifecycle::Terminated;
103 bool IsTerminated()
const {
return lifecycle == PluginLifecycle::Terminated; }
106 PluginLifecycle lifecycle = PluginLifecycle::Uninitialized;
117 static PluginRegistry *g_registry =
new PluginRegistry();
136 assert(!plugin_map.contains(plugin_file_spec));
137 plugin_map.try_emplace(plugin_file_spec, std::move(plugin_info));
140template <
typename FPtrTy>
static FPtrTy
CastToFPtr(
void *VPtr) {
141 return reinterpret_cast<FPtrTy
>(VPtr);
169 plugin_info.
library = llvm::sys::DynamicLibrary::getPermanentLibrary(
171 if (!plugin_info.
library.isValid())
172 return llvm::createStringError(
error);
179 llvm::StringRef plugin_name = file_name.substr(
g_plugin_prefix.size());
180 std::string init_symbol =
181 llvm::Twine(
"lldb_initialize_" + plugin_name).str();
184 plugin_info.
library.getAddressOfSymbol(init_symbol.c_str()))) {
186 return llvm::createStringErrorV(
"initializer '{0}' returned false",
188 const std::string term_symbol =
189 llvm::Twine(
"lldb_terminate_" + plugin_name).str();
191 plugin_info.
library.getAddressOfSymbol(term_symbol.c_str()));
198 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginInitialize"))) {
200 return llvm::createStringError(
201 "initializer 'LLDBPluginInitialize' returned false");
205 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginTerminate"));
209 return llvm::createStringError(
"no initialize symbol found");
214 llvm::StringRef path) {
215 namespace fs = llvm::sys::fs;
217 static constexpr std::array<llvm::StringLiteral, 3>
218 g_shared_library_extension = {
".dylib",
".so",
".dll"};
224 if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||
225 ft == fs::file_type::type_unknown) {
230 if (!llvm::is_contained(g_shared_library_extension,
245 llvm::Expected<PluginInfo> plugin_info =
254 "could not load plugin: {0}");
260 if (ft == fs::file_type::directory_file ||
261 ft == fs::file_type::symlink_file || ft == fs::file_type::type_unknown) {
275 static const bool find_directories =
true;
276 static const bool find_files =
true;
277 static const bool find_other =
true;
283 const std::array<PluginDir, 3> plugin_dirs = {
288 for (
const PluginDir &plugin_dir : plugin_dirs) {
291 plugin_dir.path.GetPath().c_str(), find_directories, find_files,
333 "emulate-instruction",
339 "instrumentation-runtime",
405 "register-type-builder",
411 "script-interpreter",
417 "scripted-interface",
477 return PluginNamespaces;
481 llvm::json::Object plugin_stats;
484 llvm::json::Array namespace_stats;
488 llvm::json::Object plugin_json;
489 plugin_json.try_emplace(
"name",
plugin.name);
490 plugin_json.try_emplace(
"enabled",
plugin.enabled);
491 namespace_stats.emplace_back(std::move(plugin_json));
494 if (!namespace_stats.empty())
495 plugin_stats.try_emplace(plugin_ns.name, std::move(namespace_stats));
509 if (pattern == plugin_ns.
name)
513 std::string qualified_name = (plugin_ns.
name +
"." + plugin_info.
name).str();
514 return pattern == qualified_name;
543 llvm::errs() << llvm::formatv(
"Use `image lookup -va {0:x}` to find out "
544 "which callback was not removed\n",
545 instance.create_callback);
547 assert(
m_instances.empty() &&
"forgot to unregister plugin?");
550 template <
typename...
Args>
552 typename Instance::CallbackType callback,
556 assert(!name.empty());
558 std::lock_guard<std::mutex> guard(
m_mutex);
559 m_instances.emplace_back(name, description, callback,
560 std::forward<Args>(args)...);
568 std::lock_guard<std::mutex> guard(
m_mutex);
571 for (; pos != end; ++pos) {
572 if (pos->create_callback == callback) {
582 return instance->description;
588 return instance->name;
594 return instance->create_callback;
599 llvm::SmallVector<Instance> snapshot =
GetSnapshot();
600 llvm::SmallVector<typename Instance::CallbackType> result;
601 result.reserve(snapshot.size());
602 for (
const auto &instance : snapshot)
603 result.push_back(instance.create_callback);
609 if (instance.debugger_init_callback)
610 instance.debugger_init_callback(debugger);
618 llvm::SmallVector<Instance>
GetSnapshot(
bool enabled_only =
true)
const {
619 std::lock_guard<std::mutex> guard(
m_mutex);
621 llvm::SmallVector<Instance> enabled_instances;
624 if (!enabled_only || instance.enabled)
625 enabled_instances.push_back(instance);
627 return enabled_instances;
634 [&](
const Instance &instance) {
return count++ == idx; });
638 bool enabled_only =
true) {
642 auto predicate = [&](
const Instance &instance) {
643 return instance.name == name;
651 std::optional<Instance>
654 if (predicate(instance))
660 std::optional<Instance>
662 std::lock_guard<std::mutex> guard(
m_mutex);
664 if (predicate(instance))
675 std::lock_guard<std::mutex> guard(
m_mutex);
678 llvm::SmallVector<RegisteredPluginInfo> plugin_infos;
682 plugin_infos.push_back(
683 {instance.name, instance.description, instance.enabled});
689 std::lock_guard<std::mutex> guard(
m_mutex);
690 auto it = llvm::find_if(
m_instances, [&](
const Instance &instance) {
691 return instance.name == name;
697 it->enabled = enable;
717 llvm::StringRef description,
730#pragma mark Architecture
741 llvm::StringRef description,
749 instances.UnregisterPlugin(create_callback);
752std::unique_ptr<Architecture>
755 if (
auto plugin_up = instances.create_callback(arch))
761#pragma mark BugReporter
772 llvm::StringRef description,
782std::unique_ptr<BugReporter>
785 if (
auto create_callback =
787 return create_callback();
791 if (
auto plugin_up = instance.create_callback())
797#pragma mark Disassembler
808 llvm::StringRef description,
819llvm::SmallVector<DisassemblerCreateInstance>
826 llvm::StringRef name) {
830#pragma mark DynamicLoader
841 llvm::StringRef name, llvm::StringRef description,
845 name, description, create_callback, debugger_init_callback);
853llvm::SmallVector<DynamicLoaderCreateInstance>
860 llvm::StringRef name) {
864#pragma mark JITLoader
875 llvm::StringRef name, llvm::StringRef description,
879 name, description, create_callback, debugger_init_callback);
886llvm::SmallVector<JITLoaderCreateInstance>
891#pragma mark EmulateInstruction
903 llvm::StringRef name, llvm::StringRef description,
914llvm::SmallVector<EmulateInstructionCreateInstance>
921 llvm::StringRef name) {
925#pragma mark OperatingSystem
936 llvm::StringRef name, llvm::StringRef description,
940 name, description, create_callback, debugger_init_callback);
948llvm::SmallVector<OperatingSystemCreateInstance>
955 llvm::StringRef name) {
970 llvm::StringRef name, llvm::StringRef description,
974 name, description, create_callback, debugger_init_callback);
981llvm::SmallVector<LanguageCreateInstance>
986#pragma mark LanguageRuntime
1013 llvm::StringRef name, llvm::StringRef description,
1018 name, description, create_callback,
nullptr, command_callback,
1019 precondition_callback);
1027llvm::SmallVector<LanguageRuntimeCallbacks>
1030 llvm::SmallVector<LanguageRuntimeCallbacks> result;
1031 result.reserve(instances.size());
1032 for (
auto &instance : instances)
1033 result.push_back({instance.create_callback, instance.command_callback,
1034 instance.precondition_callback});
1038#pragma mark SystemRuntime
1049 llvm::StringRef name, llvm::StringRef description,
1060llvm::SmallVector<SystemRuntimeCreateInstance>
1065#pragma mark ObjectFile
1100 llvm::StringRef name, llvm::StringRef description,
1107 name, description, create_callback, create_memory_callback,
1108 get_module_specifications, save_core, debugger_init_callback);
1117 llvm::SmallVector<ObjectFileCallbacks> result;
1118 result.reserve(instances.size());
1119 for (
auto &instance : instances)
1120 result.push_back({instance.create_callback, instance.create_memory_callback,
1121 instance.get_module_specifications, instance.save_core});
1127 llvm::StringRef name) {
1129 return instance->create_memory_callback;
1151 llvm::Expected<bool> ret =
1160 const auto &plugin_name = options.
GetPluginName().value_or(
"");
1162 for (
auto &instance : instances) {
1163 if (plugin_name.empty() || instance.name == plugin_name) {
1166 if (instance.save_core &&
1178 if (!plugin_name.empty())
1180 "The \"{}\" plugin is not able to save a core for this process.",
1184 "no ObjectFile plugins were able to save a core for this process");
1188 llvm::SmallVector<llvm::StringRef> plugin_names;
1190 for (
auto &instance : instances) {
1191 if (instance.save_core)
1192 plugin_names.emplace_back(instance.name);
1194 return plugin_names;
1197#pragma mark ObjectContainer
1222 llvm::StringRef name, llvm::StringRef description,
1227 name, description, create_callback, create_memory_callback,
1228 get_module_specifications);
1236llvm::SmallVector<ObjectContainerCallbacks>
1239 llvm::SmallVector<ObjectContainerCallbacks> result;
1240 result.reserve(instances.size());
1241 for (
auto &instance : instances)
1242 result.push_back({instance.create_callback, instance.create_memory_callback,
1243 instance.get_module_specifications});
1247#pragma mark Platform
1254 return g_platform_instances;
1258 llvm::StringRef name, llvm::StringRef description,
1262 name, description, create_callback, debugger_init_callback);
1283llvm::SmallVector<PlatformCreateInstance>
1291 if (instance.name.starts_with(name))
1307 llvm::StringRef name, llvm::StringRef description,
1311 name, description, create_callback, debugger_init_callback);
1332llvm::SmallVector<ProcessCreateInstance>
1340 if (instance.name.starts_with(name))
1345#pragma mark ProtocolServer
1356 llvm::StringRef name, llvm::StringRef description,
1377#pragma mark RegisterTypeBuilder
1387typedef PluginInstances<RegisterTypeBuilderInstance>
1396 llvm::StringRef name, llvm::StringRef description,
1413 return instance->create_callback(target);
1416#pragma mark ScriptInterpreter
1440 llvm::StringRef name, llvm::StringRef description,
1445 name, description, create_callback, script_language, get_path_callback);
1453llvm::SmallVector<ScriptInterpreterCreateInstance>
1463 for (
const auto &instance : instances) {
1465 none_instance = instance.create_callback;
1467 if (script_lang == instance.language)
1468 return instance.create_callback(debugger);
1472 assert(none_instance !=
nullptr);
1473 return none_instance(debugger);
1479 for (
const auto &instance : instances) {
1480 if (instance.language == script_lang && instance.get_path_callback)
1481 return instance.get_path_callback();
1486#pragma mark SyntheticFrameProvider
1508 llvm::StringRef name, llvm::StringRef description,
1511 if (create_native_callback)
1513 name, description, create_native_callback);
1514 else if (create_scripted_callback)
1516 name, description, create_scripted_callback);
1532 llvm::StringRef name) {
1536llvm::SmallVector<ScriptedFrameProviderCreateInstance>
1541#pragma mark StructuredDataPlugin
1566 llvm::StringRef name, llvm::StringRef description,
1571 name, description, create_callback, debugger_init_callback,
1580llvm::SmallVector<StructuredDataPluginCallbacks>
1583 llvm::SmallVector<StructuredDataPluginCallbacks> result;
1584 result.reserve(instances.size());
1585 for (
auto &instance : instances)
1586 result.push_back({instance.create_callback, instance.filter_callback});
1590#pragma mark SymbolFile
1601 llvm::StringRef name, llvm::StringRef description,
1605 name, description, create_callback, debugger_init_callback);
1612llvm::SmallVector<SymbolFileCreateInstance>
1617#pragma mark SymbolVendor
1628 llvm::StringRef description,
1639llvm::SmallVector<SymbolVendorCreateInstance>
1644#pragma mark SymbolLocator
1676 llvm::StringRef name, llvm::StringRef description,
1684 name, description, create_callback, locate_executable_object_file,
1685 locate_executable_symbol_file, download_object_symbol_file,
1686 find_symbol_file_in_bundle, debugger_init_callback);
1694llvm::SmallVector<SymbolLocatorCreateInstance>
1703 for (
auto &instance : instances) {
1704 if (instance.locate_executable_object_file) {
1706 std::optional<ModuleSpec> result;
1709 result = instance.locate_executable_object_file(module_spec);
1711 map.
add(instance.name, time.
get().count());
1723 for (
auto &instance : instances) {
1724 if (instance.locate_executable_symbol_file) {
1726 std::optional<FileSpec> result;
1729 result = instance.locate_executable_symbol_file(module_spec,
1730 default_search_paths);
1732 map.
add(instance.name, time.
get().count());
1743 bool copy_executable) {
1745 for (
auto &instance : instances) {
1746 if (instance.download_object_symbol_file) {
1747 if (instance.download_object_symbol_file(module_spec,
error, force_lookup,
1759 for (
auto &instance : instances) {
1760 if (instance.find_symbol_file_in_bundle) {
1761 std::optional<FileSpec> result =
1762 instance.find_symbol_file_in_bundle(symfile_bundle, uuid, arch);
1796 llvm::StringRef name, llvm::StringRef description,
1801 name, description, create_callback_from_bundle,
1802 create_callback_for_live_process, schema, debugger_init_callback);
1808 create_callback_from_bundle);
1818 llvm::StringRef plugin_name) {
1820 return instance->create_callback_for_live_process;
1827 return instance->schema;
1828 return llvm::StringRef();
1833 return instance->schema;
1834 return llvm::StringRef();
1837#pragma mark TraceExporter
1861 llvm::StringRef name, llvm::StringRef description,
1865 name, description, create_callback, create_thread_trace_export_command);
1878llvm::SmallVector<TraceExporterCallbacks>
1881 llvm::SmallVector<TraceExporterCallbacks> result;
1882 result.reserve(instances.size());
1883 for (
auto &instance : instances)
1884 result.push_back({instance.name, instance.create_callback,
1885 instance.create_thread_trace_export_command});
1889#pragma mark UnwindAssembly
1900 llvm::StringRef name, llvm::StringRef description,
1911llvm::SmallVector<UnwindAssemblyCreateInstance>
1916#pragma mark MemoryHistory
1927 llvm::StringRef name, llvm::StringRef description,
1938llvm::SmallVector<MemoryHistoryCreateInstance>
1943#pragma mark InstrumentationRuntime
1962 bool enabled_only) {
1964 return instance->get_type_callback;
1975 llvm::StringRef name, llvm::StringRef description,
1979 name, description, create_callback, get_type_callback);
1987llvm::SmallVector<InstrumentationRuntimeCallbacks>
1991 llvm::SmallVector<InstrumentationRuntimeCallbacks> result;
1992 result.reserve(instances.size());
1993 for (
auto &instance : instances)
1994 result.push_back({instance.create_callback, instance.get_type_callback});
1998#pragma mark TypeSystem
2023 llvm::StringRef name, llvm::StringRef description,
2026 LanguageSet supported_languages_for_expressions) {
2028 name, description, create_callback, supported_languages_for_types,
2029 supported_languages_for_expressions);
2036llvm::SmallVector<TypeSystemCreateInstance>
2044 for (
unsigned i = 0; i < instances.size(); ++i)
2045 all.
bitvector |= instances[i].supported_languages_for_types.bitvector;
2052 for (
unsigned i = 0; i < instances.size(); ++i)
2053 all.
bitvector |= instances[i].supported_languages_for_expressions.bitvector;
2057#pragma mark ScriptedInterfaces
2083 llvm::StringRef name, llvm::StringRef description,
2088 name, description, create_callback, extension, language, usages);
2112 return instance->extension;
2119 return instance->language;
2126 return instance->usages;
2133 llvm::StringSet<> emitted;
2141 instance->language != language)
2143 llvm::StringLiteral extension_name =
2145 if (!extension_name.starts_with(name))
2149 if (emitted.insert(extension_name).second)
2173 llvm::StringRef description,
2177 supported_languages);
2186 llvm::SmallVector<REPLCallbacks> result;
2187 result.reserve(instances.size());
2188 for (
auto &instance : instances)
2189 result.push_back({instance.create_callback, instance.supported_languages});
2196 for (
unsigned i = 0; i < instances.size(); ++i)
2197 all.
bitvector |= instances[i].supported_languages.bitvector;
2201#pragma mark Highlighter
2218 llvm::StringRef description,
2229llvm::SmallVector<HighlighterCreateInstance>
2234#pragma mark PluginManager
2255 Debugger &debugger, llvm::StringRef plugin_type_name,
2256 llvm::StringRef plugin_type_desc,
bool can_create) {
2259 if (parent_properties_sp) {
2260 static constexpr llvm::StringLiteral g_property_name(
"plugin");
2263 parent_properties_sp->GetSubProperty(
nullptr, g_property_name);
2264 if (!plugin_properties_sp && can_create) {
2265 plugin_properties_sp =
2266 std::make_shared<OptionValueProperties>(g_property_name);
2267 plugin_properties_sp->SetExpectedPath(
"plugin");
2268 parent_properties_sp->AppendProperty(g_property_name,
2269 "Settings specify to plugins.",
true,
2270 plugin_properties_sp);
2273 if (plugin_properties_sp) {
2275 plugin_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
2276 if (!plugin_type_properties_sp && can_create) {
2277 plugin_type_properties_sp =
2278 std::make_shared<OptionValueProperties>(plugin_type_name);
2279 plugin_type_properties_sp->SetExpectedPath(
2280 (
"plugin." + plugin_type_name).str());
2281 plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
2282 true, plugin_type_properties_sp);
2284 return plugin_type_properties_sp;
2294 Debugger &debugger, llvm::StringRef plugin_type_name,
2295 llvm::StringRef plugin_type_desc,
bool can_create) {
2296 static constexpr llvm::StringLiteral g_property_name(
"plugin");
2299 if (parent_properties_sp) {
2301 parent_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
2302 if (!plugin_properties_sp && can_create) {
2303 plugin_properties_sp =
2304 std::make_shared<OptionValueProperties>(plugin_type_name);
2305 plugin_properties_sp->SetExpectedPath(plugin_type_name.str());
2306 parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
2307 true, plugin_properties_sp);
2310 if (plugin_properties_sp) {
2312 plugin_properties_sp->GetSubProperty(
nullptr, g_property_name);
2313 if (!plugin_type_properties_sp && can_create) {
2314 plugin_type_properties_sp =
2315 std::make_shared<OptionValueProperties>(g_property_name);
2316 plugin_type_properties_sp->SetExpectedPath(
2317 (plugin_type_name +
".plugin").str());
2318 plugin_properties_sp->AppendProperty(g_property_name,
2319 "Settings specific to plugins",
2320 true, plugin_type_properties_sp);
2322 return plugin_type_properties_sp;
2331GetDebuggerPropertyForPluginsPtr(
Debugger &, llvm::StringRef, llvm::StringRef,
2337 llvm::StringRef plugin_type_name,
2338 GetDebuggerPropertyForPluginsPtr get_debugger_property =
2342 debugger, plugin_type_name,
2345 if (plugin_type_properties_sp)
2347 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
2348 return properties_sp;
2353 llvm::StringRef plugin_type_desc,
2355 llvm::StringRef description,
bool is_global_property,
2356 GetDebuggerPropertyForPluginsPtr get_debugger_property =
2358 if (properties_sp) {
2360 get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
2362 if (plugin_type_properties_sp) {
2363 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
2364 description, is_global_property,
2380static constexpr llvm::StringLiteral
2386 llvm::StringRef setting_name) {
2392 llvm::StringRef description,
bool is_global_property) {
2394 "Settings for dynamic loader plug-ins",
2395 properties_sp, description, is_global_property);
2400 llvm::StringRef setting_name) {
2407 llvm::StringRef description,
bool is_global_property) {
2409 "Settings for platform plug-ins", properties_sp,
2410 description, is_global_property,
2416 llvm::StringRef setting_name) {
2422 llvm::StringRef description,
bool is_global_property) {
2424 "Settings for process plug-ins", properties_sp,
2425 description, is_global_property);
2430 llvm::StringRef setting_name) {
2436 llvm::StringRef description,
bool is_global_property) {
2438 "Settings for symbol locator plug-ins",
2439 properties_sp, description, is_global_property);
2444 llvm::StringRef description,
bool is_global_property) {
2446 "Settings for trace plug-ins", properties_sp,
2447 description, is_global_property);
2452 llvm::StringRef setting_name) {
2458 llvm::StringRef description,
bool is_global_property) {
2460 "Settings for object file plug-ins",
2461 properties_sp, description, is_global_property);
2466 llvm::StringRef setting_name) {
2472 llvm::StringRef description,
bool is_global_property) {
2474 "Settings for symbol file plug-ins",
2475 properties_sp, description, is_global_property);
2480 llvm::StringRef setting_name) {
2486 llvm::StringRef description,
bool is_global_property) {
2488 "Settings for JIT loader plug-ins",
2489 properties_sp, description, is_global_property);
2495 Debugger &debugger, llvm::StringRef setting_name) {
2502 if (plugin_type_properties_sp)
2504 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
2505 return properties_sp;
2510 llvm::StringRef description,
bool is_global_property) {
2511 if (properties_sp) {
2514 "Settings for operating system plug-ins",
2516 if (plugin_type_properties_sp) {
2517 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
2518 description, is_global_property,
2528 llvm::StringRef setting_name) {
2534 llvm::StringRef description,
bool is_global_property) {
2536 "Settings for structured data plug-ins",
2537 properties_sp, description, is_global_property);
2542 Debugger &debugger, llvm::StringRef setting_name) {
2548 llvm::StringRef description,
bool is_global_property) {
2550 "Settings for CPlusPlus language plug-ins",
2551 properties_sp, description, is_global_property);
2564llvm::SmallVector<RegisteredPluginInfo>
2573llvm::SmallVector<RegisteredPluginInfo>
2582llvm::SmallVector<RegisteredPluginInfo>
2591llvm::SmallVector<RegisteredPluginInfo>
2600llvm::SmallVector<RegisteredPluginInfo>
2609llvm::SmallVector<RegisteredPluginInfo>
2623 llvm_unreachable(
"unhandled PluginDomainKind");
2627 llvm::StringRef name,
bool enable,
Debugger &requesting_debugger,
2630 return llvm::createStringErrorV(
"{} domain is not supported",
2633 return llvm::createStringError(
"plugin could not be found");
2635 return llvm::Error::success();
2638llvm::SmallVector<RegisteredPluginInfo>
2655llvm::SmallVector<RegisteredPluginInfo>
2664llvm::SmallVector<RegisteredPluginInfo>
2673llvm::SmallVector<RegisteredPluginInfo>
2682llvm::SmallVector<RegisteredPluginInfo>
2691llvm::SmallVector<RegisteredPluginInfo>
2722llvm::SmallVector<RegisteredPluginInfo>
2731llvm::SmallVector<RegisteredPluginInfo>
2740llvm::SmallVector<RegisteredPluginInfo>
2749llvm::SmallVector<RegisteredPluginInfo>
2758llvm::SmallVector<RegisteredPluginInfo>
2767llvm::SmallVector<RegisteredPluginInfo>
2776llvm::SmallVector<RegisteredPluginInfo>
2785llvm::SmallVector<RegisteredPluginInfo>
2801llvm::SmallVector<RegisteredPluginInfo>
2810llvm::SmallVector<RegisteredPluginInfo>
2819llvm::SmallVector<RegisteredPluginInfo>
2833 llvm::StringRef ns_name, plugin_prefix;
2834 std::tie(ns_name, plugin_prefix) = name.split(
'.');
2842 if (plugin_ns.name == ns_name) {
2844 llvm::SmallString<128> buf;
2845 if (
plugin.name.starts_with(plugin_prefix))
2847 (plugin_ns.name +
"." +
plugin.name).toStringRef(buf));
2849 }
else if (plugin_ns.name.starts_with(name) &&
2850 !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 void AutoCompleteScriptedExtension(llvm::StringRef partial_name, CompletionRequest &request, lldb::ScriptLanguage language=lldb::eScriptLanguageUnknown)
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 lldb::ScriptedExtension GetScriptedInterfaceExtensionAtIndex(uint32_t idx)
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
static llvm::StringLiteral ExtensionToString(lldb::ScriptedExtension extension)
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
ScriptedExtension
Scripting extension types.
@ eScriptedExtensionInvalid
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
ScriptedInterfaceInstance(llvm::StringRef name, llvm::StringRef description, ScriptedInterfaceCreateInstance create_callback, lldb::ScriptedExtension extension, lldb::ScriptLanguage language, ScriptedInterfaceUsages usages)
lldb::ScriptLanguage language
lldb::ScriptedExtension extension
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