mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-2719: Fixed cache clearing issue in watches
This commit is contained in:
parent
2308e467cd
commit
5d041d320c
2 changed files with 30 additions and 2 deletions
|
@ -883,11 +883,29 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter
|
||||||
reevaluate();
|
reevaluate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void clearCachedState() {
|
||||||
|
if (asyncWatchExecutor != null) {
|
||||||
|
asyncWatchExecutor.getState().clear();
|
||||||
|
}
|
||||||
|
if (prevValueExecutor != null) {
|
||||||
|
prevValueExecutor.getState().clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public synchronized void doCheckDepsAndReevaluate() {
|
public synchronized void doCheckDepsAndReevaluate() {
|
||||||
asyncWatchExecutor.getState().clear();
|
if (asyncWatchExecutor == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<WatchRow> toReevaluate = new ArrayList<>();
|
||||||
for (WatchRow row : watchTableModel.getModelData()) {
|
for (WatchRow row : watchTableModel.getModelData()) {
|
||||||
AddressSetView reads = row.getReads();
|
AddressSetView reads = row.getReads();
|
||||||
if (reads == null || reads.intersects(changed)) {
|
if (reads == null || reads.intersects(changed)) {
|
||||||
|
toReevaluate.add(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!toReevaluate.isEmpty()) {
|
||||||
|
clearCachedState();
|
||||||
|
for (WatchRow row : toReevaluate) {
|
||||||
row.reevaluate();
|
row.reevaluate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -895,6 +913,10 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reevaluate() {
|
public void reevaluate() {
|
||||||
|
if (asyncWatchExecutor == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
clearCachedState();
|
||||||
for (WatchRow row : watchTableModel.getModelData()) {
|
for (WatchRow row : watchTableModel.getModelData()) {
|
||||||
row.reevaluate();
|
row.reevaluate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,13 @@ public enum DebuggerPcodeUtils {
|
||||||
}
|
}
|
||||||
PcodeExecutorState<byte[]> local = new RWTargetRegistersPcodeExecutorState(
|
PcodeExecutorState<byte[]> local = new RWTargetRegistersPcodeExecutorState(
|
||||||
access.getDataForLocalState(coordinates.getThread(), coordinates.getFrame()), Mode.RW);
|
access.getDataForLocalState(coordinates.getThread(), coordinates.getFrame()), Mode.RW);
|
||||||
return new ThreadPcodeExecutorState<>(shared, local);
|
return new ThreadPcodeExecutorState<>(shared, local) {
|
||||||
|
@Override
|
||||||
|
public void clear() {
|
||||||
|
shared.clear();
|
||||||
|
local.clear();
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue