Replies: 3 comments 3 replies
-
You're almost correct. TLDR... if an extension wants to implement an extension point, it A) needs to get on the classpath and B) needs to get instantiated by its "owning" plugin. (A) only happens at startup and (B) often happens once. Very early in startup (you can see the During a GUI run (for example), the (an extension point is a class whose name ends with one of the suffixes defined in an
OSGi was introduced to Ghidra to handle the complexities of a "dynamic classpath". It's currently only available through scripting. Somtimes, you can replace an extension's support libs with a jar "support" bundle. Creating a bundle from a bunch of jars or class files can seem complicated, but there are tools to help. For a general "dynamically loadable extension points" we'd have to address A and B. A straightforward path forward for (A) would be to make For (B), users of Some extension points could be made entirely dynamic - e.g. when instances are loaded, used, and disposed, like analyzers. Other extension points could be adapted to a "born after launch, never die" policy, like fields in the GUI. If extension points declared their lifecycle, migrating could be done incrementally - the default lifecycle would be the current one. Then we could update one an extension point a time. Sooo.. almost. |
Beta Was this translation helpful? Give feedback.
-
Oversimplifying the idea that @jpleasu has listed, having a dynamic model makes the code base a bit more complicated to work in, as it adds the requirement to understand the idea of a dynamic lifecycle. Prior to extensions, we used to have some support for refreshing dynamic content while running. This older feature was not used much and added extra complexity to the system. There still may be some individual clients that choose to update internal content dynamically by calling the In the end, to avoid adding a layer of dependency management, we felt it was easier to restart the tool when new plugins or extensions are added. |
Beta Was this translation helpful? Give feedback.
-
I thought that plugins were initialized when a tool starts. This actually might be the case but there is no differentiation between an extension point and a plugin in this context (as far as loading/unloading the classes) so it does makes sense to restart here. A rather silly idea maybe would be to have an option to have Ghidra restart itself. This may save someone the 5 seconds of having to manually close and relaunch it 🤣 |
Beta Was this translation helpful? Give feedback.
-
Why? This isn't actually necessary is it? Please correct me if I'm wrong but I feel like Ghidra has everything necessary in place already to avoid having to do this.
Beta Was this translation helpful? Give feedback.
All reactions