22#include "llvm/ADT/SmallSet.h"
23#include "llvm/ADT/StringRef.h"
24#include "llvm/ADT/Twine.h"
25#include "llvm/Support/DynamicLibrary.h"
26#include "llvm/Support/ErrorExtras.h"
27#include "llvm/Support/FileSystem.h"
28#include "llvm/Support/raw_ostream.h"
58 library = std::move(other.library);
83enum class PluginLifecycle { Uninitialized, Initialized, Terminated };
85struct PluginRegistry {
86 std::recursive_mutex mutex;
90 std::lock_guard<std::recursive_mutex> guard(mutex);
91 lifecycle = PluginLifecycle::Initialized;
95 std::lock_guard<std::recursive_mutex> guard(mutex);
96 lifecycle = PluginLifecycle::Terminated;
103 bool IsTerminated()
const {
return lifecycle == PluginLifecycle::Terminated; }
106 PluginLifecycle lifecycle = PluginLifecycle::Uninitialized;
117 static PluginRegistry *g_registry =
new PluginRegistry();
136 assert(!plugin_map.contains(plugin_file_spec));
137 plugin_map.try_emplace(plugin_file_spec, std::move(plugin_info));
140template <
typename FPtrTy>
static FPtrTy
CastToFPtr(
void *VPtr) {
141 return reinterpret_cast<FPtrTy
>(VPtr);
169 plugin_info.
library = llvm::sys::DynamicLibrary::getPermanentLibrary(
171 if (!plugin_info.
library.isValid())
172 return llvm::createStringError(
error);
179 llvm::StringRef plugin_name = file_name.substr(
g_plugin_prefix.size());
180 std::string init_symbol =
181 llvm::Twine(
"lldb_initialize_" + plugin_name).str();
184 plugin_info.
library.getAddressOfSymbol(init_symbol.c_str()))) {
186 return llvm::createStringErrorV(
"initializer '{0}' returned false",
188 const std::string term_symbol =
189 llvm::Twine(
"lldb_terminate_" + plugin_name).str();
191 plugin_info.
library.getAddressOfSymbol(term_symbol.c_str()));
198 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginInitialize"))) {
200 return llvm::createStringError(
201 "initializer 'LLDBPluginInitialize' returned false");
205 plugin_info.
library.getAddressOfSymbol(
"LLDBPluginTerminate"));
209 return llvm::createStringError(
"no initialize symbol found");
214 llvm::StringRef path) {
215 namespace fs = llvm::sys::fs;
217 static constexpr std::array<llvm::StringLiteral, 3>
218 g_shared_library_extension = {
".dylib",
".so",
".dll"};
224 if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||
225 ft == fs::file_type::type_unknown) {
230 if (!llvm::is_contained(g_shared_library_extension,
245 llvm::Expected<PluginInfo> plugin_info =
254 "could not load plugin: {0}");
260 if (ft == fs::file_type::directory_file ||
261 ft == fs::file_type::symlink_file || ft == fs::file_type::type_unknown) {
275 static const bool find_directories =
true;
276 static const bool find_files =
true;
277 static const bool find_other =
true;
283 const std::array<PluginDir, 3> plugin_dirs = {
288 for (
const PluginDir &plugin_dir : plugin_dirs) {
291 plugin_dir.path.GetPath().c_str(), find_directories, find_files,
333 "emulate-instruction",
339 "instrumentation-runtime",
405 "register-type-builder",
411 "script-interpreter",
417 "scripted-interface",
477 return PluginNamespaces;
481 llvm::json::Object plugin_stats;
484 llvm::json::Array namespace_stats;
488 llvm::json::Object plugin_json;
489 plugin_json.try_emplace(
"name",
plugin.name);
490 plugin_json.try_emplace(
"enabled",
plugin.enabled);
491 namespace_stats.emplace_back(std::move(plugin_json));
494 if (!namespace_stats.empty())
495 plugin_stats.try_emplace(plugin_ns.name, std::move(namespace_stats));
509 if (pattern == plugin_ns.
name)
513 std::string qualified_name = (plugin_ns.
name +
"." + plugin_info.
name).str();
514 return pattern == qualified_name;
525 llvm::errs() << llvm::formatv(
"Use `image lookup -va {0:x}` to find out "
526 "which callback was not removed\n",
527 instance.create_callback);
529 assert(
m_instances.empty() &&
"forgot to unregister plugin?");
532 template <
typename...
Args>
534 typename Instance::CallbackType callback,
538 assert(!name.empty());
540 std::lock_guard<std::mutex> guard(
m_mutex);
541 m_instances.emplace_back(name, description, callback,
542 std::forward<Args>(args)...);
550 std::lock_guard<std::mutex> guard(
m_mutex);
553 for (; pos != end; ++pos) {
554 if (pos->create_callback == callback) {
564 return instance->description;
570 return instance->name;
576 return instance->create_callback;
581 llvm::SmallVector<Instance> snapshot =
GetSnapshot();
582 llvm::SmallVector<typename Instance::CallbackType> result;
583 result.reserve(snapshot.size());
584 for (
const auto &instance : snapshot)
585 result.push_back(instance.create_callback);
591 if (instance.debugger_init_callback)
592 instance.debugger_init_callback(debugger);
600 llvm::SmallVector<Instance>
GetSnapshot(
bool enabled_only =
true)
const {
601 std::lock_guard<std::mutex> guard(
m_mutex);
603 llvm::SmallVector<Instance> enabled_instances;
606 if (!enabled_only || instance.enabled)
607 enabled_instances.push_back(instance);
609 return enabled_instances;
616 [&](
const Instance &instance) {
return count++ == idx; });
620 bool enabled_only =
true) {
624 auto predicate = [&](
const Instance &instance) {
625 return instance.name == name;
633 std::optional<Instance>
636 if (predicate(instance))
642 std::optional<Instance>
644 std::lock_guard<std::mutex> guard(
m_mutex);
646 if (predicate(instance))
657 std::lock_guard<std::mutex> guard(
m_mutex);
660 llvm::SmallVector<RegisteredPluginInfo> plugin_infos;
664 plugin_infos.push_back(
665 {instance.name, instance.description, instance.enabled});
671 std::lock_guard<std::mutex> guard(
m_mutex);
672 auto it = llvm::find_if(
m_instances, [&](
const Instance &instance) {
673 return instance.name == name;
679 it->enabled = enable;
699 llvm::StringRef description,
712#pragma mark Architecture
723 llvm::StringRef description,
731 instances.UnregisterPlugin(create_callback);
734std::unique_ptr<Architecture>
737 if (
auto plugin_up = instances.create_callback(arch))
743#pragma mark BugReporter
754 llvm::StringRef description,
764std::unique_ptr<BugReporter>
767 if (
auto create_callback =
769 return create_callback();
773 if (
auto plugin_up = instance.create_callback())
779#pragma mark Disassembler
790 llvm::StringRef description,
801llvm::SmallVector<DisassemblerCreateInstance>
808 llvm::StringRef name) {
812#pragma mark DynamicLoader
823 llvm::StringRef name, llvm::StringRef description,
827 name, description, create_callback, debugger_init_callback);
835llvm::SmallVector<DynamicLoaderCreateInstance>
842 llvm::StringRef name) {
846#pragma mark JITLoader
857 llvm::StringRef name, llvm::StringRef description,
861 name, description, create_callback, debugger_init_callback);
868llvm::SmallVector<JITLoaderCreateInstance>
873#pragma mark EmulateInstruction
885 llvm::StringRef name, llvm::StringRef description,
896llvm::SmallVector<EmulateInstructionCreateInstance>
903 llvm::StringRef name) {
907#pragma mark OperatingSystem
918 llvm::StringRef name, llvm::StringRef description,
922 name, description, create_callback, debugger_init_callback);
930llvm::SmallVector<OperatingSystemCreateInstance>
937 llvm::StringRef name) {
952 llvm::StringRef name, llvm::StringRef description,
956 name, description, create_callback, debugger_init_callback);
963llvm::SmallVector<LanguageCreateInstance>
968#pragma mark LanguageRuntime
995 llvm::StringRef name, llvm::StringRef description,
1000 name, description, create_callback,
nullptr, command_callback,
1001 precondition_callback);
1009llvm::SmallVector<LanguageRuntimeCallbacks>
1012 llvm::SmallVector<LanguageRuntimeCallbacks> result;
1013 result.reserve(instances.size());
1014 for (
auto &instance : instances)
1015 result.push_back({instance.create_callback, instance.command_callback,
1016 instance.precondition_callback});
1020#pragma mark SystemRuntime
1031 llvm::StringRef name, llvm::StringRef description,
1042llvm::SmallVector<SystemRuntimeCreateInstance>
1047#pragma mark ObjectFile
1082 llvm::StringRef name, llvm::StringRef description,
1089 name, description, create_callback, create_memory_callback,
1090 get_module_specifications, save_core, debugger_init_callback);
1099 llvm::SmallVector<ObjectFileCallbacks> result;
1100 result.reserve(instances.size());
1101 for (
auto &instance : instances)
1102 result.push_back({instance.create_callback, instance.create_memory_callback,
1103 instance.get_module_specifications, instance.save_core});
1109 llvm::StringRef name) {
1111 return instance->create_memory_callback;
1133 llvm::Expected<bool> ret =
1142 const auto &plugin_name = options.
GetPluginName().value_or(
"");
1144 for (
auto &instance : instances) {
1145 if (plugin_name.empty() || instance.name == plugin_name) {
1148 if (instance.save_core &&
1160 if (!plugin_name.empty())
1162 "The \"{}\" plugin is not able to save a core for this process.",
1166 "no ObjectFile plugins were able to save a core for this process");
1170 llvm::SmallVector<llvm::StringRef> plugin_names;
1172 for (
auto &instance : instances) {
1173 if (instance.save_core)
1174 plugin_names.emplace_back(instance.name);
1176 return plugin_names;
1179#pragma mark ObjectContainer
1204 llvm::StringRef name, llvm::StringRef description,
1209 name, description, create_callback, create_memory_callback,
1210 get_module_specifications);
1218llvm::SmallVector<ObjectContainerCallbacks>
1221 llvm::SmallVector<ObjectContainerCallbacks> result;
1222 result.reserve(instances.size());
1223 for (
auto &instance : instances)
1224 result.push_back({instance.create_callback, instance.create_memory_callback,
1225 instance.get_module_specifications});
1229#pragma mark Platform
1236 return g_platform_instances;
1240 llvm::StringRef name, llvm::StringRef description,
1244 name, description, create_callback, debugger_init_callback);
1265llvm::SmallVector<PlatformCreateInstance>
1273 if (instance.name.starts_with(name))
1289 llvm::StringRef name, llvm::StringRef description,
1293 name, description, create_callback, debugger_init_callback);
1314llvm::SmallVector<ProcessCreateInstance>
1322 if (instance.name.starts_with(name))
1327#pragma mark ProtocolServer
1338 llvm::StringRef name, llvm::StringRef description,
1359#pragma mark RegisterTypeBuilder
1369typedef PluginInstances<RegisterTypeBuilderInstance>
1378 llvm::StringRef name, llvm::StringRef description,
1395 return instance->create_callback(target);
1398#pragma mark ScriptInterpreter
1422 llvm::StringRef name, llvm::StringRef description,
1427 name, description, create_callback, script_language, get_path_callback);
1435llvm::SmallVector<ScriptInterpreterCreateInstance>
1445 for (
const auto &instance : instances) {
1447 none_instance = instance.create_callback;
1449 if (script_lang == instance.language)
1450 return instance.create_callback(debugger);
1454 assert(none_instance !=
nullptr);
1455 return none_instance(debugger);
1461 for (
const auto &instance : instances) {
1462 if (instance.language == script_lang && instance.get_path_callback)
1463 return instance.get_path_callback();
1468#pragma mark SyntheticFrameProvider
1490 llvm::StringRef name, llvm::StringRef description,
1493 if (create_native_callback)
1495 name, description, create_native_callback);
1496 else if (create_scripted_callback)
1498 name, description, create_scripted_callback);
1514 llvm::StringRef name) {
1518llvm::SmallVector<ScriptedFrameProviderCreateInstance>
1523#pragma mark StructuredDataPlugin
1548 llvm::StringRef name, llvm::StringRef description,
1553 name, description, create_callback, debugger_init_callback,
1562llvm::SmallVector<StructuredDataPluginCallbacks>
1565 llvm::SmallVector<StructuredDataPluginCallbacks> result;
1566 result.reserve(instances.size());
1567 for (
auto &instance : instances)
1568 result.push_back({instance.create_callback, instance.filter_callback});
1572#pragma mark SymbolFile
1583 llvm::StringRef name, llvm::StringRef description,
1587 name, description, create_callback, debugger_init_callback);
1594llvm::SmallVector<SymbolFileCreateInstance>
1599#pragma mark SymbolVendor
1610 llvm::StringRef description,
1621llvm::SmallVector<SymbolVendorCreateInstance>
1626#pragma mark SymbolLocator
1658 llvm::StringRef name, llvm::StringRef description,
1666 name, description, create_callback, locate_executable_object_file,
1667 locate_executable_symbol_file, download_object_symbol_file,
1668 find_symbol_file_in_bundle, debugger_init_callback);
1676llvm::SmallVector<SymbolLocatorCreateInstance>
1685 for (
auto &instance : instances) {
1686 if (instance.locate_executable_object_file) {
1688 std::optional<ModuleSpec> result;
1691 result = instance.locate_executable_object_file(module_spec);
1693 map.
add(instance.name, time.
get().count());
1705 for (
auto &instance : instances) {
1706 if (instance.locate_executable_symbol_file) {
1708 std::optional<FileSpec> result;
1711 result = instance.locate_executable_symbol_file(module_spec,
1712 default_search_paths);
1714 map.
add(instance.name, time.
get().count());
1725 bool copy_executable) {
1727 for (
auto &instance : instances) {
1728 if (instance.download_object_symbol_file) {
1729 if (instance.download_object_symbol_file(module_spec,
error, force_lookup,
1741 for (
auto &instance : instances) {
1742 if (instance.find_symbol_file_in_bundle) {
1743 std::optional<FileSpec> result =
1744 instance.find_symbol_file_in_bundle(symfile_bundle, uuid, arch);
1778 llvm::StringRef name, llvm::StringRef description,
1783 name, description, create_callback_from_bundle,
1784 create_callback_for_live_process, schema, debugger_init_callback);
1790 create_callback_from_bundle);
1800 llvm::StringRef plugin_name) {
1802 return instance->create_callback_for_live_process;
1809 return instance->schema;
1810 return llvm::StringRef();
1815 return instance->schema;
1816 return llvm::StringRef();
1819#pragma mark TraceExporter
1843 llvm::StringRef name, llvm::StringRef description,
1847 name, description, create_callback, create_thread_trace_export_command);
1860llvm::SmallVector<TraceExporterCallbacks>
1863 llvm::SmallVector<TraceExporterCallbacks> result;
1864 result.reserve(instances.size());
1865 for (
auto &instance : instances)
1866 result.push_back({instance.name, instance.create_callback,
1867 instance.create_thread_trace_export_command});
1871#pragma mark UnwindAssembly
1882 llvm::StringRef name, llvm::StringRef description,
1893llvm::SmallVector<UnwindAssemblyCreateInstance>
1898#pragma mark MemoryHistory
1909 llvm::StringRef name, llvm::StringRef description,
1920llvm::SmallVector<MemoryHistoryCreateInstance>
1925#pragma mark InstrumentationRuntime
1944 bool enabled_only) {
1946 return instance->get_type_callback;
1957 llvm::StringRef name, llvm::StringRef description,
1961 name, description, create_callback, get_type_callback);
1969llvm::SmallVector<InstrumentationRuntimeCallbacks>
1973 llvm::SmallVector<InstrumentationRuntimeCallbacks> result;
1974 result.reserve(instances.size());
1975 for (
auto &instance : instances)
1976 result.push_back({instance.create_callback, instance.get_type_callback});
1980#pragma mark TypeSystem
2006 llvm::StringRef name, llvm::StringRef description,
2012 name, description, create_callback, supported_languages_for_types,
2013 supported_languages_for_expressions, debugger_init_callback);
2020llvm::SmallVector<TypeSystemCreateInstance>
2028 for (
unsigned i = 0; i < instances.size(); ++i)
2029 all.
bitvector |= instances[i].supported_languages_for_types.bitvector;
2036 for (
unsigned i = 0; i < instances.size(); ++i)
2037 all.
bitvector |= instances[i].supported_languages_for_expressions.bitvector;
2041#pragma mark ScriptedInterfaces
2051 llvm::StringRef name, llvm::StringRef description,
2056 name, description, create_callback, extension, language, usages);
2080 return instance->extension;
2087 return instance->language;
2094 return instance->usages;
2101 llvm::SmallSet<lldb::ScriptedExtension, 16> emitted;
2107 instance->language != language)
2109 if (emitted.insert(instance->extension).second)
2110 callback(*instance);
2119 llvm::StringLiteral extension_name =
2121 if (extension_name.starts_with(name))
2146 llvm::StringRef description,
2150 supported_languages);
2159 llvm::SmallVector<REPLCallbacks> result;
2160 result.reserve(instances.size());
2161 for (
auto &instance : instances)
2162 result.push_back({instance.create_callback, instance.supported_languages});
2169 for (
unsigned i = 0; i < instances.size(); ++i)
2170 all.
bitvector |= instances[i].supported_languages.bitvector;
2174#pragma mark Highlighter
2191 llvm::StringRef description,
2202llvm::SmallVector<HighlighterCreateInstance>
2207#pragma mark PluginManager
2229 Debugger &debugger, llvm::StringRef plugin_type_name,
2230 llvm::StringRef plugin_type_desc,
bool can_create) {
2233 if (parent_properties_sp) {
2234 static constexpr llvm::StringLiteral g_property_name(
"plugin");
2237 parent_properties_sp->GetSubProperty(
nullptr, g_property_name);
2238 if (!plugin_properties_sp && can_create) {
2239 plugin_properties_sp =
2240 std::make_shared<OptionValueProperties>(g_property_name);
2241 plugin_properties_sp->SetExpectedPath(
"plugin");
2242 parent_properties_sp->AppendProperty(g_property_name,
2243 "Settings specify to plugins.",
true,
2244 plugin_properties_sp);
2247 if (plugin_properties_sp) {
2249 plugin_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
2250 if (!plugin_type_properties_sp && can_create) {
2251 plugin_type_properties_sp =
2252 std::make_shared<OptionValueProperties>(plugin_type_name);
2253 plugin_type_properties_sp->SetExpectedPath(
2254 (
"plugin." + plugin_type_name).str());
2255 plugin_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
2256 true, plugin_type_properties_sp);
2258 return plugin_type_properties_sp;
2268 Debugger &debugger, llvm::StringRef plugin_type_name,
2269 llvm::StringRef plugin_type_desc,
bool can_create) {
2270 static constexpr llvm::StringLiteral g_property_name(
"plugin");
2273 if (parent_properties_sp) {
2275 parent_properties_sp->GetSubProperty(
nullptr, plugin_type_name);
2276 if (!plugin_properties_sp && can_create) {
2277 plugin_properties_sp =
2278 std::make_shared<OptionValueProperties>(plugin_type_name);
2279 plugin_properties_sp->SetExpectedPath(plugin_type_name.str());
2280 parent_properties_sp->AppendProperty(plugin_type_name, plugin_type_desc,
2281 true, plugin_properties_sp);
2284 if (plugin_properties_sp) {
2286 plugin_properties_sp->GetSubProperty(
nullptr, g_property_name);
2287 if (!plugin_type_properties_sp && can_create) {
2288 plugin_type_properties_sp =
2289 std::make_shared<OptionValueProperties>(g_property_name);
2290 plugin_type_properties_sp->SetExpectedPath(
2291 (plugin_type_name +
".plugin").str());
2292 plugin_properties_sp->AppendProperty(g_property_name,
2293 "Settings specific to plugins",
2294 true, plugin_type_properties_sp);
2296 return plugin_type_properties_sp;
2305GetDebuggerPropertyForPluginsPtr(
Debugger &, llvm::StringRef, llvm::StringRef,
2311 llvm::StringRef plugin_type_name,
2312 GetDebuggerPropertyForPluginsPtr get_debugger_property =
2316 debugger, plugin_type_name,
2319 if (plugin_type_properties_sp)
2321 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
2322 return properties_sp;
2327 llvm::StringRef plugin_type_desc,
2329 llvm::StringRef description,
bool is_global_property,
2330 GetDebuggerPropertyForPluginsPtr get_debugger_property =
2332 if (properties_sp) {
2334 get_debugger_property(debugger, plugin_type_name, plugin_type_desc,
2336 if (plugin_type_properties_sp) {
2337 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
2338 description, is_global_property,
2354static constexpr llvm::StringLiteral
2360 llvm::StringRef setting_name) {
2366 llvm::StringRef description,
bool is_global_property) {
2368 "Settings for dynamic loader plug-ins",
2369 properties_sp, description, is_global_property);
2374 llvm::StringRef setting_name) {
2381 llvm::StringRef description,
bool is_global_property) {
2383 "Settings for platform plug-ins", properties_sp,
2384 description, is_global_property,
2390 llvm::StringRef setting_name) {
2396 llvm::StringRef description,
bool is_global_property) {
2398 "Settings for process plug-ins", properties_sp,
2399 description, is_global_property);
2404 llvm::StringRef setting_name) {
2410 llvm::StringRef description,
bool is_global_property) {
2412 "Settings for symbol locator plug-ins",
2413 properties_sp, description, is_global_property);
2418 llvm::StringRef description,
bool is_global_property) {
2420 "Settings for trace plug-ins", properties_sp,
2421 description, is_global_property);
2426 llvm::StringRef setting_name) {
2432 llvm::StringRef description,
bool is_global_property) {
2434 "Settings for object file plug-ins",
2435 properties_sp, description, is_global_property);
2440 llvm::StringRef setting_name) {
2446 llvm::StringRef description,
bool is_global_property) {
2448 "Settings for symbol file plug-ins",
2449 properties_sp, description, is_global_property);
2454 llvm::StringRef setting_name) {
2460 llvm::StringRef description,
bool is_global_property) {
2462 "Settings for JIT loader plug-ins",
2463 properties_sp, description, is_global_property);
2469 Debugger &debugger, llvm::StringRef setting_name) {
2476 if (plugin_type_properties_sp)
2478 plugin_type_properties_sp->GetSubProperty(
nullptr, setting_name);
2479 return properties_sp;
2484 llvm::StringRef description,
bool is_global_property) {
2485 if (properties_sp) {
2488 "Settings for operating system plug-ins",
2490 if (plugin_type_properties_sp) {
2491 plugin_type_properties_sp->AppendProperty(properties_sp->GetName(),
2492 description, is_global_property,
2502 llvm::StringRef setting_name) {
2508 llvm::StringRef description,
bool is_global_property) {
2510 "Settings for structured data plug-ins",
2511 properties_sp, description, is_global_property);
2516 Debugger &debugger, llvm::StringRef setting_name) {
2522 llvm::StringRef description,
bool is_global_property) {
2524 "Settings for CPlusPlus language plug-ins",
2525 properties_sp, description, is_global_property);
2538llvm::SmallVector<RegisteredPluginInfo>
2547llvm::SmallVector<RegisteredPluginInfo>
2556llvm::SmallVector<RegisteredPluginInfo>
2565llvm::SmallVector<RegisteredPluginInfo>
2574llvm::SmallVector<RegisteredPluginInfo>
2583llvm::SmallVector<RegisteredPluginInfo>
2597 llvm_unreachable(
"unhandled PluginDomainKind");
2601 llvm::StringRef name,
bool enable,
Debugger &requesting_debugger,
2604 return llvm::createStringErrorV(
"{} domain is not supported",
2607 return llvm::createStringError(
"plugin could not be found");
2609 return llvm::Error::success();
2612llvm::SmallVector<RegisteredPluginInfo>
2629llvm::SmallVector<RegisteredPluginInfo>
2638llvm::SmallVector<RegisteredPluginInfo>
2647llvm::SmallVector<RegisteredPluginInfo>
2656llvm::SmallVector<RegisteredPluginInfo>
2665llvm::SmallVector<RegisteredPluginInfo>
2696llvm::SmallVector<RegisteredPluginInfo>
2705llvm::SmallVector<RegisteredPluginInfo>
2714llvm::SmallVector<RegisteredPluginInfo>
2723llvm::SmallVector<RegisteredPluginInfo>
2732llvm::SmallVector<RegisteredPluginInfo>
2741llvm::SmallVector<RegisteredPluginInfo>
2750llvm::SmallVector<RegisteredPluginInfo>
2759llvm::SmallVector<RegisteredPluginInfo>
2775llvm::SmallVector<RegisteredPluginInfo>
2784llvm::SmallVector<RegisteredPluginInfo>
2793llvm::SmallVector<RegisteredPluginInfo>
2807 llvm::StringRef ns_name, plugin_prefix;
2808 std::tie(ns_name, plugin_prefix) = name.split(
'.');
2816 if (plugin_ns.name == ns_name) {
2818 llvm::SmallString<128> buf;
2819 if (
plugin.name.starts_with(plugin_prefix))
2821 (plugin_ns.name +
"." +
plugin.name).toStringRef(buf));
2823 }
else if (plugin_ns.name.starts_with(name) &&
2824 !plugin_ns.get_info().empty()) {
static llvm::raw_ostream & error(Stream &strm)
static FileSystem::EnumerateDirectoryResult LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft, llvm::StringRef path)
#define LLDB_LOG_ERROR(log, error,...)
static BugReporterInstances & GetBugReporterInstances()
static DisassemblerInstances & GetDisassemblerInstances()
PluginInstances< ProtocolServerInstance > ProtocolServerInstances
static TraceInstances & GetTracePluginInstances()
static ObjectContainerInstances & GetObjectContainerInstances()
PluginInstances< JITLoaderInstance > JITLoaderInstances
static MemoryHistoryInstances & GetMemoryHistoryInstances()
PluginInstance< PlatformCreateInstance > PlatformInstance
PluginInstances< HighlighterInstance > HighlighterInstances
static DynamicLoaderInstances & GetDynamicLoaderInstances()
PluginInstances< SymbolFileInstance > SymbolFileInstances
PluginInstances< TypeSystemInstance > TypeSystemInstances
PluginInstance< ABICreateInstance > ABIInstance
static SystemRuntimeInstances & GetSystemRuntimeInstances()
PluginInstances< TraceExporterInstance > TraceExporterInstances
static constexpr llvm::StringLiteral kPlatformPluginName("platform")
static constexpr llvm::StringLiteral g_plugin_prefix
PluginInstance< EmulateInstructionCreateInstance > EmulateInstructionInstance
static ABIInstances & GetABIInstances()
static constexpr llvm::StringLiteral kProcessPluginName("process")
PluginInstances< SymbolVendorInstance > SymbolVendorInstances
static constexpr llvm::StringLiteral kDynamicLoaderPluginName("dynamic-loader")
static lldb::OptionValuePropertiesSP GetSettingForPlugin(Debugger &debugger, llvm::StringRef setting_name, llvm::StringRef plugin_type_name, GetDebuggerPropertyForPluginsPtr get_debugger_property=GetDebuggerPropertyForPlugins)
static ScriptInterpreterInstances & GetScriptInterpreterInstances()
PluginInstance< DynamicLoaderCreateInstance > DynamicLoaderInstance
PluginInstances< PlatformInstance > PlatformInstances
PluginInstance< JITLoaderCreateInstance > JITLoaderInstance
PluginInstance< ArchitectureCreateInstance > ArchitectureInstance
static constexpr llvm::StringLiteral kCPlusPlusLanguagePlugin("cplusplus")
PluginInstances< SystemRuntimeInstance > SystemRuntimeInstances
static TraceExporterInstances & GetTraceExporterInstances()
PluginInstance< LanguageCreateInstance > LanguageInstance
PluginInstances< BugReporterInstance > BugReporterInstances
PluginInstance< SymbolFileCreateInstance > SymbolFileInstance
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPlugins(Debugger &debugger, llvm::StringRef plugin_type_name, llvm::StringRef plugin_type_desc, bool can_create)
static constexpr llvm::StringLiteral kSymbolLocatorPluginName("symbol-locator")
PluginInstances< ObjectFileInstance > ObjectFileInstances
void(* PluginTermCallback)()
static StructuredDataPluginInstances & GetStructuredDataPluginInstances()
static constexpr llvm::StringLiteral kObjectFilePluginName("object-file")
PluginInstances< MemoryHistoryInstance > MemoryHistoryInstances
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPluginsOldStyle(Debugger &debugger, llvm::StringRef plugin_type_name, llvm::StringRef plugin_type_desc, bool can_create)
PluginInstances< DynamicLoaderInstance > DynamicLoaderInstances
PluginInstances< LanguageInstance > LanguageInstances
PluginInstances< TraceInstance > TraceInstances
PluginInstances< ArchitectureInstance > ArchitectureInstances
PluginInstances< StructuredDataPluginInstance > StructuredDataPluginInstances
static constexpr llvm::StringLiteral kStructuredDataPluginName("structured-data")
PluginInstance< MemoryHistoryCreateInstance > MemoryHistoryInstance
static const char * kOperatingSystemPluginName("os")
static SymbolLocatorInstances & GetSymbolLocatorInstances()
PluginInstance< ProtocolServerCreateInstance > ProtocolServerInstance
PluginInstance< OperatingSystemCreateInstance > OperatingSystemInstance
static ObjectFileInstances & GetObjectFileInstances()
static constexpr llvm::StringLiteral kSymbolFilePluginName("symbol-file")
PluginInstances< SymbolLocatorInstance > SymbolLocatorInstances
PluginInstance< SystemRuntimeCreateInstance > SystemRuntimeInstance
PluginInstance< SymbolVendorCreateInstance > SymbolVendorInstance
static EmulateInstructionInstances & GetEmulateInstructionInstances()
PluginInstance< UnwindAssemblyCreateInstance > UnwindAssemblyInstance
static LanguageInstances & GetLanguageInstances()
static constexpr llvm::StringLiteral kJITLoaderPluginName("jit-loader")
static ScriptedFrameProviderInstances & GetScriptedFrameProviderInstances()
PluginInstances< OperatingSystemInstance > OperatingSystemInstances
static LanguageRuntimeInstances & GetLanguageRuntimeInstances()
PluginInstances< LanguageRuntimeInstance > LanguageRuntimeInstances
static InstrumentationRuntimeInstances & GetInstrumentationRuntimeInstances()
PluginInstances< ProcessInstance > ProcessInstances
PluginInstances< SyntheticFrameProviderInstance > SyntheticFrameProviderInstances
PluginInstances< REPLInstance > REPLInstances
static ArchitectureInstances & GetArchitectureInstances()
static DynamicPluginMap & GetPluginMap()
PluginInstances< ScriptedFrameProviderInstance > ScriptedFrameProviderInstances
PluginInstance< BugReporterCreateInstance > BugReporterInstance
static PluginRegistry & GetPluginRegistry()
static RegisterTypeBuilderInstances & GetRegisterTypeBuilderInstances()
static std::recursive_mutex & GetPluginMapMutex()
llvm::SmallDenseMap< FileSpec, PluginInfo > DynamicPluginMap
static HighlighterInstances & GetHighlighterInstances()
static TypeSystemInstances & GetTypeSystemInstances()
static PlatformInstances & GetPlatformInstances()
static ScriptedInterfaceInstances & GetScriptedInterfaceInstances()
static FileSystem::EnumerateDirectoryResult LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft, llvm::StringRef path)
PluginInstances< EmulateInstructionInstance > EmulateInstructionInstances
PluginInstance< SyntheticFrameProviderCreateInstance > SyntheticFrameProviderInstance
static JITLoaderInstances & GetJITLoaderInstances()
PluginInstances< DisassemblerInstance > DisassemblerInstances
PluginInstance< ProcessCreateInstance > ProcessInstance
static UnwindAssemblyInstances & GetUnwindAssemblyInstances()
static void SetPluginInfo(const FileSpec &plugin_file_spec, PluginInfo plugin_info)
PluginInstances< ScriptedInterfaceInstance > ScriptedInterfaceInstances
PluginInstances< UnwindAssemblyInstance > UnwindAssemblyInstances
static SymbolFileInstances & GetSymbolFileInstances()
static bool CreateSettingForPlugin(Debugger &debugger, llvm::StringRef plugin_type_name, llvm::StringRef plugin_type_desc, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property, GetDebuggerPropertyForPluginsPtr get_debugger_property=GetDebuggerPropertyForPlugins)
PluginInstances< ABIInstance > ABIInstances
static FPtrTy CastToFPtr(void *VPtr)
static ProcessInstances & GetProcessInstances()
static bool PluginIsLoaded(const FileSpec &plugin_file_spec)
static OperatingSystemInstances & GetOperatingSystemInstances()
static constexpr llvm::StringLiteral kTracePluginName("trace")
PluginInstance< ScriptedFrameProviderCreateInstance > ScriptedFrameProviderInstance
PluginInstances< ScriptInterpreterInstance > ScriptInterpreterInstances
static SyntheticFrameProviderInstances & GetSyntheticFrameProviderInstances()
bool(* PluginInitCallback)()
PluginInstance< DisassemblerCreateInstance > DisassemblerInstance
static SymbolVendorInstances & GetSymbolVendorInstances()
PluginInstances< ObjectContainerInstance > ObjectContainerInstances
static ProtocolServerInstances & GetProtocolServerInstances()
PluginInstances< RegisterTypeBuilderInstance > RegisterTypeBuilderInstances
static REPLInstances & GetREPLInstances()
static double elapsed(const StatsTimepoint &start, const StatsTimepoint &end)
bool UnregisterPlugin(typename Instance::CallbackType callback)
std::optional< ABIInstance > FindInstance(std::function< bool(const ABIInstance &)> predicate) const
llvm::StringRef GetNameAtIndex(uint32_t idx)
llvm::SmallVector< ABIInstance > m_instances
llvm::StringRef GetDescriptionAtIndex(uint32_t idx)
llvm::SmallVector< typename Instance::CallbackType > GetCreateCallbacks()
std::optional< ABIInstance > GetInstanceAtIndex(uint32_t idx)
llvm::SmallVector< RegisteredPluginInfo > GetPluginInfoForAllInstances()
Instance::CallbackType GetCallbackForName(llvm::StringRef name)
llvm::SmallVector< ABIInstance > GetSnapshot(bool enabled_only=true) const
bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, typename Instance::CallbackType callback, Args &&...args)
void PerformDebuggerCallback(Debugger &debugger)
std::optional< ABIInstance > FindEnabledInstance(std::function< bool(const ABIInstance &)> predicate) const
std::optional< ABIInstance > GetInstanceForName(llvm::StringRef name, bool enabled_only=true)
bool SetInstanceEnabled(llvm::StringRef name, bool enable)
An architecture specification class.
A command line argument class.
"lldb/Utility/ArgCompletionRequest.h"
void AddCompletion(llvm::StringRef completion, llvm::StringRef description="", CompletionMode mode=CompletionMode::Normal)
Adds a possible completion string.
A class to manage flag bits.
A class that measures elapsed time in an exception safe way.
llvm::StringRef GetFileNameStrippingExtension() const
Return the filename without the extension part.
llvm::StringRef GetFilename() const
Filename string const get accessor.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
llvm::StringRef GetFileNameExtension() const
Extract the extension of the file.
void EnumerateDirectory(llvm::Twine path, bool find_directories, bool find_files, bool find_other, EnumerateDirectoryCallbackType callback, void *callback_baton)
@ eEnumerateDirectoryResultEnter
Recurse into the current entry if it is a directory or symlink, or next if not.
@ eEnumerateDirectoryResultNext
Enumerate next entry in the current directory.
bool Exists(const FileSpec &file_spec) const
Returns whether the given file exists.
static FileSystem & Instance()
void Resolve(llvm::SmallVectorImpl< char > &path, bool force_make_absolute=false)
Resolve path to make it canonical.
static bool SetArchitecturePluginEnabled(llvm::StringRef name, bool enable)
static llvm::StringRef GetPlatformPluginDescriptionAtIndex(uint32_t idx)
static bool SetPlatformPluginEnabled(llvm::StringRef name, bool enable)
static bool SetScriptInterpreterPluginEnabled(llvm::StringRef name, bool enable)
static bool MatchPluginName(llvm::StringRef pattern, const PluginNamespace &plugin_ns, const RegisteredPluginInfo &plugin)
static lldb::OptionValuePropertiesSP GetSettingForStructuredDataPlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool SetMemoryHistoryPluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< RegisteredPluginInfo > GetSystemRuntimePluginInfo()
static llvm::SmallVector< RegisteredPluginInfo > GetTypeSystemPluginInfo()
static void AutoCompleteScriptedExtension(llvm::StringRef partial_name, CompletionRequest &request, lldb::ScriptLanguage language=lldb::eScriptLanguageUnknown)
static bool CreateSettingForJITLoaderPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static bool SetRegisterTypeBuilderPluginEnabled(llvm::StringRef name, bool enable)
static llvm::StringRef PluginDomainKindToStr(lldb::PluginDomainKind kind)
static bool SetTraceExporterPluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< RegisteredPluginInfo > GetArchitecturePluginInfo()
static 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 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::SmallVector< SystemRuntimeCreateInstance > GetSystemRuntimeCreateCallbacks()
static FileSpec GetScriptInterpreterLibraryPath(lldb::ScriptLanguage script_lang)
static bool UnregisterPlugin(ABICreateInstance create_callback)
static FileSpec FindSymbolFileInBundle(const FileSpec &dsym_bundle_fspec, const UUID *uuid, const ArchSpec *arch)
static llvm::SmallVector< RegisteredPluginInfo > GetStructuredDataPluginInfo()
static bool SetSymbolLocatorPluginEnabled(llvm::StringRef name, bool enable)
static ProtocolServerCreateInstance GetProtocolCreateCallbackForPluginName(llvm::StringRef name)
static llvm::SmallVector< LanguageCreateInstance > GetLanguageCreateCallbacks()
static std::unique_ptr< BugReporter > CreateBugReporterInstance(llvm::StringRef name={})
static llvm::SmallVector< DynamicLoaderCreateInstance > GetDynamicLoaderCreateCallbacks()
static lldb::RegisterTypeBuilderSP GetRegisterTypeBuilder(Target &target)
static llvm::SmallVector< MemoryHistoryCreateInstance > GetMemoryHistoryCreateCallbacks()
static ScriptedInterfaceUsages GetScriptedInterfaceUsagesAtIndex(uint32_t idx)
static ObjectFileCreateMemoryInstance GetObjectFileCreateMemoryCallbackForPluginName(llvm::StringRef name)
static bool CreateSettingForSymbolLocatorPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static llvm::SmallVector< RegisteredPluginInfo > GetJITLoaderPluginInfo()
static bool SetObjectFilePluginEnabled(llvm::StringRef name, bool enable)
static llvm::SmallVector< PlatformCreateInstance > GetPlatformCreateCallbacks()
lldb::OptionValuePropertiesSP GetValueProperties() const
const std::optional< lldb_private::FileSpec > GetOutputFile() const
Status EnsureValidConfiguration() const
std::optional< std::string > GetPluginName() const
lldb::ProcessSP GetProcess() const
static llvm::StringLiteral ExtensionToString(lldb::ScriptedExtension extension)
A class to count time for plugins.
void add(llvm::StringRef key, double value)
static Status FromErrorString(const char *str)
static Status static Status FromErrorStringWithFormatv(const char *format, Args &&...args)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
Represents UUID's of various sizes.
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
SymbolVendor *(* SymbolVendorCreateInstance)(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm)
bool(* ObjectFileSaveCore)(const lldb::ProcessSP &process_sp, lldb_private::SaveCoreOptions &options, Status &error)
llvm::Expected< lldb::TraceSP >(* TraceCreateInstanceForLiveProcess)(Process &process)
FileSpec(* ScriptInterpreterGetPath)()
lldb::RegisterTypeBuilderSP(* RegisterTypeBuilderCreateInstance)(Target &target)
lldb::ProtocolServerUP(* ProtocolServerCreateInstance)()
LanguageRuntime *(* LanguageRuntimeCreateInstance)(Process *process, lldb::LanguageType language)
lldb::InstrumentationRuntimeType(* InstrumentationRuntimeGetType)()
llvm::Expected< lldb::TraceSP >(* TraceCreateInstanceFromBundle)(const llvm::json::Value &trace_bundle_description, llvm::StringRef session_file_dir, lldb_private::Debugger &debugger)
Trace.
lldb::DisassemblerSP(* DisassemblerCreateInstance)(const ArchSpec &arch, const char *flavor, const char *cpu, const char *features)
std::optional< FileSpec >(* SymbolLocatorLocateExecutableSymbolFile)(const ModuleSpec &module_spec, const FileSpecList &default_search_paths)
EmulateInstruction *(* EmulateInstructionCreateInstance)(const ArchSpec &arch, InstructionType inst_type)
ObjectContainer *(* ObjectContainerCreateMemoryInstance)(const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t offset)
void(* DebuggerInitializeCallback)(Debugger &debugger)
std::unique_ptr< Architecture >(* ArchitectureCreateInstance)(const ArchSpec &arch)
lldb::ScriptInterpreterSP(* ScriptInterpreterCreateInstance)(Debugger &debugger)
lldb::PlatformSP(* PlatformCreateInstance)(bool force, const ArchSpec *arch)
bool(* ScriptedInterfaceCreateInstance)(lldb::ScriptLanguage language, ScriptedInterfaceUsages usages)
SystemRuntime *(* SystemRuntimeCreateInstance)(Process *process)
lldb::ProcessSP(* ProcessCreateInstance)(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec *crash_file_path, bool can_connect)
UnwindAssembly *(* UnwindAssemblyCreateInstance)(const ArchSpec &arch)
lldb::TypeSystemSP(* TypeSystemCreateInstance)(lldb::LanguageType language, Module *module, Target *target)
lldb::BreakpointPreconditionSP(* LanguageRuntimeGetExceptionPrecondition)(lldb::LanguageType language, bool throw_bp)
ObjectContainer *(* ObjectContainerCreateInstance)(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, const FileSpec *file, lldb::offset_t offset, lldb::offset_t length)
lldb::MemoryHistorySP(* MemoryHistoryCreateInstance)(const lldb::ProcessSP &process_sp)
ObjectFile *(* ObjectFileCreateMemoryInstance)(const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t offset)
SymbolLocator *(* SymbolLocatorCreateInstance)()
std::unique_ptr< BugReporter >(* BugReporterCreateInstance)()
std::optional< ModuleSpec >(* SymbolLocatorLocateExecutableObjectFile)(const ModuleSpec &module_spec)
@ Partial
The current token has been partially completed.
lldb::CommandObjectSP(* LanguageRuntimeGetCommandObject)(CommandInterpreter &interpreter)
DynamicLoader *(* DynamicLoaderCreateInstance)(Process *process, bool force)
lldb::StructuredDataPluginSP(* StructuredDataPluginCreateInstance)(Process &process)
lldb::JITLoaderSP(* JITLoaderCreateInstance)(Process *process, bool force)
llvm::Expected< lldb::SyntheticFrameProviderSP >(* SyntheticFrameProviderCreateInstance)(lldb::StackFrameListSP input_frames, const std::vector< lldb_private::ThreadSpec > &thread_specs)
OperatingSystem *(* OperatingSystemCreateInstance)(Process *process, bool force)
lldb::REPLSP(* REPLCreateInstance)(Status &error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options)
SymbolFile *(* SymbolFileCreateInstance)(lldb::ObjectFileSP objfile_sp)
llvm::Expected< lldb::TraceExporterUP >(* TraceExporterCreateInstance)()
Highlighter *(* HighlighterCreateInstance)(lldb::LanguageType language)
std::optional< FileSpec >(* SymbolLocatorFindSymbolFileInBundle)(const FileSpec &dsym_bundle_fspec, const UUID *uuid, const ArchSpec *arch)
bool(* SymbolLocatorDownloadObjectAndSymbolFile)(ModuleSpec &module_spec, Status &error, bool force_lookup, bool copy_executable)
Language *(* LanguageCreateInstance)(lldb::LanguageType language)
Status(* StructuredDataFilterLaunchInfo)(ProcessLaunchInfo &launch_info, Target *target)
ObjectFile *(* ObjectFileCreateInstance)(const lldb::ModuleSP &module_sp, lldb::DataExtractorSP extractor_sp, lldb::offset_t data_offset, const FileSpec *file, lldb::offset_t file_offset, lldb::offset_t length)
ModuleSpecList(* ObjectFileGetModuleSpecifications)(const FileSpec &file, lldb::DataExtractorSP &extractor_sp, lldb::offset_t file_offset, lldb::offset_t length)
lldb::ABISP(* ABICreateInstance)(lldb::ProcessSP process_sp, const ArchSpec &arch)
llvm::Expected< lldb::SyntheticFrameProviderSP >(* ScriptedFrameProviderCreateInstance)(lldb::StackFrameListSP input_frames, const lldb_private::ScriptedFrameProviderDescriptor &descriptor)
lldb::CommandObjectSP(* ThreadTraceExportCommandCreator)(CommandInterpreter &interpreter)
lldb::InstrumentationRuntimeSP(* InstrumentationRuntimeCreateInstance)(const lldb::ProcessSP &process_sp)
ScriptLanguage
Script interpreter types.
std::shared_ptr< lldb_private::OptionValueProperties > OptionValuePropertiesSP
ScriptedExtension
Scripting extension types.
@ eScriptedExtensionInvalid
std::shared_ptr< lldb_private::ScriptInterpreter > ScriptInterpreterSP
@ ePluginDomainKindTarget
@ ePluginDomainKindGlobal
@ ePluginDomainKindDebugger
std::shared_ptr< lldb_private::RegisterTypeBuilder > RegisterTypeBuilderSP
HighlighterInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback)
InstrumentationRuntimeGetType get_type_callback
InstrumentationRuntimeInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, InstrumentationRuntimeGetType get_type_callback)
InstrumentationRuntimeGetType GetTypeCallbackForName(llvm::StringRef name, bool enabled_only)
LanguageRuntimeGetExceptionPrecondition precondition_callback
LanguageRuntimeInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, DebuggerInitializeCallback debugger_init_callback, LanguageRuntimeGetCommandObject command_callback, LanguageRuntimeGetExceptionPrecondition precondition_callback)
LanguageRuntimeGetCommandObject command_callback
ObjectFileGetModuleSpecifications get_module_specifications
ObjectContainerInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, ObjectContainerCreateMemoryInstance create_memory_callback, ObjectFileGetModuleSpecifications get_module_specifications)
ObjectContainerCreateMemoryInstance create_memory_callback
ObjectFileCreateMemoryInstance create_memory_callback
ObjectFileGetModuleSpecifications get_module_specifications
ObjectFileInstance(llvm::StringRef name, llvm::StringRef description, CallbackType create_callback, ObjectFileCreateMemoryInstance create_memory_callback, ObjectFileGetModuleSpecifications get_module_specifications, ObjectFileSaveCore save_core, DebuggerInitializeCallback debugger_init_callback)
ObjectFileSaveCore save_core
PluginDir(FileSpec path, LoadPolicy policy)
const LoadPolicy policy
Filter when looking for plugins.
const FileSpec path
The path to the plugin directory.
@ LoadOnlyWithLLDBPrefix
Only load shared libraries who's filename start with g_plugin_prefix.
@ LoadAnyDylib
Try to load anything that looks like a shared library.
PluginTermCallback plugin_term_callback
llvm::sys::DynamicLibrary library
PluginInfo & operator=(PluginInfo &&other)
PluginInitCallback plugin_init_callback
PluginInfo(const PluginInfo &)=delete
PluginInfo(PluginInfo &&other)
static llvm::Expected< PluginInfo > Create(const FileSpec &path)
PluginInfo & operator=(const PluginInfo &)=delete
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