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(); TraceProgramView curView = current.getView();
if (!syncTrait.isAutoSyncCursorWithStaticListing() || trackedStatic == null) { if (!syncTrait.isAutoSyncCursorWithStaticListing() || trackedStatic == null) {
Swing.runIfSwingOrRunLater(() -> { Swing.runIfSwingOrRunLater(() -> {
if (curView != current.getView()) {
// Trace changed before Swing scheduled us
return;
}
goToAndUpdateTrackingLabel(curView, loc); goToAndUpdateTrackingLabel(curView, loc);
doCheckCurrentModuleMissing(); doCheckCurrentModuleMissing();
}); });
} }
else { else {
Swing.runIfSwingOrRunLater(() -> { Swing.runIfSwingOrRunLater(() -> {
if (curView != current.getView()) {
// Trace changed before Swing scheduled us
return;
}
goToAndUpdateTrackingLabel(curView, loc); goToAndUpdateTrackingLabel(curView, loc);
doCheckCurrentModuleMissing(); doCheckCurrentModuleMissing();
plugin.fireStaticLocationEvent(trackedStatic); plugin.fireStaticLocationEvent(trackedStatic);

View file

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