GP-3384: Fix event ordering when changing / closing a traces

This commit is contained in:
Dan 2023-05-05 09:51:01 -04:00
parent 89e18fa536
commit 23e9815367
2 changed files with 13 additions and 1 deletions

View file

@ -1069,12 +1069,20 @@ public class DebuggerListingProvider extends CodeViewerProvider {
TraceProgramView curView = current.getView();
if (!syncTrait.isAutoSyncCursorWithStaticListing() || trackedStatic == null) {
Swing.runIfSwingOrRunLater(() -> {
if (curView != current.getView()) {
// Trace changed before Swing scheduled us
return;
}
goToAndUpdateTrackingLabel(curView, loc);
doCheckCurrentModuleMissing();
});
}
else {
Swing.runIfSwingOrRunLater(() -> {
if (curView != current.getView()) {
// Trace changed before Swing scheduled us
return;
}
goToAndUpdateTrackingLabel(curView, loc);
doCheckCurrentModuleMissing();
plugin.fireStaticLocationEvent(trackedStatic);

View file

@ -377,7 +377,7 @@ public class DebuggerMemoryBytesProvider extends ProgramByteViewerComponentProvi
if (location == null) {
return false;
}
if (blockSet.getByteBlockInfo(location.getAddress()) == null) {
if (blockSet == null || blockSet.getByteBlockInfo(location.getAddress()) == null) {
return false;
}
if (!super.goTo(gotoProgram, location)) {
@ -493,6 +493,10 @@ public class DebuggerMemoryBytesProvider extends ProgramByteViewerComponentProvi
}
TraceProgramView curView = current.getView();
Swing.runIfSwingOrRunLater(() -> {
if (curView != current.getView()) {
// Trace changed before Swing scheduled us
return;
}
goToAndUpdateTrackingLabel(curView, loc);
});
}