Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2006-04-26 16:48:31 -0400
committerDarin Wright2006-04-26 16:48:31 -0400
commite30979f346292d89fb76ad2a348f888154a3e05b (patch)
treeb0ab9cda2a0d24f33a318a6da8466d51393ab611
parentfb163f9cfd214321f453af314e2007c5d5dafa8e (diff)
downloadeclipse.platform.debug-e30979f346292d89fb76ad2a348f888154a3e05b.tar.gz
eclipse.platform.debug-e30979f346292d89fb76ad2a348f888154a3e05b.tar.xz
eclipse.platform.debug-e30979f346292d89fb76ad2a348f888154a3e05b.zip
Debug tracing deltas
-rw-r--r--org.eclipse.debug.ui/.options1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/ModelDelta.java49
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugEventHandler.java13
3 files changed, 63 insertions, 0 deletions
diff --git a/org.eclipse.debug.ui/.options b/org.eclipse.debug.ui/.options
index 1f8123685..d5fdd2ddb 100644
--- a/org.eclipse.debug.ui/.options
+++ b/org.eclipse.debug.ui/.options
@@ -1,3 +1,4 @@
org.eclipse.debug.ui/debug = false
org.eclipse.debug.ui/debug/viewers/model = false
org.eclipse.debug.ui/debug/viewers/viewer = false
+org.eclipse.debug.ui/debug/viewers/deltas = false
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/ModelDelta.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/ModelDelta.java
index 04975fdb4..c0c685c71 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/ModelDelta.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/ModelDelta.java
@@ -178,4 +178,53 @@ public class ModelDelta implements IModelDelta {
fNodes = nodes;
}
}
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("Model Delta Start\n"); //$NON-NLS-1$
+ appendDetail(buf, this);
+ buf.append("Model Delta End\n"); //$NON-NLS-1$
+ return buf.toString();
+ }
+
+ private void appendDetail(StringBuffer buf, ModelDelta delta) {
+ buf.append("\tElement: "); //$NON-NLS-1$
+ buf.append(delta.fElement);
+ buf.append('\n');
+ buf.append("\tFlags: "); //$NON-NLS-1$
+ int flags = delta.getFlags();
+ if (flags == 0) {
+ buf.append("NO_CHANGE"); //$NON-NLS-1$
+ } else {
+ if ((flags & IModelDelta.ADDED) > 0) {
+ buf.append("ADDED | "); //$NON-NLS-1$
+ }
+ if ((flags & IModelDelta.CONTENT) > 0) {
+ buf.append("CONTENT | "); //$NON-NLS-1$
+ }
+ if ((flags & IModelDelta.EXPAND) > 0) {
+ buf.append("EXPAND | "); //$NON-NLS-1$
+ }
+ if ((flags & IModelDelta.INSERTED) > 0) {
+ buf.append("INSERTED | "); //$NON-NLS-1$
+ }
+ if ((flags & IModelDelta.REMOVED) > 0) {
+ buf.append("REMOVED | "); //$NON-NLS-1$
+ }
+ if ((flags & IModelDelta.REPLACED) > 0) {
+ buf.append("REPLACED | "); //$NON-NLS-1$
+ }
+ if ((flags & IModelDelta.SELECT) > 0) {
+ buf.append("SELECT | "); //$NON-NLS-1$
+ }
+ if ((flags & IModelDelta.STATE) > 0) {
+ buf.append("STATE | "); //$NON-NLS-1$
+ }
+ }
+ buf.append('\n');
+ ModelDelta[] nodes = delta.getNodes();
+ for (int i = 0; i < nodes.length; i++) {
+ appendDetail(buf, nodes[i]);
+ }
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugEventHandler.java
index 778a459b6..8e85ff1cb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugEventHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugEventHandler.java
@@ -10,8 +10,10 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.update;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
import org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.provisional.ModelDelta;
@@ -24,6 +26,14 @@ import org.eclipse.debug.internal.ui.viewers.provisional.ModelDelta;
public abstract class DebugEventHandler {
private AbstractModelProxy fModelProxy;
+
+ // debug flags
+ public static boolean DEBUG_DELTAS = false;
+
+ static {
+ DEBUG_DELTAS = DebugUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$
+ Platform.getDebugOption("org.eclipse.debug.ui/debug/viewers/deltas")); //$NON-NLS-1$
+ }
/**
* Constructs an event handler for the given model proxy.
@@ -161,6 +171,9 @@ public abstract class DebugEventHandler {
protected void fireDelta(IModelDelta delta) {
AbstractModelProxy modelProxy = getModelProxy();
if (modelProxy != null) {
+ if (DEBUG_DELTAS) {
+ DebugUIPlugin.debug("FIRE DELTA: " + delta.toString()); //$NON-NLS-1$
+ }
modelProxy.fireModelChanged(delta);
}
}

Back to the top