22#include "llvm/ADT/DenseMap.h"
23#include "llvm/ADT/SmallSet.h"
24#include "llvm/ADT/StringRef.h"
25#include "llvm/ADT/Twine.h"
26#include "llvm/Support/DynamicLibrary.h"
27#include "llvm/Support/ErrorExtras.h"
28#include "llvm/Support/FileSystem.h"
29#include "llvm/Support/raw_ostream.h"
59 library = std::move(other.library);
84enum class PluginLifecycle { Uninitialized, Initialized, Terminated };
86struct PluginRegistry {
87 std::recursive_mutex mutex;
91 std::lock_guard<std::recursive_mutex> guard(mutex);
92 lifecycle = PluginLifecycle::Initialized;
96 std::lock_guard<std::recursive_mutex> guard(mutex);
97 lifecycle = PluginLifecycle::Terminated;
104 bool IsTerminated()
const {
return lifecycle == PluginLifecycle::Terminated; }
107 PluginLifecycle lifecycle = PluginLifecycle::Uninitialized;
118 static PluginRegistry *g_registry =
new PluginRegistry();
137 assert(!plugin_map.contains(plugin_file_spec));
138 plugin_map.try_emplace(plugin_file_spec, std::move(plugin_info));
141template <
typename FPtrTy>
static FPtrTy
CastToFPtr(
void *VPtr) {
142 return reinterpret_cast<FPtrTy
>(VPtr);
170 plugin_info.
library = llvm::sys::DynamicLibrary::getPermanentLibrary(
172 if (!plugin_info.
library.isValid())
173 return llvm::createStringError(
error);
180 llvm::StringRef plugin_name = file_name.substr(
g_plugin_prefix.size());
181 std::string init_symbol =
182 llvm::Twine(
"lldb_initialize_" + plugin_name).str();
185 plugin_info.
library.getAddressOfSymbol(init_symbol.c_str()))) {
187 return llvm::createStringErrorV(
"initializer '{0}' returned false",
189 const std::string term_symbol =
190 llvm::Twine(
"lldb_terminate_" + plugin_name).str();
192 plugin_info.
library.getAddressOfSymbol(term_symbol.c_str()));
199 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginInitialize"))) {
201 return llvm::createStringError(
202 "initializer 'LLDBPluginInitialize' returned false");
206 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginTerminate"));
210 return llvm::createStringError(
"no initialize symbol found");
215 llvm::StringRef path) {
216 namespace fs = llvm::sys::fs;
218 static constexpr std::array<llvm::StringLiteral, 3>
219 g_shared_library_extension = {
".dylib",
".so",
".dll"};
225 if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||
226 ft == fs::file_type::type_unknown) {
231 if (!llvm::is_contained(g_shared_library_extension,
246 llvm::Expected<PluginInfo> plugin_info =
255 "could not load plugin: {0}");
261 if (ft == fs::file_type::directory_file ||
262 ft == fs::file_type::symlink_file || ft == fs::file_type::type_unknown) {
276 static const bool find_directories =
true;
277 static const bool find_files =
true;
278 static const bool find_other =
true;
284 const std::array<PluginDir, 3> plugin_dirs = {
289 for (
const PluginDir &plugin_dir : plugin_dirs) {
292 plugin_dir.path.GetPath().c_str(), find_directories, find_files,
339 "emulate-instruction",
345 "instrumentation-runtime",
411 "register-type-builder",
417 "script-interpreter",
423 "scripted-interface",
483 return PluginNamespaces;
487 llvm::json::Object plugin_stats;
490 llvm::json::Array namespace_stats;
494 llvm::json::Object plugin_json;
495 plugin_json.try_emplace(
"name",
plugin.name);
496 plugin_json.try_emplace(
"enabled",
plugin.enabled);
497 namespace_stats.emplace_back(std::move(plugin_json));
500 if (!namespace_stats.empty())
501 plugin_stats.try_emplace(plugin_ns.name, std::move(namespace_stats));
515 if (pattern == plugin_ns.
name)
519 std::string qualified_name = (plugin_ns.
name +
"." + plugin_info.
name).str();
520 return pattern == qualified_name;
531 llvm::errs() << llvm::formatv(
"Use `image lookup -va {0:x}` to find out "
532 "which callback was not removed\n",
533 instance.create_callback);
535 assert(
m_instances.empty() &&
"forgot to unregister plugin?");
538 template <
typename...
Args>
540 typename Instance::CallbackType callback,
544 assert(!name.empty());
546 std::lock_guard<std::mutex> guard(
m_mutex);
547 m_instances.emplace_back(name, description, callback,
548 std::forward<Args>(args)...);
556 std::lock_guard<std::mutex> guard(
m_mutex);
559 for (; pos != end; ++pos) {
560 if (pos->create_callback == callback) {
570 return instance->description;
576 return instance->name;
582 return instance->create_callback;
587 llvm::SmallVector<Instance> snapshot =
GetSnapshot();
588 llvm::SmallVector<typename Instance::CallbackType> result;
589 result.reserve(snapshot.size());
590 for (
const auto &instance : snapshot)
591 result.push_back(instance.create_callback);
597 if (instance.debugger_init_callback)
598 instance.debugger_init_callback(debugger);
606 llvm::SmallVector<Instance>
GetSnapshot(
bool enabled_only =
true)
const {
607 std::lock_guard<std::mutex> guard(
m_mutex);
609 llvm::SmallVector<Instance> enabled_instances;
612 if (!enabled_only || instance.enabled)
613 enabled_instances.push_back(instance);
615 return enabled_instances;
622 [&](
const Instance &instance) {
return count++ == idx; });
626 bool enabled_only =
true) {
630 auto predicate = [&](
const Instance &instance) {
631 return instance.name == name;
639 std::optional<Instance>
642 if (predicate(instance))
648 std::optional<Instance>
650 std::lock_guard<std::mutex> guard(
m_mutex);
652 if (predicate(instance))
663 std::lock_guard<std::mutex> guard(
m_mutex);
666 llvm::SmallVector<RegisteredPluginInfo> plugin_infos;
670 plugin_infos.push_back(
671 {instance.name, instance.description, instance.enabled});
677 std::lock_guard<std::mutex> guard(
m_mutex);
678 auto it = llvm::find_if(
m_instances, [&](
const Instance &instance) {
679 return instance.name == name;
685 it->enabled = enable;
705 llvm::StringRef description,
718#pragma mark Architecture
729 llvm::StringRef description,
737 instances.UnregisterPlugin(create_callback);
740std::unique_ptr<Architecture>
743 if (
auto plugin_up = instances.create_callback(arch))
749#pragma mark BugReporter
760 llvm::StringRef description,
770std::unique_ptr<BugReporter>
773 if (
auto create_callback =
775 return create_callback();
779 if (
auto plugin_up = instance.create_callback())
785#pragma mark Disassembler
796 llvm::StringRef description,
807llvm::SmallVector<DisassemblerCreateInstance>
814 llvm::StringRef name) {
818#pragma mark DynamicLoader
829 llvm::StringRef name, llvm::StringRef description,
833 name, description, create_callback, debugger_init_callback);
841llvm::SmallVector<DynamicLoaderCreateInstance>
848 llvm::StringRef name) {
852#pragma mark JITLoader
863 llvm::StringRef name, llvm::StringRef description,
867 name, description, create_callback, debugger_init_callback);
874llvm::SmallVector<JITLoaderCreateInstance>
879#pragma mark EmulateInstruction
891 llvm::StringRef name, llvm::StringRef description,
902llvm::SmallVector<EmulateInstructionCreateInstance>
909 llvm::StringRef name) {
913#pragma mark OperatingSystem
924 llvm::StringRef name, llvm::StringRef description,
928 name, description, create_callback, debugger_init_callback);
936llvm::SmallVector<OperatingSystemCreateInstance>
943 llvm::StringRef name) {
958 llvm::StringRef name, llvm::StringRef description,
962 name, description, create_callback, debugger_init_callback);
969llvm::SmallVector<LanguageCreateInstance>
974#pragma mark LanguageRuntime
1001 llvm::StringRef name, llvm::StringRef description,
1006 name, description, create_callback,
nullptr, command_callback,
1007 precondition_callback);
1015llvm::SmallVector<LanguageRuntimeCallbacks>
1018 llvm::SmallVector<LanguageRuntimeCallbacks> result;
1019 result.reserve(instances.size());
1020 for (
auto &instance : instances)
1021 result.push_back({instance.create_callback, instance.command_callback,
1022 instance.precondition_callback});
1026#pragma mark SystemRuntime
1037 llvm::StringRef name, llvm::StringRef description,
1048llvm::SmallVector<SystemRuntimeCreateInstance>
1053#pragma mark ObjectFile
1088 llvm::StringRef name, llvm::StringRef description,
1095 name, description, create_callback, create_memory_callback,
1096 get_module_specifications, save_core, debugger_init_callback);
1105 llvm::SmallVector<ObjectFileCallbacks> result;
1106 result.reserve(instances.size());
1107 for (
auto &instance : instances)
1108 result.push_back({instance.create_callback, instance.create_memory_callback,
1109 instance.get_module_specifications, instance.save_core});
1115 llvm::StringRef name) {
1117 return instance->create_memory_callback;
1139 llvm::Expected<bool> ret =
1148 const auto &plugin_name = options.
GetPluginName().value_or(
"");
1150 for (
auto &instance : instances) {
1151 if (plugin_name.empty() || instance.name == plugin_name) {
1154 if (instance.save_core &&
1166 if (!plugin_name.empty())
1168 "The \"{}\" plugin is not able to save a core for this process.",
1172 "no ObjectFile plugins were able to save a core for this process");
1176 llvm::SmallVector<llvm::StringRef> plugin_names;
1178 for (
auto &instance : instances) {
1179 if (instance.save_core)
1180 plugin_names.emplace_back(instance.name);
1182 return plugin_names;
1185#pragma mark ObjectContainer
1210 llvm::StringRef name, llvm::StringRef description,
1215 name, description, create_callback, create_memory_callback,
1216 get_module_specifications);
1224llvm::SmallVector<ObjectContainerCallbacks>
1227 llvm::SmallVector<ObjectContainerCallbacks> result;
1228 result.reserve(instances.size());
1229 for (
auto &instance : instances)
1230 result.push_back({instance.create_callback, instance.create_memory_callback,
1231 instance.get_module_specifications});
1235#pragma mark Platform
1242 return g_platform_instances;
1246 llvm::StringRef name, llvm::StringRef description,
1250 name, description, create_callback, debugger_init_callback);
1271llvm::SmallVector<PlatformCreateInstance>
1279 if (instance.name.starts_with(name))
1295 llvm::StringRef name, llvm::StringRef description,
1299 name, description, create_callback, debugger_init_callback);
1320llvm::SmallVector<ProcessCreateInstance>
1328 if (instance.name.starts_with(name))
1333#pragma mark ProtocolServer
1344 llvm::StringRef name, llvm::StringRef description,
1365#pragma mark RegisterTypeBuilder
1375typedef PluginInstances<RegisterTypeBuilderInstance>
1384 llvm::StringRef name, llvm::StringRef description,
1401 return instance->create_callback(target);
1404#pragma mark ScriptInterpreter
1428 llvm::StringRef name, llvm::StringRef description,
1433 name, description, create_callback, script_language, get_path_callback);
1441llvm::SmallVector<ScriptInterpreterCreateInstance>
1451 for (
const auto &instance : instances) {
1453 none_instance = instance.create_callback;
1455 if (script_lang == instance.language)
1456 return instance.create_callback(debugger, script_lang);
1460 assert(none_instance !=
nullptr);
1461 return none_instance(debugger, script_lang);
1465struct ScriptInterpreterErrors {
1467 llvm::DenseMap<lldb::ScriptLanguage, Status> errors;
1472 static ScriptInterpreterErrors g_errors;
1478 std::lock_guard<std::mutex> guard(errors.mutex);
1479 errors.errors.clear();
1483 llvm::Error
error) {
1485 std::lock_guard<std::mutex> guard(errors.mutex);
1489 errors.errors.erase(script_lang);
1495 std::lock_guard<std::mutex> guard(errors.mutex);
1496 auto it = errors.errors.find(script_lang);
1497 if (it == errors.errors.end())
1498 return llvm::Error::success();
1499 return it->second.ToError();
1505 for (
const auto &instance : instances) {
1506 if (instance.language == script_lang && instance.get_path_callback)
1507 return instance.get_path_callback();
1512#pragma mark SyntheticFrameProvider
1534 llvm::StringRef name, llvm::StringRef description,
1537 if (create_native_callback)
1539 name, description, create_native_callback);
1540 else if (create_scripted_callback)
1542 name, description, create_scripted_callback);
1558 llvm::StringRef name) {
1562llvm::SmallVector<ScriptedFrameProviderCreateInstance>
1567#pragma mark StructuredDataPlugin
1592 llvm::StringRef name, llvm::StringRef description,
1597 name, description, create_callback, debugger_init_callback,
1606llvm::SmallVector<StructuredDataPluginCallbacks>
1609 llvm::SmallVector<StructuredDataPluginCallbacks> result;
1610 result.reserve(instances.size());
1611 for (
auto &instance : instances)
1612 result.push_back({instance.create_callback, instance.filter_callback});
1616#pragma mark SymbolFile
1627 llvm::StringRef name, llvm::StringRef description,
1631 name, description, create_callback, debugger_init_callback);
1638llvm::SmallVector<SymbolFileCreateInstance>
1643#pragma mark SymbolVendor
1654 llvm::StringRef description,
1665llvm::SmallVector<SymbolVendorCreateInstance>
1670#pragma mark SymbolLocator
1702 llvm::StringRef name, llvm::StringRef description,
1710 name, description, create_callback, locate_executable_object_file,
1711 locate_executable_symbol_file, download_object_symbol_file,
1712 find_symbol_file_in_bundle, debugger_init_callback);
1720llvm::SmallVector<SymbolLocatorCreateInstance>
1729 for (
auto &instance : instances) {
1730 if (instance.locate_executable_object_file) {
1732 std::optional<ModuleSpec> result;
1735 result = instance.locate_executable_object_file(module_spec);
1737 map.
add(instance.name, time.
get().count());
1749 for (
auto &instance : instances) {
1750 if (instance.locate_executable_symbol_file) {
1752 std::optional<FileSpec> result;
1755 result = instance.locate_executable_symbol_file(module_spec,
1756 default_search_paths);
1758 map.
add(instance.name, time.
get().count());
1769 bool copy_executable) {
1771 for (
auto &instance : instances) {
1772 if (instance.download_object_symbol_file) {
1773 if (instance.download_object_symbol_file(module_spec,
error, force_lookup,
1785 for (
auto &instance : instances) {
1786 if (instance.find_symbol_file_in_bundle) {
1787 std::optional<FileSpec> result =
1788 instance.find_symbol_file_in_bundle(symfile_bundle, uuid, arch);
1822 llvm::StringRef name, llvm::StringRef description,
1827 name, description, create_callback_from_bundle,
1828 create_callback_for_live_process, schema, debugger_init_callback);
1834 create_callback_from_bundle);
1844 llvm::StringRef plugin_name) {
1846 return instance->create_callback_for_live_process;
1853 return instance->schema;
1854 return llvm::StringRef();
1859 return instance->schema;
1860 return llvm::StringRef();
1863#pragma mark TraceExporter
1887 llvm::StringRef name, llvm::StringRef description,
1891 name, description, create_callback, create_thread_trace_export_command);
1904llvm::SmallVector<TraceExporterCallbacks>
1907 llvm::SmallVector<TraceExporterCallbacks> result;
1908 result.reserve(instances.size());
1909 for (
auto &instance : instances)
1910 result.push_back({instance.name, instance.create_callback,
1911 instance.create_thread_trace_export_command});
1915#pragma mark UnwindAssembly
1926 llvm::StringRef name, llvm::StringRef description,
1937llvm::SmallVector<UnwindAssemblyCreateInstance>
1942#pragma mark MemoryHistory
1953 llvm::StringRef name, llvm::StringRef description,
1964llvm::SmallVector<MemoryHistoryCreateInstance>
1969#pragma mark InstrumentationRuntime
1988 bool enabled_only) {
1990 return instance->get_type_callback;
2001 llvm::StringRef name, llvm::StringRef description,
2005 name, description, create_callback, get_type_callback);
2013llvm::SmallVector<InstrumentationRuntimeCallbacks>
2017 llvm::SmallVector<InstrumentationRuntimeCallbacks> result;
2018 result.reserve(instances.size());
2019 for (
auto &instance : instances)
2020 result.push_back({instance.create_callback, instance.get_type_callback});
2024#pragma mark TypeSystem
2050 llvm::StringRef name, llvm::StringRef description,
2056 name, description, create_callback, supported_languages_for_types,
2057 supported_languages_for_expressions, debugger_init_callback);
2064llvm::SmallVector<TypeSystemCreateInstance>
2072 for (
unsigned i = 0; i < instances.size(); ++i)
2073 all.
bitvector |= instances[i].supported_languages_for_types.bitvector;
2080 for (
unsigned i = 0; i < instances.size(); ++i)
2081 all.
bitvector |= instances[i].supported_languages_for_expressions.bitvector;
2085#pragma mark ScriptedInterfaces
2095 llvm::StringRef name, llvm::StringRef description,
2100 name, description, create_callback, extension, language, usages);
2124 return instance->extension;
2131 return instance->language;
2138 return instance->usages;
2145 llvm::SmallSet<lldb::ScriptedExtension, 16> emitted;
2151 instance->language != language)
2153 if (emitted.insert(instance->extension).second)
2154 callback(*instance);
2163 llvm::StringLiteral extension_name =
2165 if (extension_name.starts_with(name))
2190 llvm::StringRef description,
2194 supported_languages);
2203 llvm::SmallVector<REPLCallbacks> result;
2204 result.reserve(instances.size());
2205 for (
auto &instance : instances)
2206 result.push_back({instance.create_callback, instance.supported_languages});
2213 for (
unsigned i = 0; i < instances.size(); ++i)
2214 all.
bitvector |= instances[i].supported_languages.bitvector;
2218#pragma mark Highlighter
2235 llvm::StringRef description,
2246llvm::SmallVector<HighlighterCreateInstance>
2251#pragma mark PluginManager
2273 Debugger &debugger, llvm::StringRef plugin_type_name,
2274 llvm::StringRef plugin_type_desc,
bool can_create) {
2277 if (parent_properties_sp) {
2278 static constexpr llvm::StringLiteral g_property_name(
"plugin");
2281 parent_properties_sp->GetSubProperty(
nullptr, g_property_name);
2282 if (!plugin_properties_sp && can_create) {
2283 plugin_properties_sp =
2284 std::make_shared<OptionValueProperties>(g_property_name);
2285 plugin_properties_sp->SetExpectedPath(
"plugin");
2286 parent_properties_sp->AppendProperty(g_property_name,
2287 "Settings specify to plugins.",
true,
2288 plugin_properties_sp);
2291 if (plugin_properties_sp) {
2293 plugin_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
2294 if (!plugin_type_properties_sp && can_create) {
2295 plugin_type_properties_sp =
2296 std::make_shared<OptionValueProperties>(plugin_type_name);
2297 plugin_type_properties_sp->SetExpectedPath(
2298 (
"plugin." + plugin_type_name).str());
2299 plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
2300 true, plugin_type_properties_sp);
2302 return plugin_type_properties_sp;
2312 Debugger &debugger, llvm::StringRef plugin_type_name,
2313 llvm::StringRef plugin_type_desc,
bool can_create) {
2314 static constexpr llvm::StringLiteral g_property_name(
"plugin");
2317 if (parent_properties_sp) {
2319 parent_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
2320 if (!plugin_properties_sp && can_create) {
2321 plugin_properties_sp =
2322 std::make_shared<OptionValueProperties>(plugin_type_name);
2323 plugin_properties_sp->SetExpectedPath(plugin_type_name.str());
2324 parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
2325 true, plugin_properties_sp);
2328 if (plugin_properties_sp) {
2330 plugin_properties_sp->GetSubProperty(
nullptr, g_property_name);
2331 if (!plugin_type_properties_sp && can_create) {
2332 plugin_type_properties_sp =
2333 std::make_shared<OptionValueProperties>(g_property_name);
2334 plugin_type_properties_sp->SetExpectedPath(
2335 (plugin_type_name +
".plugin").str());
2336 plugin_properties_sp->AppendProperty(g_property_name,
2337 "Settings specific to plugins",
2338 true, plugin_type_properties_sp);
2340 return plugin_type_properties_sp;
2349GetDebuggerPropertyForPluginsPtr(
Debugger &, llvm::StringRef, llvm::StringRef,
2355 llvm::StringRef plugin_type_name,
2356 GetDebuggerPropertyForPluginsPtr get_debugger_property =
2360 debugger, plugin_type_name,
2363 if (plugin_type_properties_sp)
2365 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
2366 return properties_sp;
2371 llvm::StringRef plugin_type_desc,
2373 llvm::StringRef description,
bool is_global_property,
2374 GetDebuggerPropertyForPluginsPtr get_debugger_property =
2376 if (properties_sp) {
2378 get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
2380 if (plugin_type_properties_sp) {
2381 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
2382 description, is_global_property,
2398static constexpr llvm::StringLiteral
2404 llvm::StringRef setting_name) {
2410 llvm::StringRef description,
bool is_global_property) {
2412 "Settings for dynamic loader plug-ins",
2413 properties_sp, description, is_global_property);
2418 llvm::StringRef setting_name) {
2425 llvm::StringRef description,
bool is_global_property) {
2427 "Settings for platform plug-ins", properties_sp,
2428 description, is_global_property,
2434 llvm::StringRef setting_name) {
2440 llvm::StringRef description,
bool is_global_property) {
2442 "Settings for process plug-ins", properties_sp,
2443 description, is_global_property);
2448 llvm::StringRef setting_name) {
2454 llvm::StringRef description,
bool is_global_property) {
2456 "Settings for symbol locator plug-ins",
2457 properties_sp, description, is_global_property);
2462 llvm::StringRef description,
bool is_global_property) {
2464 "Settings for trace plug-ins", properties_sp,
2465 description, is_global_property);
2470 llvm::StringRef setting_name) {
2476 llvm::StringRef description,
bool is_global_property) {
2478 "Settings for object file plug-ins",
2479 properties_sp, description, is_global_property);
2484 llvm::StringRef setting_name) {
2490 llvm::StringRef description,
bool is_global_property) {
2492 "Settings for symbol file plug-ins",
2493 properties_sp, description, is_global_property);
2498 llvm::StringRef setting_name) {
2504 llvm::StringRef description,
bool is_global_property) {
2506 "Settings for JIT loader plug-ins",
2507 properties_sp, description, is_global_property);
2513 Debugger &debugger, llvm::StringRef setting_name) {
2520 if (plugin_type_properties_sp)
2522 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
2523 return properties_sp;
2528 llvm::StringRef description,
bool is_global_property) {
2529 if (properties_sp) {
2532 "Settings for operating system plug-ins",
2534 if (plugin_type_properties_sp) {
2535 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
2536 description, is_global_property,
2546 llvm::StringRef setting_name) {
2552 llvm::StringRef description,
bool is_global_property) {
2554 "Settings for structured data plug-ins",
2555 properties_sp, description, is_global_property);
2560 Debugger &debugger, llvm::StringRef setting_name) {
2566 llvm::StringRef description,
bool is_global_property) {
2568 "Settings for CPlusPlus language plug-ins",
2569 properties_sp, description, is_global_property);
2582llvm::SmallVector<RegisteredPluginInfo>
2591llvm::SmallVector<RegisteredPluginInfo>
2600llvm::SmallVector<RegisteredPluginInfo>
2609llvm::SmallVector<RegisteredPluginInfo>
2618llvm::SmallVector<RegisteredPluginInfo>
2627llvm::SmallVector<RegisteredPluginInfo>
2641 llvm_unreachable(
"unhandled PluginDomainKind");
2645 llvm::StringRef name,
bool enable,
Debugger &requesting_debugger,
2648 return llvm::createStringErrorV(
"{} domain is not supported",
2651 return llvm::createStringError(
"plugin could not be found");
2653 return llvm::Error::success();
2656llvm::SmallVector<RegisteredPluginInfo>
2673llvm::SmallVector<RegisteredPluginInfo>
2682llvm::SmallVector<RegisteredPluginInfo>
2691llvm::SmallVector<RegisteredPluginInfo>
2700llvm::SmallVector<RegisteredPluginInfo>
2709llvm::SmallVector<RegisteredPluginInfo>
2740llvm::SmallVector<RegisteredPluginInfo>
2749llvm::SmallVector<RegisteredPluginInfo>
2758llvm::SmallVector<RegisteredPluginInfo>
2767llvm::SmallVector<RegisteredPluginInfo>
2776llvm::SmallVector<RegisteredPluginInfo>
2785llvm::SmallVector<RegisteredPluginInfo>
2794llvm::SmallVector<RegisteredPluginInfo>
2803llvm::SmallVector<RegisteredPluginInfo>
2819llvm::SmallVector<RegisteredPluginInfo>
2828llvm::SmallVector<RegisteredPluginInfo>
2837llvm::SmallVector<RegisteredPluginInfo>
2851 llvm::StringRef ns_name, plugin_prefix;
2852 std::tie(ns_name, plugin_prefix) = name.split(
'.');
2860 if (plugin_ns.name == ns_name) {
2862 llvm::SmallString<128> buf;
2863 if (
plugin.name.starts_with(plugin_prefix))
2865 (plugin_ns.name +
"." +
plugin.name).toStringRef(buf));
2867 }
else if (plugin_ns.name.starts_with(name) &&
2868 !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 ScriptInterpreterErrors & GetScriptInterpreterErrors()
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
static void ClearScriptInterpreterErrors()
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 void ForEachScriptedExtension(llvm::function_ref< void(const ScriptedInterfaceInstance &)> callback, lldb::ScriptLanguage language=lldb::eScriptLanguageUnknown)
Invoke callback once per registered scripted extension, passing the first interface registered for it...
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 void SetScriptInterpreterError(lldb::ScriptLanguage script_lang, llvm::Error error)
Records why no script interpreter for script_lang could be registered, for the fallback interpreter t...
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 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 size_t GetNumScriptedInterfaces()
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::Error GetScriptInterpreterError(lldb::ScriptLanguage script_lang)
Returns the error recorded for script_lang, or success.
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::ScriptInterpreterSP(* ScriptInterpreterCreateInstance)(Debugger &debugger, lldb::ScriptLanguage language)
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::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
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
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
TypeSystemInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, LanguageSet supported_languages_for_types, LanguageSet supported_languages_for_expressions, DebuggerInitializeCallback debugger_init_callback)
LanguageSet supported_languages_for_types
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
llvm::SmallBitVector bitvector
LanguageRuntimeCreateInstance CallbackType
llvm::StringRef description
DebuggerInitializeCallback debugger_init_callback
LanguageRuntimeCreateInstance create_callback
lldb::ScriptedExtension extension