|
49 | 49 | import docking.wizard.WizardManager; |
50 | 50 | import ghidra.app.decompiler.DecompInterface; |
51 | 51 | import ghidra.app.decompiler.DecompileResults; |
| 52 | +import ghidra.app.events.ProgramLocationPluginEvent; |
52 | 53 | import ghidra.app.services.CodeViewerService; |
53 | 54 | import ghidra.framework.cmd.Command; |
| 55 | +import ghidra.framework.model.DomainFile; |
54 | 56 | import ghidra.framework.model.Project; |
55 | 57 | import ghidra.framework.plugintool.ComponentProviderAdapter; |
| 58 | +import ghidra.framework.plugintool.PluginEvent; |
| 59 | +import ghidra.framework.plugintool.PluginTool; |
56 | 60 | import ghidra.program.model.address.Address; |
57 | 61 | import ghidra.program.model.address.AddressSpace; |
58 | 62 | import ghidra.program.model.listing.Function; |
@@ -213,6 +217,7 @@ protected boolean isMetadataVersionOK(Connection c) throws Exception { |
213 | 217 | } |
214 | 218 |
|
215 | 219 | public class DiffState { |
| 220 | + DomainFile df; |
216 | 221 | BinExport2File beFile; |
217 | 222 | Program prog; |
218 | 223 | String addressCol, filename, exefilename, hash; |
@@ -394,11 +399,21 @@ protected void doDiffWork() { |
394 | 399 | public void mousePressed(MouseEvent e) { |
395 | 400 | if (e.getClickCount() == 2 && table.getSelectedRow() != -1) { |
396 | 401 | var entry = ctm.getEntry(table.getSelectedRow()); |
397 | | - cvs.goTo(new ProgramLocation(program, entry.primaryAddress), true); |
398 | | - if (secondary.prog != null) { |
| 402 | + //cvs.goTo(new ProgramLocation(program, entry.primaryAddress), true); |
| 403 | + PluginEvent ev = new ProgramLocationPluginEvent(null, new ProgramLocation(program, entry.primaryAddress), program); |
| 404 | + tool.firePluginEvent(ev); |
| 405 | + |
| 406 | + if (secondary.prog != null && secondary.df != null) { |
399 | 407 | Address secAddress = secondary.prog.getAddressFactory().getDefaultAddressSpace() |
400 | 408 | .getAddress(entry.secondaryAddress); |
401 | | - secondary.cvs.goTo(new ProgramLocation(secondary.prog, secAddress), true); |
| 409 | + //secondary.cvs.goTo(new ProgramLocation(secondary.prog, secAddress), true); |
| 410 | + PluginEvent secev = new ProgramLocationPluginEvent(null, new ProgramLocation(secondary.prog, secAddress), secondary.prog); |
| 411 | + |
| 412 | + for (var consumer : secondary.df.getConsumers()) { |
| 413 | + if (consumer instanceof PluginTool pt) |
| 414 | + pt.firePluginEvent(secev); |
| 415 | + } |
| 416 | + tool.firePluginEvent(secev); |
402 | 417 | } |
403 | 418 | } |
404 | 419 | if (secondary.prog != null && e.getClickCount() == 3 && table.getSelectedRow() != -1) { |
|
0 commit comments