mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 19:42:36 +02:00
GP-0: Fix DebuggerModelProviderTest.testActionCloneWindow
This commit is contained in:
parent
53a057a59f
commit
bbb3864720
2 changed files with 17 additions and 1 deletions
|
@ -84,6 +84,11 @@ public class DebuggerModelPlugin extends Plugin {
|
|||
@Override
|
||||
protected void dispose() {
|
||||
tool.removeComponentProvider(connectedProvider);
|
||||
synchronized (disconnectedProviders) {
|
||||
for (DebuggerModelProvider p : disconnectedProviders) {
|
||||
tool.removeComponentProvider(p);
|
||||
}
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ import docking.widgets.tree.support.GTreeSelectionListener;
|
|||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
||||
import ghidra.app.plugin.core.debug.gui.model.ObjectTreeModel.AbstractNode;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.target.TraceObjectKeyPath;
|
||||
|
||||
public class ObjectsTreePanel extends JPanel {
|
||||
|
@ -97,6 +98,16 @@ public class ObjectsTreePanel extends JPanel {
|
|||
return new KeepTreeState(tree);
|
||||
}
|
||||
|
||||
protected Trace computeDiffTrace(Trace current, Trace previous) {
|
||||
if (current == null) {
|
||||
return null;
|
||||
}
|
||||
if (previous == null) {
|
||||
return current;
|
||||
}
|
||||
return previous;
|
||||
}
|
||||
|
||||
public void goToCoordinates(DebuggerCoordinates coords) {
|
||||
// TODO: thread should probably become a TraceObject once we transition
|
||||
if (DebuggerCoordinates.equalsIgnoreRecorderAndView(current, coords)) {
|
||||
|
@ -105,7 +116,7 @@ public class ObjectsTreePanel extends JPanel {
|
|||
DebuggerCoordinates previous = current;
|
||||
this.current = coords;
|
||||
try (KeepTreeState keep = keepTreeState()) {
|
||||
treeModel.setDiffTrace(previous.getTrace());
|
||||
treeModel.setDiffTrace(computeDiffTrace(current.getTrace(), previous.getTrace()));
|
||||
treeModel.setTrace(current.getTrace());
|
||||
treeModel.setDiffSnap(previous.getSnap());
|
||||
treeModel.setSnap(current.getSnap());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue