Merge remote-tracking branch 'origin/GP-5672_Dan_fixSyncProgramSwitch' into Ghidra_11.4

This commit is contained in:
Ryan Kurtz 2025-05-14 15:53:58 -04:00
commit b915d15baa

View file

@ -391,6 +391,7 @@ public class DynamicStaticSynchronizationPlugin extends Plugin {
if (dynamicLoc == null) { if (dynamicLoc == null) {
return; return;
} }
currentDynamicLocation = dynamicLoc;
firePluginEvent(new TraceLocationPluginEvent(getName(), dynamicLoc)); firePluginEvent(new TraceLocationPluginEvent(getName(), dynamicLoc));
} }
@ -412,6 +413,11 @@ public class DynamicStaticSynchronizationPlugin extends Plugin {
if (staticLoc == null) { if (staticLoc == null) {
return; return;
} }
if (currentStatic != staticLoc.getProgram()) {
currentStatic = staticLoc.getProgram();
firePluginEvent(new ProgramActivatedPluginEvent(getName(), staticLoc.getProgram()));
}
currentStaticLocation = staticLoc;
firePluginEvent( firePluginEvent(
new ProgramLocationPluginEvent(getName(), staticLoc, staticLoc.getProgram())); new ProgramLocationPluginEvent(getName(), staticLoc, staticLoc.getProgram()));
} }
@ -434,6 +440,7 @@ public class DynamicStaticSynchronizationPlugin extends Plugin {
.map(r -> r.getDestinationAddressRange()) .map(r -> r.getDestinationAddressRange())
.collect(AddressCollectors.toAddressSet()); .collect(AddressCollectors.toAddressSet());
ProgramSelection dynamicSel = new ProgramSelection(dynamicAddrs); ProgramSelection dynamicSel = new ProgramSelection(dynamicAddrs);
currentDynamicSelection = dynamicSel;
firePluginEvent(new TraceSelectionPluginEvent(getName(), dynamicSel, view)); firePluginEvent(new TraceSelectionPluginEvent(getName(), dynamicSel, view));
return dynamicSel; return dynamicSel;
} }
@ -456,6 +463,7 @@ public class DynamicStaticSynchronizationPlugin extends Plugin {
.map(r -> r.getDestinationAddressRange()) .map(r -> r.getDestinationAddressRange())
.collect(AddressCollectors.toAddressSet()); .collect(AddressCollectors.toAddressSet());
ProgramSelection staticSel = new ProgramSelection(staticAddrs); ProgramSelection staticSel = new ProgramSelection(staticAddrs);
currentStaticSelection = staticSel;
firePluginEvent(new ProgramSelectionPluginEvent(getName(), staticSel, currentStatic)); firePluginEvent(new ProgramSelectionPluginEvent(getName(), staticSel, currentStatic));
return staticSel; return staticSel;
} }