https://github.com/labath commented:

I think this looks okay so far. @JDevlieghere, do you have anything to add?

The interesting part will be wiring this up with initialization and all the 
call sites (which is now complicated by the fact that this code is 
conditionally compiled.

Before you get too much into the plugin manager, let me say that I *don't* 
think it makes sense emulating the "normal" plugin setup for this 
functionality. It's true that this is meant to be pluggable in a way, so 
calling it *a* plugin sounds reasonable. However, it's a very different kind of 
a plugin from all of our other plugins. The complexity of those plugins comes 
from the fact that we have *multiple* implementations (classes) of those 
plugins, which can create an *arbitrary number* of instances (objects) of that 
class, at *arbitrary points in time* (e.g. each time we open an object file).

Pretty much none of this applies here. As I understand it, we're going to have 
*at most one implementation* of the plugin (at most one *active* instance at 
least), this implementation is going to have *at most one instance* (since 
we're sharing it between debugger objects), and we're going to be creating it 
directly *at startup*.

With that in mind, I think it'd be sufficient to have something like 
`TelemetryManager::SetInstance()`, and have that be called from the 
`Initialize()` static method of the plugin. (None of the fancy CreateInstance 
methods, callbacks, etc.)

https://github.com/llvm/llvm-project/pull/119716
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to