mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-21 09:21:35 +08:00
Merge remote-tracking branch 'origin/GP-1355_Dan_post-GP-853'
This commit is contained in:
+26
-6
@@ -37,9 +37,10 @@ import ghidra.framework.options.SaveState;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.annotation.AutoConfigStateField;
|
||||
import ghidra.program.model.address.AddressSetView;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.*;
|
||||
import ghidra.trace.model.Trace.TraceMemoryStateChangeType;
|
||||
import ghidra.trace.model.Trace.TraceSnapshotChangeType;
|
||||
import ghidra.trace.model.TraceDomainObjectListener;
|
||||
import ghidra.trace.model.memory.TraceMemoryState;
|
||||
import ghidra.trace.model.time.TraceSnapshot;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.Swing;
|
||||
@@ -88,14 +89,31 @@ public abstract class DebuggerReadsMemoryTrait {
|
||||
}
|
||||
}
|
||||
|
||||
protected class ForCaptureEnabledTraceListener extends TraceDomainObjectListener {
|
||||
public ForCaptureEnabledTraceListener() {
|
||||
protected class ForCaptureTraceListener extends TraceDomainObjectListener {
|
||||
public ForCaptureTraceListener() {
|
||||
listenFor(TraceSnapshotChangeType.ADDED, this::snapshotAdded);
|
||||
listenFor(TraceMemoryStateChangeType.CHANGED, this::memStateChanged);
|
||||
}
|
||||
|
||||
private void snapshotAdded(TraceSnapshot snapshot) {
|
||||
actionCaptureSelected.updateEnabled(null);
|
||||
}
|
||||
|
||||
private void memStateChanged(TraceAddressSnapRange range, TraceMemoryState oldIsNull,
|
||||
TraceMemoryState newState) {
|
||||
if (current.getView() == null) {
|
||||
return;
|
||||
}
|
||||
if (!range.getLifespan().contains(current.getSnap())) {
|
||||
return;
|
||||
}
|
||||
// TODO: Debounce this?
|
||||
repaintPanel();
|
||||
|
||||
if (newState == TraceMemoryState.UNKNOWN) {
|
||||
doAutoRead();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected class ForAccessRecorderListener implements TraceRecorderListener {
|
||||
@@ -131,8 +149,8 @@ public abstract class DebuggerReadsMemoryTrait {
|
||||
protected final Plugin plugin;
|
||||
protected final ComponentProvider provider;
|
||||
|
||||
protected final ForCaptureEnabledTraceListener traceListener =
|
||||
new ForCaptureEnabledTraceListener();
|
||||
protected final ForCaptureTraceListener traceListener =
|
||||
new ForCaptureTraceListener();
|
||||
protected final ForAccessRecorderListener recorderListener = new ForAccessRecorderListener();
|
||||
protected final ForVisibilityListener displayListener = new ForVisibilityListener();
|
||||
|
||||
@@ -268,4 +286,6 @@ public abstract class DebuggerReadsMemoryTrait {
|
||||
}
|
||||
|
||||
protected abstract AddressSetView getSelection();
|
||||
|
||||
protected abstract void repaintPanel();
|
||||
}
|
||||
|
||||
+5
@@ -199,6 +199,11 @@ public class DebuggerListingProvider extends CodeViewerProvider {
|
||||
protected AddressSetView getSelection() {
|
||||
return DebuggerListingProvider.this.getSelection();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void repaintPanel() {
|
||||
getListingPanel().getFieldPanel().repaint();
|
||||
}
|
||||
}
|
||||
|
||||
private final DebuggerListingPlugin plugin;
|
||||
|
||||
+8
@@ -124,6 +124,14 @@ public class DebuggerMemoryBytesProvider extends ProgramByteViewerComponentProvi
|
||||
protected AddressSetView getSelection() {
|
||||
return DebuggerMemoryBytesProvider.this.getSelection();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void repaintPanel() {
|
||||
for (ByteViewerComponent view : getByteViewerPanel().getViewList()) {
|
||||
// NB. ByteViewerComponent extends FieldPanel
|
||||
view.repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final AutoReadMemorySpec defaultReadMemorySpec =
|
||||
|
||||
Reference in New Issue
Block a user