Skip to content

[lldb] Add support to list/enable/disable remaining plugin types. #143970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 96 additions & 12 deletions lldb/include/lldb/Core/PluginManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,6 @@ class PluginManager {
static SystemRuntimeCreateInstance
GetSystemRuntimeCreateCallbackAtIndex(uint32_t idx);

static std::vector<RegisteredPluginInfo> GetSystemRuntimePluginInfo();

// Modify the enabled state of a SystemRuntime plugin.
// Returns false if the plugin name is not found.
static bool SetSystemRuntimePluginEnabled(llvm::StringRef name, bool enabled);

// ObjectFile
static bool
RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
Expand Down Expand Up @@ -549,12 +543,6 @@ class PluginManager {
static InstrumentationRuntimeCreateInstance
GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx);

static std::vector<RegisteredPluginInfo>
GetInstrumentationRuntimePluginInfo();

static bool SetInstrumentationRuntimePluginEnabled(llvm::StringRef name,
bool enabled);

// TypeSystem
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
TypeSystemCreateInstance create_callback,
Expand Down Expand Up @@ -690,6 +678,102 @@ class PluginManager {
static bool CreateSettingForCPlusPlusLanguagePlugin(
Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp,
llvm::StringRef description, bool is_global_property);

//
// Plugin Info+Enable Declarations
//
static std::vector<RegisteredPluginInfo> GetABIPluginInfo();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved all of the declarations to support list/enable/disable to the same location to make it easy to generate the code from a script. I can intersperse these back with their respective plugin locations if desired.

The code was generated with https://gist.github.com/dmpots/caca58fbb45b8c0f63b19553c5402611.

We talked previously about doing a dynamic registration. I poked around a bit in the td file, but nothing obvious jumped out without a bit of work and I wasn't sure it was worth the effort.

I'm happy to discuss alternatives here about how to do the dynamic registration.

static bool SetABIPluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetArchitecturePluginInfo();
static bool SetArchitecturePluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetDisassemblerPluginInfo();
static bool SetDisassemblerPluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetDynamicLoaderPluginInfo();
static bool SetDynamicLoaderPluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetEmulateInstructionPluginInfo();
static bool SetEmulateInstructionPluginEnabled(llvm::StringRef name,
bool enable);

static std::vector<RegisteredPluginInfo>
GetInstrumentationRuntimePluginInfo();
static bool SetInstrumentationRuntimePluginEnabled(llvm::StringRef name,
bool enable);

static std::vector<RegisteredPluginInfo> GetJITLoaderPluginInfo();
static bool SetJITLoaderPluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetLanguagePluginInfo();
static bool SetLanguagePluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetLanguageRuntimePluginInfo();
static bool SetLanguageRuntimePluginEnabled(llvm::StringRef name,
bool enable);

static std::vector<RegisteredPluginInfo> GetMemoryHistoryPluginInfo();
static bool SetMemoryHistoryPluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetObjectContainerPluginInfo();
static bool SetObjectContainerPluginEnabled(llvm::StringRef name,
bool enable);

static std::vector<RegisteredPluginInfo> GetObjectFilePluginInfo();
static bool SetObjectFilePluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetOperatingSystemPluginInfo();
static bool SetOperatingSystemPluginEnabled(llvm::StringRef name,
bool enable);

static std::vector<RegisteredPluginInfo> GetPlatformPluginInfo();
static bool SetPlatformPluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetProcessPluginInfo();
static bool SetProcessPluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetREPLPluginInfo();
static bool SetREPLPluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetRegisterTypeBuilderPluginInfo();
static bool SetRegisterTypeBuilderPluginEnabled(llvm::StringRef name,
bool enable);

static std::vector<RegisteredPluginInfo> GetScriptInterpreterPluginInfo();
static bool SetScriptInterpreterPluginEnabled(llvm::StringRef name,
bool enable);

static std::vector<RegisteredPluginInfo> GetScriptedInterfacePluginInfo();
static bool SetScriptedInterfacePluginEnabled(llvm::StringRef name,
bool enable);

static std::vector<RegisteredPluginInfo> GetStructuredDataPluginInfo();
static bool SetStructuredDataPluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetSymbolFilePluginInfo();
static bool SetSymbolFilePluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetSymbolLocatorPluginInfo();
static bool SetSymbolLocatorPluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetSymbolVendorPluginInfo();
static bool SetSymbolVendorPluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetSystemRuntimePluginInfo();
static bool SetSystemRuntimePluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetTracePluginInfo();
static bool SetTracePluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetTraceExporterPluginInfo();
static bool SetTraceExporterPluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetTypeSystemPluginInfo();
static bool SetTypeSystemPluginEnabled(llvm::StringRef name, bool enable);

static std::vector<RegisteredPluginInfo> GetUnwindAssemblyPluginInfo();
static bool SetUnwindAssemblyPluginEnabled(llvm::StringRef name, bool enable);
};

} // namespace lldb_private
Expand Down
Loading
Loading