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"
60 library = std::move(other.library);
85enum class PluginLifecycle { Uninitialized, Initialized, Terminated };
87struct PluginRegistry {
88 std::recursive_mutex mutex;
92 std::lock_guard<std::recursive_mutex> guard(mutex);
93 lifecycle = PluginLifecycle::Initialized;
97 std::lock_guard<std::recursive_mutex> guard(mutex);
98 lifecycle = PluginLifecycle::Terminated;
105 bool IsTerminated()
const {
return lifecycle == PluginLifecycle::Terminated; }
108 PluginLifecycle lifecycle = PluginLifecycle::Uninitialized;
119 static PluginRegistry *g_registry =
new PluginRegistry();
138 assert(!plugin_map.contains(plugin_file_spec));
139 plugin_map.try_emplace(plugin_file_spec, std::move(plugin_info));
142template <
typename FPtrTy>
static FPtrTy
CastToFPtr(
void *VPtr) {
143 return reinterpret_cast<FPtrTy
>(VPtr);
171 plugin_info.
library = llvm::sys::DynamicLibrary::getPermanentLibrary(
173 if (!plugin_info.
library.isValid())
174 return llvm::createStringError(
error);
181 llvm::StringRef plugin_name = file_name.substr(
g_plugin_prefix.size());
182 std::string init_symbol =
183 llvm::Twine(
"lldb_initialize_" + plugin_name).str();
186 plugin_info.
library.getAddressOfSymbol(init_symbol.c_str()))) {
188 return llvm::createStringErrorV(
"initializer '{0}' returned false",
190 const std::string term_symbol =
191 llvm::Twine(
"lldb_terminate_" + plugin_name).str();
193 plugin_info.
library.getAddressOfSymbol(term_symbol.c_str()));
200 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginInitialize"))) {
202 return llvm::createStringError(
203 "initializer 'LLDBPluginInitialize' returned false");
207 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginTerminate"));
211 return llvm::createStringError(
"no initialize symbol found");
216 llvm::StringRef path) {
217 namespace fs = llvm::sys::fs;
219 static constexpr std::array<llvm::StringLiteral, 3>
220 g_shared_library_extension = {
".dylib",
".so",
".dll"};
226 if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||
227 ft == fs::file_type::type_unknown) {
232 if (!llvm::is_contained(g_shared_library_extension,
247 llvm::Expected<PluginInfo> plugin_info =
256 "could not load plugin: {0}");
262 if (ft == fs::file_type::directory_file ||
263 ft == fs::file_type::symlink_file || ft == fs::file_type::type_unknown) {
277 static const bool find_directories =
true;
278 static const bool find_files =
true;
279 static const bool find_other =
true;
285 const std::array<PluginDir, 3> plugin_dirs = {
290 for (
const PluginDir &plugin_dir : plugin_dirs) {
293 plugin_dir.path.GetPath().c_str(), find_directories, find_files,
340 "emulate-instruction",
346 "instrumentation-runtime",
412 "register-type-builder",
418 "script-interpreter",
424 "scripted-interface",
484 return PluginNamespaces;
488 llvm::json::Object plugin_stats;
491 llvm::json::Array namespace_stats;
495 llvm::json::Object plugin_json;
496 plugin_json.try_emplace(
"name",
plugin.name);
497 plugin_json.try_emplace(
"enabled",
plugin.enabled);
498 namespace_stats.emplace_back(std::move(plugin_json));
501 if (!namespace_stats.empty())
502 plugin_stats.try_emplace(plugin_ns.name, std::move(namespace_stats));
516 if (pattern == plugin_ns.
name)
520 std::string qualified_name = (plugin_ns.
name +
"." + plugin_info.
name).str();
521 return pattern == qualified_name;
532 llvm::errs() << llvm::formatv(
"Use `image lookup -va {0:x}` to find out "
533 "which callback was not removed\n",
534 instance.create_callback);
536 assert(
m_instances.empty() &&
"forgot to unregister plugin?");
539 template <
typename...
Args>
541 typename Instance::CallbackType callback,
545 assert(!name.empty());
547 std::lock_guard<std::mutex> guard(
m_mutex);
548 m_instances.emplace_back(name, description, callback,
549 std::forward<Args>(args)...);
557 std::lock_guard<std::mutex> guard(
m_mutex);
560 for (; pos != end; ++pos) {
561 if (pos->create_callback == callback) {
571 return instance->description;
577 return instance->name;
583 return instance->create_callback;
588 llvm::SmallVector<Instance> snapshot =
GetSnapshot();
589 llvm::SmallVector<typename Instance::CallbackType> result;
590 result.reserve(snapshot.size());
591 for (
const auto &instance : snapshot)
592 result.push_back(instance.create_callback);
598 if (instance.debugger_init_callback)
599 instance.debugger_init_callback(debugger);
607 llvm::SmallVector<Instance>
GetSnapshot(
bool enabled_only =
true)
const {
608 std::lock_guard<std::mutex> guard(
m_mutex);
610 llvm::SmallVector<Instance> enabled_instances;
613 if (!enabled_only || instance.enabled)
614 enabled_instances.push_back(instance);
616 return enabled_instances;
623 [&](
const Instance &instance) {
return count++ == idx; });
627 bool enabled_only =
true) {
631 auto predicate = [&](
const Instance &instance) {
632 return instance.name == name;
640 std::optional<Instance>
643 if (predicate(instance))
649 std::optional<Instance>
651 std::lock_guard<std::mutex> guard(
m_mutex);
653 if (predicate(instance))
664 std::lock_guard<std::mutex> guard(
m_mutex);
667 llvm::SmallVector<RegisteredPluginInfo> plugin_infos;
671 plugin_infos.push_back(
672 {instance.name, instance.description, instance.enabled});
678 std::lock_guard<std::mutex> guard(
m_mutex);
679 auto it = llvm::find_if(
m_instances, [&](
const Instance &instance) {
680 return instance.name == name;
686 it->enabled = enable;
706 llvm::StringRef description,
719#pragma mark Architecture
730 llvm::StringRef description,
738 instances.UnregisterPlugin(create_callback);
741std::unique_ptr<Architecture>
744 if (
auto plugin_up = instances.create_callback(arch))
750#pragma mark BugReporter
761 llvm::StringRef description,
771std::unique_ptr<BugReporter>
774 if (
auto create_callback =
776 return create_callback();
780 if (
auto plugin_up = instance.create_callback())
786#pragma mark Disassembler
797 llvm::StringRef description,
808llvm::SmallVector<DisassemblerCreateInstance>
815 llvm::StringRef name) {
819#pragma mark DynamicLoader
830 llvm::StringRef name, llvm::StringRef description,
834 name, description, create_callback, debugger_init_callback);
842llvm::SmallVector<DynamicLoaderCreateInstance>
849 llvm::StringRef name) {
853#pragma mark JITLoader
864 llvm::StringRef name, llvm::StringRef description,
868 name, description, create_callback, debugger_init_callback);
875llvm::SmallVector<JITLoaderCreateInstance>
880#pragma mark EmulateInstruction
892 llvm::StringRef name, llvm::StringRef description,
903llvm::SmallVector<EmulateInstructionCreateInstance>
910 llvm::StringRef name) {
914#pragma mark OperatingSystem
925 llvm::StringRef name, llvm::StringRef description,
929 name, description, create_callback, debugger_init_callback);
937llvm::SmallVector<OperatingSystemCreateInstance>
944 llvm::StringRef name) {
961class LanguageInstanceCache {
964 std::lock_guard<std::mutex> guard(m_mutex);
968 std::vector<Language *> GetAll() {
969 std::lock_guard<std::mutex> guard(m_mutex);
970 std::vector<Language *> instances;
974 instances.push_back(instance);
982 std::lock_guard<std::mutex> guard(m_mutex);
990 auto [active, inserted] = m_active.try_emplace(language,
nullptr);
992 return active->second;
995 auto [created, is_new] =
996 m_created.try_emplace({create_callback, language},
nullptr);
998 created->second = create_callback(language);
1000 return active->second = created->second;
1008 std::map<lldb::LanguageType, Language *> m_active;
1013 std::map<std::pair<LanguageCreateInstance, lldb::LanguageType>,
Language *>
1020 static LanguageInstanceCache *g_cache =
new LanguageInstanceCache();
1025 llvm::StringRef name, llvm::StringRef description,
1029 name, description, create_callback, debugger_init_callback);
1039 return unregistered;
1050#pragma mark LanguageRuntime
1077 llvm::StringRef name, llvm::StringRef description,
1082 name, description, create_callback,
nullptr, command_callback,
1083 precondition_callback);
1091llvm::SmallVector<LanguageRuntimeCallbacks>
1094 llvm::SmallVector<LanguageRuntimeCallbacks> result;
1095 result.reserve(instances.size());
1096 for (
auto &instance : instances)
1097 result.push_back({instance.create_callback, instance.command_callback,
1098 instance.precondition_callback});
1102#pragma mark SystemRuntime
1113 llvm::StringRef name, llvm::StringRef description,
1124llvm::SmallVector<SystemRuntimeCreateInstance>
1129#pragma mark ObjectFile
1164 llvm::StringRef name, llvm::StringRef description,
1171 name, description, create_callback, create_memory_callback,
1172 get_module_specifications, save_core, debugger_init_callback);
1181 llvm::SmallVector<ObjectFileCallbacks> result;
1182 result.reserve(instances.size());
1183 for (
auto &instance : instances)
1184 result.push_back({instance.create_callback, instance.create_memory_callback,
1185 instance.get_module_specifications, instance.save_core});
1191 llvm::StringRef name) {
1193 return instance->create_memory_callback;
1215 llvm::Expected<bool> ret =
1224 const auto &plugin_name = options.
GetPluginName().value_or(
"");
1226 for (
auto &instance : instances) {
1227 if (plugin_name.empty() || instance.name == plugin_name) {
1230 if (instance.save_core &&
1242 if (!plugin_name.empty())
1244 "The \"{}\" plugin is not able to save a core for this process.",
1248 "no ObjectFile plugins were able to save a core for this process");
1252 llvm::SmallVector<llvm::StringRef> plugin_names;
1254 for (
auto &instance : instances) {
1255 if (instance.save_core)
1256 plugin_names.emplace_back(instance.name);
1258 return plugin_names;
1261#pragma mark ObjectContainer
1286 llvm::StringRef name, llvm::StringRef description,
1291 name, description, create_callback, create_memory_callback,
1292 get_module_specifications);
1300llvm::SmallVector<ObjectContainerCallbacks>
1303 llvm::SmallVector<ObjectContainerCallbacks> result;
1304 result.reserve(instances.size());
1305 for (
auto &instance : instances)
1306 result.push_back({instance.create_callback, instance.create_memory_callback,
1307 instance.get_module_specifications});
1311#pragma mark Platform
1318 return g_platform_instances;
1322 llvm::StringRef name, llvm::StringRef description,
1326 name, description, create_callback, debugger_init_callback);
1347llvm::SmallVector<PlatformCreateInstance>
1355 if (instance.name.starts_with(name))
1371 llvm::StringRef name, llvm::StringRef description,
1375 name, description, create_callback, debugger_init_callback);
1396llvm::SmallVector<ProcessCreateInstance>
1404 if (instance.name.starts_with(name))
1409#pragma mark ProtocolServer
1420 llvm::StringRef name, llvm::StringRef description,
1441#pragma mark RegisterTypeBuilder
1451typedef PluginInstances<RegisterTypeBuilderInstance>
1460 llvm::StringRef name, llvm::StringRef description,
1477 return instance->create_callback(target);
1480#pragma mark ScriptInterpreter
1504 llvm::StringRef name, llvm::StringRef description,
1509 name, description, create_callback, script_language, get_path_callback);
1517llvm::SmallVector<ScriptInterpreterCreateInstance>
1527 for (
const auto &instance : instances) {
1529 none_instance = instance.create_callback;
1531 if (script_lang == instance.language)
1532 return instance.create_callback(debugger, script_lang);
1536 assert(none_instance !=
nullptr);
1537 return none_instance(debugger, script_lang);
1541struct ScriptInterpreterErrors {
1543 llvm::DenseMap<lldb::ScriptLanguage, Status> errors;
1548 static ScriptInterpreterErrors g_errors;
1554 std::lock_guard<std::mutex> guard(errors.mutex);
1555 errors.errors.clear();
1559 llvm::Error
error) {
1561 std::lock_guard<std::mutex> guard(errors.mutex);
1565 errors.errors.erase(script_lang);
1571 std::lock_guard<std::mutex> guard(errors.mutex);
1572 auto it = errors.errors.find(script_lang);
1573 if (it == errors.errors.end())
1574 return llvm::Error::success();
1575 return it->second.ToError();
1581 for (
const auto &instance : instances) {
1582 if (instance.language == script_lang && instance.get_path_callback)
1583 return instance.get_path_callback();
1588#pragma mark SyntheticFrameProvider
1610 llvm::StringRef name, llvm::StringRef description,
1613 if (create_native_callback)
1615 name, description, create_native_callback);
1616 else if (create_scripted_callback)
1618 name, description, create_scripted_callback);
1634 llvm::StringRef name) {
1638llvm::SmallVector<ScriptedFrameProviderCreateInstance>
1643#pragma mark StructuredDataPlugin
1668 llvm::StringRef name, llvm::StringRef description,
1673 name, description, create_callback, debugger_init_callback,
1682llvm::SmallVector<StructuredDataPluginCallbacks>
1685 llvm::SmallVector<StructuredDataPluginCallbacks> result;
1686 result.reserve(instances.size());
1687 for (
auto &instance : instances)
1688 result.push_back({instance.create_callback, instance.filter_callback});
1692#pragma mark SymbolFile
1703 llvm::StringRef name, llvm::StringRef description,
1707 name, description, create_callback, debugger_init_callback);
1714llvm::SmallVector<SymbolFileCreateInstance>
1719#pragma mark SymbolVendor
1730 llvm::StringRef description,
1741llvm::SmallVector<SymbolVendorCreateInstance>
1746#pragma mark SymbolLocator
1778 llvm::StringRef name, llvm::StringRef description,
1786 name, description, create_callback, locate_executable_object_file,
1787 locate_executable_symbol_file, download_object_symbol_file,
1788 find_symbol_file_in_bundle, debugger_init_callback);
1796llvm::SmallVector<SymbolLocatorCreateInstance>
1805 for (
auto &instance : instances) {
1806 if (instance.locate_executable_object_file) {
1808 std::optional<ModuleSpec> result;
1811 result = instance.locate_executable_object_file(module_spec);
1813 map.
add(instance.name, time.
get().count());
1825 for (
auto &instance : instances) {
1826 if (instance.locate_executable_symbol_file) {
1828 std::optional<FileSpec> result;
1831 result = instance.locate_executable_symbol_file(module_spec,
1832 default_search_paths);
1834 map.
add(instance.name, time.
get().count());
1845 bool copy_executable) {
1847 for (
auto &instance : instances) {
1848 if (instance.download_object_symbol_file) {
1849 if (instance.download_object_symbol_file(module_spec,
error, force_lookup,
1861 for (
auto &instance : instances) {
1862 if (instance.find_symbol_file_in_bundle) {
1863 std::optional<FileSpec> result =
1864 instance.find_symbol_file_in_bundle(symfile_bundle, uuid, arch);
1898 llvm::StringRef name, llvm::StringRef description,
1903 name, description, create_callback_from_bundle,
1904 create_callback_for_live_process, schema, debugger_init_callback);
1910 create_callback_from_bundle);
1920 llvm::StringRef plugin_name) {
1922 return instance->create_callback_for_live_process;
1929 return instance->schema;
1930 return llvm::StringRef();
1935 return instance->schema;
1936 return llvm::StringRef();
1939#pragma mark TraceExporter
1963 llvm::StringRef name, llvm::StringRef description,
1967 name, description, create_callback, create_thread_trace_export_command);
1980llvm::SmallVector<TraceExporterCallbacks>
1983 llvm::SmallVector<TraceExporterCallbacks> result;
1984 result.reserve(instances.size());
1985 for (
auto &instance : instances)
1986 result.push_back({instance.name, instance.create_callback,
1987 instance.create_thread_trace_export_command});
1991#pragma mark UnwindAssembly
2002 llvm::StringRef name, llvm::StringRef description,
2013llvm::SmallVector<UnwindAssemblyCreateInstance>
2018#pragma mark MemoryHistory
2029 llvm::StringRef name, llvm::StringRef description,
2040llvm::SmallVector<MemoryHistoryCreateInstance>
2045#pragma mark InstrumentationRuntime
2064 bool enabled_only) {
2066 return instance->get_type_callback;
2077 llvm::StringRef name, llvm::StringRef description,
2081 name, description, create_callback, get_type_callback);
2089llvm::SmallVector<InstrumentationRuntimeCallbacks>
2093 llvm::SmallVector<InstrumentationRuntimeCallbacks> result;
2094 result.reserve(instances.size());
2095 for (
auto &instance : instances)
2096 result.push_back({instance.create_callback, instance.get_type_callback});
2100#pragma mark TypeSystem
2126 llvm::StringRef name, llvm::StringRef description,
2132 name, description, create_callback, supported_languages_for_types,
2133 supported_languages_for_expressions, debugger_init_callback);
2140llvm::SmallVector<TypeSystemCreateInstance>
2148 for (
unsigned i = 0; i < instances.size(); ++i)
2149 all.
bitvector |= instances[i].supported_languages_for_types.bitvector;
2156 for (
unsigned i = 0; i < instances.size(); ++i)
2157 all.
bitvector |= instances[i].supported_languages_for_expressions.bitvector;
2161#pragma mark ScriptedInterfaces
2171 llvm::StringRef name, llvm::StringRef description,
2176 name, description, create_callback, extension, language, usages);
2200 return instance->extension;
2207 return instance->language;
2214 return instance->usages;
2221 llvm::SmallSet<lldb::ScriptedExtension, 16> emitted;
2227 instance->language != language)
2229 if (emitted.insert(instance->extension).second)
2230 callback(*instance);
2239 llvm::StringLiteral extension_name =
2241 if (extension_name.starts_with(name))
2266 llvm::StringRef description,
2270 supported_languages);
2279 llvm::SmallVector<REPLCallbacks> result;
2280 result.reserve(instances.size());
2281 for (
auto &instance : instances)
2282 result.push_back({instance.create_callback, instance.supported_languages});
2289 for (
unsigned i = 0; i < instances.size(); ++i)
2290 all.
bitvector |= instances[i].supported_languages.bitvector;
2294#pragma mark Highlighter
2311 llvm::StringRef description,
2322llvm::SmallVector<HighlighterCreateInstance>
2327#pragma mark PluginManager
2349 Debugger &debugger, llvm::StringRef plugin_type_name,
2350 llvm::StringRef plugin_type_desc,
bool can_create) {
2353 if (parent_properties_sp) {
2354 static constexpr llvm::StringLiteral g_property_name(
"plugin");
2357 parent_properties_sp->GetSubProperty(
nullptr, g_property_name);
2358 if (!plugin_properties_sp && can_create) {
2359 plugin_properties_sp =
2360 std::make_shared<OptionValueProperties>(g_property_name);
2361 plugin_properties_sp->SetExpectedPath(
"plugin");
2362 parent_properties_sp->AppendProperty(g_property_name,
2363 "Settings specify to plugins.",
true,
2364 plugin_properties_sp);
2367 if (plugin_properties_sp) {
2369 plugin_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
2370 if (!plugin_type_properties_sp && can_create) {
2371 plugin_type_properties_sp =
2372 std::make_shared<OptionValueProperties>(plugin_type_name);
2373 plugin_type_properties_sp->SetExpectedPath(
2374 (
"plugin." + plugin_type_name).str());
2375 plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
2376 true, plugin_type_properties_sp);
2378 return plugin_type_properties_sp;
2388 Debugger &debugger, llvm::StringRef plugin_type_name,
2389 llvm::StringRef plugin_type_desc,
bool can_create) {
2390 static constexpr llvm::StringLiteral g_property_name(
"plugin");
2393 if (parent_properties_sp) {
2395 parent_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
2396 if (!plugin_properties_sp && can_create) {
2397 plugin_properties_sp =
2398 std::make_shared<OptionValueProperties>(plugin_type_name);
2399 plugin_properties_sp->SetExpectedPath(plugin_type_name.str());
2400 parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
2401 true, plugin_properties_sp);
2404 if (plugin_properties_sp) {
2406 plugin_properties_sp->GetSubProperty(
nullptr, g_property_name);
2407 if (!plugin_type_properties_sp && can_create) {
2408 plugin_type_properties_sp =
2409 std::make_shared<OptionValueProperties>(g_property_name);
2410 plugin_type_properties_sp->SetExpectedPath(
2411 (plugin_type_name +
".plugin").str());
2412 plugin_properties_sp->AppendProperty(g_property_name,
2413 "Settings specific to plugins",
2414 true, plugin_type_properties_sp);
2416 return plugin_type_properties_sp;
2425GetDebuggerPropertyForPluginsPtr(
Debugger &, llvm::StringRef, llvm::StringRef,
2431 llvm::StringRef plugin_type_name,
2432 GetDebuggerPropertyForPluginsPtr get_debugger_property =
2436 debugger, plugin_type_name,
2439 if (plugin_type_properties_sp)
2441 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
2442 return properties_sp;
2447 llvm::StringRef plugin_type_desc,
2449 llvm::StringRef description,
bool is_global_property,
2450 GetDebuggerPropertyForPluginsPtr get_debugger_property =
2452 if (properties_sp) {
2454 get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
2456 if (plugin_type_properties_sp) {
2457 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
2458 description, is_global_property,
2474static constexpr llvm::StringLiteral
2480 llvm::StringRef setting_name) {
2486 llvm::StringRef description,
bool is_global_property) {
2488 "Settings for dynamic loader plug-ins",
2489 properties_sp, description, is_global_property);
2494 llvm::StringRef setting_name) {
2501 llvm::StringRef description,
bool is_global_property) {
2503 "Settings for platform plug-ins", properties_sp,
2504 description, is_global_property,
2510 llvm::StringRef setting_name) {
2516 llvm::StringRef description,
bool is_global_property) {
2518 "Settings for process plug-ins", properties_sp,
2519 description, is_global_property);
2524 llvm::StringRef setting_name) {
2530 llvm::StringRef description,
bool is_global_property) {
2532 "Settings for symbol locator plug-ins",
2533 properties_sp, description, is_global_property);
2538 llvm::StringRef description,
bool is_global_property) {
2540 "Settings for trace plug-ins", properties_sp,
2541 description, is_global_property);
2546 llvm::StringRef setting_name) {
2552 llvm::StringRef description,
bool is_global_property) {
2554 "Settings for object file plug-ins",
2555 properties_sp, description, is_global_property);
2560 llvm::StringRef setting_name) {
2566 llvm::StringRef description,
bool is_global_property) {
2568 "Settings for symbol file plug-ins",
2569 properties_sp, description, is_global_property);
2574 llvm::StringRef setting_name) {
2580 llvm::StringRef description,
bool is_global_property) {
2582 "Settings for JIT loader plug-ins",
2583 properties_sp, description, is_global_property);
2589 Debugger &debugger, llvm::StringRef setting_name) {
2596 if (plugin_type_properties_sp)
2598 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
2599 return properties_sp;
2604 llvm::StringRef description,
bool is_global_property) {
2605 if (properties_sp) {
2608 "Settings for operating system plug-ins",
2610 if (plugin_type_properties_sp) {
2611 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
2612 description, is_global_property,
2622 llvm::StringRef setting_name) {
2628 llvm::StringRef description,
bool is_global_property) {
2630 "Settings for structured data plug-ins",
2631 properties_sp, description, is_global_property);
2636 Debugger &debugger, llvm::StringRef setting_name) {
2642 llvm::StringRef description,
bool is_global_property) {
2644 "Settings for CPlusPlus language plug-ins",
2645 properties_sp, description, is_global_property);
2658llvm::SmallVector<RegisteredPluginInfo>
2667llvm::SmallVector<RegisteredPluginInfo>
2676llvm::SmallVector<RegisteredPluginInfo>
2685llvm::SmallVector<RegisteredPluginInfo>
2694llvm::SmallVector<RegisteredPluginInfo>
2703llvm::SmallVector<RegisteredPluginInfo>
2717 llvm_unreachable(
"unhandled PluginDomainKind");
2721 llvm::StringRef name,
bool enable,
Debugger &requesting_debugger,
2724 return llvm::createStringErrorV(
"{} domain is not supported",
2727 return llvm::createStringError(
"plugin could not be found");
2729 return llvm::Error::success();
2732llvm::SmallVector<RegisteredPluginInfo>
2752llvm::SmallVector<RegisteredPluginInfo>
2761llvm::SmallVector<RegisteredPluginInfo>
2770llvm::SmallVector<RegisteredPluginInfo>
2779llvm::SmallVector<RegisteredPluginInfo>
2788llvm::SmallVector<RegisteredPluginInfo>
2819llvm::SmallVector<RegisteredPluginInfo>
2828llvm::SmallVector<RegisteredPluginInfo>
2837llvm::SmallVector<RegisteredPluginInfo>
2846llvm::SmallVector<RegisteredPluginInfo>
2855llvm::SmallVector<RegisteredPluginInfo>
2864llvm::SmallVector<RegisteredPluginInfo>
2873llvm::SmallVector<RegisteredPluginInfo>
2882llvm::SmallVector<RegisteredPluginInfo>
2898llvm::SmallVector<RegisteredPluginInfo>
2907llvm::SmallVector<RegisteredPluginInfo>
2916llvm::SmallVector<RegisteredPluginInfo>
2930 llvm::StringRef ns_name, plugin_prefix;
2931 std::tie(ns_name, plugin_prefix) = name.split(
'.');
2939 if (plugin_ns.name == ns_name) {
2941 llvm::SmallString<128> buf;
2942 if (
plugin.name.starts_with(plugin_prefix))
2944 (plugin_ns.name +
"." +
plugin.name).toStringRef(buf));
2946 }
else if (plugin_ns.name.starts_with(name) &&
2947 !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 LanguageInstanceCache & GetLanguageInstanceCache()
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)
static std::optional< V > Lookup(StringMap< V > &map, StringRef k)
Helper functions for fetching data in maps and returning Optionals or pointers instead of iterators f...
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 Language * GetLanguageInstance(lldb::LanguageType language)
Returns the instance of the enabled language plugin that supports language, creating it on first use,...
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 std::vector< Language * > GetAllLanguageInstances()
Returns GetLanguageInstance() for every language type that an enabled language plugin supports,...
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 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
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
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