GP-2719: Fixed cache clearing issue in watches

This commit is contained in:
Dan 2022-10-19 14:48:49 -04:00
parent 2308e467cd
commit 5d041d320c
2 changed files with 30 additions and 2 deletions

View file

@ -883,11 +883,29 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter
reevaluate();
}
public synchronized void doCheckDepsAndReevaluate() {
protected void clearCachedState() {
if (asyncWatchExecutor != null) {
asyncWatchExecutor.getState().clear();
}
if (prevValueExecutor != null) {
prevValueExecutor.getState().clear();
}
}
public synchronized void doCheckDepsAndReevaluate() {
if (asyncWatchExecutor == null) {
return;
}
List<WatchRow> toReevaluate = new ArrayList<>();
for (WatchRow row : watchTableModel.getModelData()) {
AddressSetView reads = row.getReads();
if (reads == null || reads.intersects(changed)) {
toReevaluate.add(row);
}
}
if (!toReevaluate.isEmpty()) {
clearCachedState();
for (WatchRow row : toReevaluate) {
row.reevaluate();
}
}
@ -895,6 +913,10 @@ public class DebuggerWatchesProvider extends ComponentProviderAdapter
}
public void reevaluate() {
if (asyncWatchExecutor == null) {
return;
}
clearCachedState();
for (WatchRow row : watchTableModel.getModelData()) {
row.reevaluate();
}

View file

@ -72,7 +72,13 @@ public enum DebuggerPcodeUtils {
}
PcodeExecutorState<byte[]> local = new RWTargetRegistersPcodeExecutorState(
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();
}
};
}
/**