================ @@ -464,6 +466,24 @@ llvm::json::Value DebuggerStats::ReportStatistics( } } + if (include_plugins) { + json::Object plugin_stats; + for (const PluginNamespace &plugin_ns : + PluginManager::GetPluginNamespaces()) { + json::Array namespace_stats; + + for (const RegisteredPluginInfo &plugin : plugin_ns.get_info()) { + json::Object plugin_json; + plugin_json.try_emplace("name", plugin.name); + plugin_json.try_emplace("enabled", plugin.enabled); + + namespace_stats.emplace_back(std::move(plugin_json)); + } + plugin_stats.try_emplace(plugin_ns.name, std::move(namespace_stats)); + } + global_stats.try_emplace("plugins", std::move(plugin_stats)); + } + ---------------- dmpots wrote:
Moved the code to the PluginManager and added support for `plugin list --json` on the command line. https://github.com/llvm/llvm-project/pull/134418 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits