[Lldb-commits] [lldb] [lldb/Plugins] Introduce Scripted Platform Plugin (PR #99814)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 5 04:46:41 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;
----------------
labath wrote:

> I don't see how passing the debugger vs. the script interpreter would make a difference if the scripted platform was created with one debugger and copied to another debugger platform's list. Even if I held on the script interpreter from the first debugger, once copied to the other one, the scripted platform will still interact with the script interpreter from the first one, which is basically the same as holding to the debugger.

It's basically the same, but it makes the intent clearer, I think.

> I'm not sure if this is a scenario we want to support, may be @jimingham would have some opinions about this.

> @labath if you have some ideas how to support this scenario, I'd love to be convinced :)

I am not saying we should support this scenario (I'm also not saying we should not). What I'm saying is that this (creating a platform with one debugger, but then adding it to another one) is something that can happen, so we should figure out what to do about it. Do we want to support it or not? Do we want to prevent it from happening or not?

I don't really have an answer to those, but I think we should have one..

https://github.com/llvm/llvm-project/pull/99814


More information about the lldb-commits mailing list