Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesViewer.java46
2 files changed, 25 insertions, 39 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java
index ff02764c3..fe484e523 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java
@@ -68,4 +68,22 @@ public interface IVariable extends IDebugElement, IValueModification {
* the failure.</li>
*/
public String getReferenceTypeName() throws DebugException;
+
+ /**
+ * Returns whether this variable's value has changed since the last suspend event.
+ * Implementations may choose whether the last suspend event is the last suspend
+ * event in this variable's debug target, or within the thread(s) in which this variable
+ * is visible.
+ * <p>
+ * Implementations that choose not to implement this function should always
+ * return <code>false</code>.
+ * </p>
+ *
+ * @return whether this variable's value has changed since the last suspend event
+ * @exception DebugException if an exception occurrs determining if this variable's
+ * value has changed since the last suspend event
+ */
+ public boolean hasValueChanged() throws DebugException;
+
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesViewer.java
index 6524dddcc..58841da46 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesViewer.java
@@ -38,12 +38,6 @@ public class VariablesViewer extends TreeViewer {
private HashMap fDisabledImages = new HashMap(10);
/**
- * Map of previous values for variables. Keys
- * are variables, values are values.
- */
- private HashMap fPreviousValues = new HashMap(10);
-
- /**
* Constructor for VariablesViewer.
* @param parent
*/
@@ -97,21 +91,6 @@ public class VariablesViewer extends TreeViewer {
}
/**
- * Resets for a new stack frame.
- */
- protected void reset() {
- fPreviousValues.clear();
- }
-
- /**
- * @see Viewer#inputChanged(Object, Object)
- */
- protected void inputChanged(Object input, Object oldInput) {
- reset();
- super.inputChanged(input, oldInput);
- }
-
- /**
* Refresh the view, and then do another pass to
* update images for values that have not changed
* since the last refresh. Values that have not
@@ -147,20 +126,14 @@ public class VariablesViewer extends TreeViewer {
protected void updateIcons(TreeItem item) {
if (item.getData() instanceof IVariable) {
IVariable var = (IVariable)item.getData();
- Object prevValue = fPreviousValues.get(var);
- Object currentValue = null;
try {
- currentValue = var.getValue();
+ if (!var.hasValueChanged()) {
+ Image disabled = getDisabledImage(item.getImage());
+ item.setImage(disabled);
+ }
} catch (DebugException e) {
DebugUIPlugin.log(e);
}
- if (currentValue != null) {
- fPreviousValues.put(var, currentValue);
- }
- if (prevValue != null && prevValue.equals(currentValue)) {
- Image disabled = getDisabledImage(item.getImage());
- item.setImage(disabled);
- }
}
TreeItem[] children = item.getItems();
for (int i = 0; i < children.length; i++) {
@@ -184,14 +157,9 @@ public class VariablesViewer extends TreeViewer {
TreeItem treeItem = (TreeItem)children[i];
Object data = treeItem.getData();
if (data != null && data instanceof IVariable) {
- try {
- fPreviousValues.put(data, ((IVariable)data).getValue());
- Image image = treeItem.getImage();
- if (image != null) {
- treeItem.setImage(getDisabledImage(image));
- }
- } catch (DebugException e) {
- DebugUIPlugin.log(e);
+ Image image = treeItem.getImage();
+ if (image != null) {
+ treeItem.setImage(getDisabledImage(image));
}
}
}

Back to the top