mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-27 23:17:03 +08:00
Merge remote-tracking branch 'origin/GP-0_Dan_testFixes-20220712-1'
This commit is contained in:
+16
-1
@@ -26,6 +26,7 @@ import docking.widgets.tree.GTreeLazyNode;
|
||||
import docking.widgets.tree.GTreeNode;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
||||
import ghidra.dbg.target.*;
|
||||
import ghidra.framework.model.DomainObjectClosedListener;
|
||||
import ghidra.trace.database.DBTraceUtils;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.Trace.TraceObjectChangeType;
|
||||
@@ -37,7 +38,8 @@ import utilities.util.IDKeyed;
|
||||
|
||||
public class ObjectTreeModel implements DisplaysModified {
|
||||
|
||||
class ListenerForChanges extends TraceDomainObjectListener {
|
||||
class ListenerForChanges extends TraceDomainObjectListener
|
||||
implements DomainObjectClosedListener {
|
||||
public ListenerForChanges() {
|
||||
listenFor(TraceObjectChangeType.CREATED, this::objectCreated);
|
||||
listenFor(TraceObjectChangeType.VALUE_CREATED, this::valueCreated);
|
||||
@@ -45,6 +47,11 @@ public class ObjectTreeModel implements DisplaysModified {
|
||||
listenFor(TraceObjectChangeType.VALUE_LIFESPAN_CHANGED, this::valueLifespanChanged);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void domainObjectClosed() {
|
||||
setTrace(null);
|
||||
}
|
||||
|
||||
protected boolean isEventValue(TraceObjectValue value) {
|
||||
if (!value.getParent()
|
||||
.getTargetSchema()
|
||||
@@ -174,6 +181,11 @@ public class ObjectTreeModel implements DisplaysModified {
|
||||
}
|
||||
return byObject.get(new IDKeyed<>(object));
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
byObject.clear();
|
||||
byValue.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class AbstractNode extends GTreeLazyNode {
|
||||
@@ -600,12 +612,14 @@ public class ObjectTreeModel implements DisplaysModified {
|
||||
protected void removeOldListeners() {
|
||||
if (trace != null) {
|
||||
trace.removeListener(listenerForChanges);
|
||||
trace.removeCloseListener(listenerForChanges);
|
||||
}
|
||||
}
|
||||
|
||||
protected void addNewListeners() {
|
||||
if (trace != null) {
|
||||
trace.addListener(listenerForChanges);
|
||||
trace.addCloseListener(listenerForChanges);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -616,6 +630,7 @@ public class ObjectTreeModel implements DisplaysModified {
|
||||
}
|
||||
|
||||
protected void reload() {
|
||||
nodeCache.invalidate();
|
||||
root.unloadChildren();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -232,7 +232,7 @@ public class DebuggerModulesProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
waitForDomainObject(program);
|
||||
waitForPass(() -> assertEquals(4, modulesProvider.sectionTable.getRowCount()));
|
||||
|
||||
modulesProvider.setSelectedSections(Set.of(secExeText));
|
||||
runSwing(() -> modulesProvider.setSelectedSections(Set.of(secExeText)));
|
||||
performAction(modulesProvider.actionMapSections, false);
|
||||
|
||||
DebuggerSectionMapProposalDialog propDialog =
|
||||
|
||||
Reference in New Issue
Block a user