pyhidra icon indicating copy to clipboard operation
pyhidra copied to clipboard

Implementing listening classes don't trigger in seperate threads

Open mahaloz opened this issue 8 months ago • 0 comments

Hi Pyhidra developers! I've recently been moving to reimplement our plugin system, BinSync to Pyhidra Python3. In our code, we have some code to handle events generated by users when they make changes in their decompiler.

I put the following code in the Pyhidra interpreter running in Ghidra:

from ghidra.framework.model import DomainObjectListener
from jpype import JImplements, JOverride

@JImplements(DomainObjectListener)
class DataMonitor:
    @JOverride
    def domainObjectChanged(self, ev):
        print(ev)

my_monitor = DataMonitor()
currentProgram.addListener(my_monitor)

Now, after making some changes in the normal CodeBrowser (like renaming the function), a print should appear in the Python window. However, it never does. I notice I can only get the print to trigger if I make the change to the Domain inside the Python window.

Is this intended? Or, am I doing something incorrect? Are there any workarounds?

Thank you!

mahaloz avatar Jun 07 '24 18:06 mahaloz