https://github.com/dmpots closed
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
https://github.com/clayborg approved this pull request.
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
@@ -46,12 +48,287 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
@@ -46,12 +48,287 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
@@ -181,6 +181,56 @@ void PluginManager::Terminate() {
plugin_map.clear();
}
+llvm::ArrayRef PluginManager::GetPluginNamespaces() {
+ // Currently supported set of plugin namespaces. This will be expanded
+ // over time.
+ static PluginNamespace PluginNamespaces[] = {
+
@@ -486,6 +544,12 @@ class PluginManager {
static InstrumentationRuntimeCreateInstance
GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx);
+ static std::vector
+ GetInstrumentationRuntimePluginInfo();
dmpots wrote:
The SystemRuntime functions
@@ -486,6 +544,12 @@ class PluginManager {
static InstrumentationRuntimeCreateInstance
GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx);
+ static std::vector
+ GetInstrumentationRuntimePluginInfo();
clayborg wrote:
Did the system runtime stu
@@ -181,6 +181,56 @@ void PluginManager::Terminate() {
plugin_map.clear();
}
+llvm::ArrayRef PluginManager::GetPluginNamespaces() {
+ // Currently supported set of plugin namespaces. This will be expanded
+ // over time.
+ static PluginNamespace PluginNamespaces[] = {
+
@@ -46,12 +48,287 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
@@ -46,12 +48,287 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
https://github.com/clayborg requested changes to this pull request.
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
https://github.com/dmpots edited
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
@@ -46,12 +48,255 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
@@ -46,12 +48,255 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
@@ -46,12 +48,255 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
https://github.com/dmpots updated
https://github.com/llvm/llvm-project/pull/134418
>From e240bda8fcea9db4d9c456929ba811feb8d4152b Mon Sep 17 00:00:00 2001
From: David Peixotto
Date: Tue, 11 Mar 2025 13:02:14 -0700
Subject: [PATCH 01/23] Add commands to list/enable/disable plugins
This commit a
@@ -0,0 +1,52 @@
+# This test validates the plugin list command.
+# Currently it works only for system-runtime plugins and we only have one
+# system runtime plugin so testing is a bit limited.
+#
+# Note that commands that return errors will stop running a script, so we
+# have n
@@ -46,12 +48,255 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
@@ -54,12 +57,67 @@ struct RegisteredPluginInfo {
bool enabled = false;
};
+// Define some data structures to describe known plugin "namespaces".
+// The PluginManager is organized into a series of static functions
+// that operate on different types of plugins. For example
@@ -46,12 +48,255 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
@@ -0,0 +1,52 @@
+# This test validates the plugin list command.
+# Currently it works only for system-runtime plugins and we only have one
+# system runtime plugin so testing is a bit limited.
+#
+# Note that commands that return errors will stop running a script, so we
+# have n
@@ -46,12 +48,255 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
@@ -46,12 +48,255 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
@@ -54,12 +57,67 @@ struct RegisteredPluginInfo {
bool enabled = false;
};
+// Define some data structures to describe known plugin "namespaces".
+// The PluginManager is organized into a series of static functions
+// that operate on different types of plugins. For example
https://github.com/clayborg requested changes to this pull request.
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
@@ -46,12 +49,206 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
https://github.com/dmpots updated
https://github.com/llvm/llvm-project/pull/134418
>From e240bda8fcea9db4d9c456929ba811feb8d4152b Mon Sep 17 00:00:00 2001
From: David Peixotto
Date: Tue, 11 Mar 2025 13:02:14 -0700
Subject: [PATCH 01/21] Add commands to list/enable/disable plugins
This commit a
@@ -46,12 +49,206 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
@@ -46,12 +49,206 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
@@ -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;
+
+
@@ -174,12 +174,21 @@ struct StatisticsOptions {
return !GetSummaryOnly();
}
+ void SetIncludePlugins(bool value) { m_include_plugins = value; }
+ bool GetIncludePlugins() const {
+if (m_include_plugins.has_value())
+ return m_include_plugins.value();
+//
https://github.com/dmpots updated
https://github.com/llvm/llvm-project/pull/134418
>From e240bda8fcea9db4d9c456929ba811feb8d4152b Mon Sep 17 00:00:00 2001
From: David Peixotto
Date: Tue, 11 Mar 2025 13:02:14 -0700
Subject: [PATCH 01/20] Add commands to list/enable/disable plugins
This commit a
@@ -46,12 +49,206 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
@@ -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;
+
+
@@ -46,12 +49,206 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
@@ -174,12 +174,21 @@ struct StatisticsOptions {
return !GetSummaryOnly();
}
+ void SetIncludePlugins(bool value) { m_include_plugins = value; }
+ bool GetIncludePlugins() const {
+if (m_include_plugins.has_value())
+ return m_include_plugins.value();
+//
https://github.com/clayborg requested changes to this pull request.
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
@@ -46,12 +49,206 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+// Helper function to perform an action on each matching plugin.
+// The action callback is given the containing namespace along with plugin info
+// for each matching plugi
dmpots wrote:
ping @clayborg @JDevlieghere @jimingham. Please take a look when you get a
chance. Thanks!
https://github.com/llvm/llvm-project/pull/134418
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/
dmpots wrote:
ping @clayborg @JDevlieghere @jimingham. Please take a look when you get a
chance. Thanks!
https://github.com/llvm/llvm-project/pull/134418
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/
dmpots wrote:
ping @clayborg @JDevlieghere @jimingham. I updated the PR to include plugin
info in the stats. Please take a look when you get a chance. Thanks!
https://github.com/llvm/llvm-project/pull/134418
___
lldb-commits mailing list
lldb-commit
@@ -174,12 +174,21 @@ struct StatisticsOptions {
return !GetSummaryOnly();
}
+ void SetIncludePlugins(bool value) { m_include_plugins = value; }
+ bool GetIncludePlugins() const {
+if (m_include_plugins.has_value())
+ return m_include_plugins.value();
+//
dmpots wrote:
@clayborg @JDevlieghere @jimingham I updated the PR to include plugin info in
the stats. Please take a look when you get a chance. Thanks!
https://github.com/llvm/llvm-project/pull/134418
___
lldb-commits mailing list
lldb-commits@lists.
https://github.com/dmpots updated
https://github.com/llvm/llvm-project/pull/134418
>From e240bda8fcea9db4d9c456929ba811feb8d4152b Mon Sep 17 00:00:00 2001
From: David Peixotto
Date: Tue, 11 Mar 2025 13:02:14 -0700
Subject: [PATCH 01/14] Add commands to list/enable/disable plugins
This commit a
dmpots wrote:
> > 1. Are we ok to start with a static table of plugin namespaces or do we
> > want dynamic registration from the beginning?
> >[Add commands to list/enable/disable pluginsĀ #134418
> > (comment)](https://github.com/llvm/llvm-project/pull/134418#discussion_r2029164327)
>
> I
dmpots wrote:
@JDevlieghere @jimingham @clayborg
Please take a look at these open questions when you get a chance. Thanks!
https://github.com/llvm/llvm-project/pull/134418#issuecomment-2798273256
https://github.com/llvm/llvm-project/pull/134418
___
l
dmpots wrote:
@JDevlieghere @jimingham @clayborg
Thanks for the comments. I updated the PR based on the initial feedback. We
still have a few open issues that could use a bit more feedback:
1. Are we ok to start with a static table of plugin namespaces or do we want
dynamic registration from
@@ -46,12 +49,333 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,333 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,333 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
https://github.com/dmpots updated
https://github.com/llvm/llvm-project/pull/134418
>From e240bda8fcea9db4d9c456929ba811feb8d4152b Mon Sep 17 00:00:00 2001
From: David Peixotto
Date: Tue, 11 Mar 2025 13:02:14 -0700
Subject: [PATCH 1/7] Add commands to list/enable/disable plugins
This commit add
https://github.com/clayborg commented:
I do like the ability to enable/disable any plug-in, but we should only add
support for enabling and disabling plug-ins that are optional. This patch adds
the ability to enable/disable system runtime plug-ins so that is good.
A few things to think about:
@@ -46,12 +49,333 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,333 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,344 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,333 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,333 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
https://github.com/clayborg edited
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
@@ -46,12 +49,333 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,333 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,333 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
clayborg wrote:
> Either no one is going to use this except experts, or people will start
> cargo-culting "turn off plugin X and lldb will be faster" and then we get
> "Why doesn't 'obvious thing'" work bug reports, to which the answer would be
> "turn on plugin X" but people may not even know
dmpots wrote:
> Another way to do this would be to have the list of disabled plugins show in
> the result of the `version` command, since that's a commonly provided bit of
> info for bug reports.
Thanks for the suggestion. Let me work on this and update the PR.
https://github.com/llvm/llvm-p
https://github.com/dmpots updated
https://github.com/llvm/llvm-project/pull/134418
>From e240bda8fcea9db4d9c456929ba811feb8d4152b Mon Sep 17 00:00:00 2001
From: David Peixotto
Date: Tue, 11 Mar 2025 13:02:14 -0700
Subject: [PATCH 1/4] Add commands to list/enable/disable plugins
This commit add
@@ -46,12 +49,344 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
https://github.com/dmpots updated
https://github.com/llvm/llvm-project/pull/134418
>From e240bda8fcea9db4d9c456929ba811feb8d4152b Mon Sep 17 00:00:00 2001
From: David Peixotto
Date: Tue, 11 Mar 2025 13:02:14 -0700
Subject: [PATCH 1/3] Add commands to list/enable/disable plugins
This commit add
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp --
lldb/source/Commands/CommandObjectPlugin.cpp
lldb/so
https://github.com/dmpots updated
https://github.com/llvm/llvm-project/pull/134418
>From e240bda8fcea9db4d9c456929ba811feb8d4152b Mon Sep 17 00:00:00 2001
From: David Peixotto
Date: Tue, 11 Mar 2025 13:02:14 -0700
Subject: [PATCH 1/2] Add commands to list/enable/disable plugins
This commit add
@@ -46,12 +49,344 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
jimingham wrote:
Either no one is going to use this except experts, or people will start
cargo-culting "turn off plugin X and lldb will be faster" and then we get "Why
doesn't " work, to which the answer would be "turn on plugin X"
but people may not even know they have this off (a surprising
@@ -46,12 +49,344 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,344 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,344 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,344 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,344 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,344 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,344 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
@@ -46,12 +49,344 @@ class CommandObjectPluginLoad : public CommandObjectParsed
{
}
};
+namespace {
+#define LLDB_OPTIONS_plugin_list
+#include "CommandOptions.inc"
+
+// These option definitions are shared by the plugin list/enable/disable
+// commands.
+class PluginListCo
llvmbot wrote:
@llvm/pr-subscribers-lldb
Author: David Peixotto (dmpots)
Changes
This commit adds three new commands for managing plugins. The `list` command
will show which plugins are currently registered and their enabled state. The
`enable` and `disable` commands can be used to enabl
https://github.com/dmpots created
https://github.com/llvm/llvm-project/pull/134418
This commit adds three new commands for managing plugins. The `list` command
will show which plugins are currently registered and their enabled state. The
`enable` and `disable` commands can be used to enable or
80 matches
Mail list logo