[Lldb-commits] [lldb] [lldb/Plugins] Introduce Scripted Platform Plugin (PR #99814)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Aug 6 10:16:48 PDT 2024
================
@@ -1003,6 +1010,21 @@ class Platform : public PluginInterface {
FileSpec GetModuleCacheRoot();
};
+class PlatformMetadata {
+public:
+ PlatformMetadata(Debugger &debugger, const ScriptedMetadata metadata);
+ ~PlatformMetadata() = default;
+
+ Debugger &GetDebugger() const { return m_debugger; }
+ const ScriptedMetadata GetScriptedMetadata() const {
+ return m_scripted_metadata;
+ }
+
+protected:
+ Debugger &m_debugger;
----------------
jimingham wrote:
I don't like that idea, a scripted platform is really really going to want to create scripted processes. That will be super awkward when the scripted platform and the scripted process can't share code because they are in different interpreters. I don't want to have to explain this to people trying to use the lldb extension points.
I think a much simpler solution is that Debuggers have a list of Platforms which is where dynamically created platforms are registered, and which it consults first when resolving "platform for name". Debuggers really should be independent of one another or things get hard to reason about. For instance, it would be very strange to have `command script import` in debugger A make a new Platform show up in debugger B.
So you want to keep platforms made by a debugger confined to that debugger, and having an "dynamic platforms" or whatever list in the debugger seems a pretty straightforward way of doing that.
https://github.com/llvm/llvm-project/pull/99814
More information about the lldb-commits
mailing list