Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-05-13 18:01:29 -0400
committereutarass2011-05-13 18:01:29 -0400
commit9d37c209c61e34a50ad1e76bfc842beb7f80cd7a (patch)
treedbb027af2278830c08e6a01ae3cae9fbae6cac92
parentd770c1e40de547f46f9634d66849beb8f7b1b4ce (diff)
downloadorg.eclipse.tcf-9d37c209c61e34a50ad1e76bfc842beb7f80cd7a.tar.gz
org.eclipse.tcf-9d37c209c61e34a50ad1e76bfc842beb7f80cd7a.tar.xz
org.eclipse.tcf-9d37c209c61e34a50ad1e76bfc842beb7f80cd7a.zip
TCF Debugger: improved Debug view update logic - less flicker in the view.
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenStackTrace.java4
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java33
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java92
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java7
4 files changed, 68 insertions, 68 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenStackTrace.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenStackTrace.java
index 63325da3f..acab154dd 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenStackTrace.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenStackTrace.java
@@ -43,6 +43,10 @@ public class TCFChildrenStackTrace extends TCFChildren {
reset();
}
+ void onContextActionDone() {
+ for (TCFNode n : getNodes()) ((TCFNodeStackFrame)n).onContextActionDone();
+ }
+
void onRegistersChanged() {
for (TCFNode n : getNodes()) ((TCFNodeStackFrame)n).onRegistersChanged();
reset();
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java
index 6a5886fd9..568a5e2aa 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java
@@ -179,8 +179,6 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
private int auto_disconnect_generation;
private final Map<String,String> action_results = new HashMap<String,String>();
- private final Map<IPresentationContext,Map<TCFNode,Integer>> action_deltas =
- new HashMap<IPresentationContext,Map<TCFNode,Integer>>();
private final HashMap<String,TCFAction> active_actions = new HashMap<String,TCFAction>();
private final Map<IPresentationContext,TCFModelProxy> model_proxies =
@@ -460,27 +458,16 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
public void onContextActionResult(String id, String reason) {
if (reason == null) action_results.remove(id);
else action_results.put(id, reason);
- TCFNode node = id2node.get(id);
- if (node != null) {
- for (IPresentationContext ctx : model_proxies.keySet()) {
- addActionsDoneDelta(node, ctx, IModelDelta.STATE);
- }
- }
}
public void onContextActionDone(TCFAction action) {
String id = action.getContextID();
active_actions.remove(id);
- setDebugViewSelection(id2node.get(id), "Action");
- for (IPresentationContext ctx : action_deltas.keySet()) {
- Map<TCFNode,Integer> deltas = action_deltas.get(ctx);
- TCFModelProxy proxy = model_proxies.get(ctx);
- if (proxy == null) continue;
- for (TCFNode node : deltas.keySet()) {
- proxy.addDelta(node, deltas.get(node));
- }
+ TCFNode node = getNode(id);
+ if (node instanceof TCFNodeExecContext) {
+ ((TCFNodeExecContext)node).onContextActionDone();
}
- action_deltas.clear();
+ setDebugViewSelection(id2node.get(id), "Action");
for (TCFModelProxy p : model_proxies.values()) p.post();
}
};
@@ -619,18 +606,6 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
return active_actions.get(id);
}
- void addActionsDoneDelta(TCFNode node, IPresentationContext ctx, int flags) {
- Map<TCFNode,Integer> deltas = action_deltas.get(ctx);
- if (deltas == null) action_deltas.put(ctx, deltas = new HashMap<TCFNode,Integer>());
- Integer delta = deltas.get(node);
- if (delta != null) {
- deltas.put(node, delta.intValue() | flags);
- }
- else {
- deltas.put(node, flags);
- }
- }
-
String getContextActionResult(String id) {
return action_results.get(id);
}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
index 2621329ca..8949bc8d0 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
@@ -204,12 +204,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
TCFNodeExecContext(TCFNode parent, final String id) {
super(parent, id);
children_exec = new TCFChildrenExecContext(this);
- children_stack = new TCFChildrenStackTrace(this) {
- @Override
- TCFNode[] toArray() {
- return last_stack_trace = super.toArray();
- }
- };
+ children_stack = new TCFChildrenStackTrace(this);
children_regs = new TCFChildrenRegisters(this);
children_exps = new TCFChildrenExpressions(this);
children_hover_exps = new TCFChildrenHoverExpressions(this);
@@ -738,6 +733,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
}
if (children != null) {
if (!children.validate(done)) return false;
+ if (children == children_stack) last_stack_trace = children_stack.toArray();
result.setChildCount(children.size());
}
else {
@@ -802,6 +798,8 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
if (ctx != null) children = children_modules;
}
if (children == null) return true;
+ if (!children.validate(done)) return false;
+ if (children == children_stack) last_stack_trace = children_stack.toArray();
return children.getData(result, done);
}
@@ -855,6 +853,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
}
if (children != null) {
if (!children.validate(done)) return false;
+ if (children == children_stack) last_stack_trace = children_stack.toArray();
result.setHasChilren(children.size() > 0);
}
else {
@@ -893,12 +892,16 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
label.append(nm != null ? nm : id);
if (ctx.hasState()) {
// Thread
- if (model.getActiveAction(id) != null) {
- model.addActionsDoneDelta(this, result.getPresentationContext(), IModelDelta.STATE);
+ if (resumed_by_action || model.getActiveAction(id) != null) {
image_name = ImageCache.IMG_THREAD_RUNNNIG;
+ if (resume_pending && last_label != null) {
+ result.setImageDescriptor(ImageCache.getImageDescriptor(image_name), 0);
+ result.setLabel(last_label, 0);
+ return true;
+ }
label.append(" (Running)");
}
- else if (resume_pending && !resumed_by_action && last_label != null && last_image != null) {
+ else if (resume_pending && last_label != null && last_image != null) {
result.setImageDescriptor(ImageCache.getImageDescriptor(last_image), 0);
result.setLabel(last_label, 0);
return true;
@@ -1018,8 +1021,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
if (p.getInput() == this) flags |= IModelDelta.CONTENT;
}
if (flags == 0) continue;
- if (model.getActiveAction(id) == null) p.addDelta(this, flags);
- else model.addActionsDoneDelta(this, p.getPresentationContext(), flags);
+ p.addDelta(this, flags);
}
}
@@ -1115,44 +1117,60 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
}
address.reset();
signal_mask.reset();
- resumed_cnt++;
- resume_pending = false;
- resumed_by_action = false;
+ if (resume_pending && model.getActiveAction(id) == null) {
+ resumed_cnt++;
+ resume_pending = false;
+ resumed_by_action = false;
+ }
children_stack.onSuspended();
children_regs.onSuspended();
children_exps.onSuspended();
children_hover_exps.onSuspended();
for (TCFNodeSymbol s : symbols.values()) s.onExeStateChange();
- TCFNode n = parent;
- while (n instanceof TCFNodeExecContext) {
- ((TCFNodeExecContext)n).postStateChangedDelta();
- n = n.parent;
+ if (model.getActiveAction(id) == null) {
+ TCFNode n = this;
+ while (n instanceof TCFNodeExecContext) {
+ ((TCFNodeExecContext)n).postStateChangedDelta();
+ n = n.parent;
+ }
+ postContentChangedDelta();
}
- postAllChangedDelta();
}
void onContextResumed() {
assert !isDisposed();
state.reset(new TCFContextState());
- final int cnt = ++resumed_cnt;
- resume_pending = true;
- resumed_by_action = model.getActiveAction(id) != null;
- if (resumed_by_action) postStateChangedDelta();
- Protocol.invokeLater(400, new Runnable() {
- public void run() {
- if (cnt != resumed_cnt) return;
- if (isDisposed()) return;
- resume_pending = false;
- resumed_by_action = false;
- children_stack.onResumed();
- postContentChangedDelta();
- TCFNode n = parent;
- while (n instanceof TCFNodeExecContext) {
- ((TCFNodeExecContext)n).postStateChangedDelta();
- n = n.parent;
+ if (!resume_pending) {
+ final int cnt = ++resumed_cnt;
+ resume_pending = true;
+ resumed_by_action = model.getActiveAction(id) != null;
+ if (resumed_by_action) postAllChangedDelta();
+ Protocol.invokeLater(400, new Runnable() {
+ public void run() {
+ if (cnt != resumed_cnt) return;
+ if (isDisposed()) return;
+ children_stack.onResumed();
+ resume_pending = false;
+ resumed_by_action = false;
+ postContentChangedDelta();
+ TCFNode n = TCFNodeExecContext.this;
+ while (n instanceof TCFNodeExecContext) {
+ ((TCFNodeExecContext)n).postStateChangedDelta();
+ n = n.parent;
+ }
}
- }
- });
+ });
+ }
+ }
+
+ void onContextActionDone() {
+ if (!state.isValid() || state.getData() == null || state.getData().is_suspended) {
+ resumed_cnt++;
+ resume_pending = false;
+ resumed_by_action = false;
+ }
+ postAllChangedDelta();
+ children_stack.onContextActionDone();
}
void onContextException(String msg) {
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java
index 4060f0452..7e0f8ac1b 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java
@@ -398,8 +398,7 @@ public class TCFNodeStackFrame extends TCFNode {
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(id)) flags |= IModelDelta.STATE;
if (getChildren(p.getPresentationContext()) != null && p.getInput() == this) flags |= IModelDelta.CONTENT;
if (flags == 0) continue;
- if (model.getActiveAction(parent.id) == null) p.addDelta(this, flags);
- else model.addActionsDoneDelta(this, p.getPresentationContext(), flags);
+ p.addDelta(this, flags);
}
}
@@ -432,6 +431,10 @@ public class TCFNodeStackFrame extends TCFNode {
children_vars.onSuspended();
children_exps.onSuspended();
children_hover_exps.onSuspended();
+ if (model.getActiveAction(parent.id) == null) postAllChangedDelta();
+ }
+
+ void onContextActionDone() {
postAllChangedDelta();
}

Back to the top