GP-5266: Only track on user click or address change.

This commit is contained in:
Dan
2025-01-15 13:56:40 -05:00
committed by Ryan Kurtz
parent 2a628178b3
commit 5d71f073f4
10 changed files with 135 additions and 32 deletions

View File

@@ -66,7 +66,7 @@ public class DebuggerCoordinates {
private static final String KEY_FRAME = "Frame";
private static final String KEY_OBJ_PATH = "ObjectPath";
public static boolean equalsIgnoreRecorderAndView(DebuggerCoordinates a,
public static boolean equalsIgnoreTargetAndView(DebuggerCoordinates a,
DebuggerCoordinates b) {
if (!Objects.equals(a.trace, b.trace)) {
return false;
@@ -417,6 +417,36 @@ public class DebuggerCoordinates {
newFrame, newPath);
}
/**
* Checks if the given coordinates are the same as this but with an extra or differing patch.
*
* @param that the other coordinates
* @return true if the difference is only in the final patch step
*/
public boolean differsOnlyByPatch(DebuggerCoordinates that) {
if (!Objects.equals(this.trace, that.trace)) {
return false;
}
if (!Objects.equals(this.platform, that.platform)) {
return false;
}
if (!Objects.equals(this.thread, that.thread)) {
return false;
}
// Consider defaults
if (!Objects.equals(this.getFrame(), that.getFrame())) {
return false;
}
if (!Objects.equals(this.getObject(), that.getObject())) {
return false;
}
if (!this.getTime().differsOnlyByPatch(that.getTime())) {
return false;
}
return true;
}
public DebuggerCoordinates frame(int newFrame) {
if (trace == null) {
return NOWHERE;
@@ -621,7 +651,11 @@ public class DebuggerCoordinates {
if (registerContainer != null) {
return registerContainer;
}
return registerContainer = getObject().findRegisterContainer(getFrame());
TraceObject object = getObject();
if (object == null) {
return null;
}
return registerContainer = object.findRegisterContainer(getFrame());
}
public synchronized long getViewSnap() {