Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2012-10-23 04:10:43 +0000
committerPawel Piech2012-10-23 04:14:15 +0000
commitc7465d3975386a92cf43b6ec29cf2c1ba38fe235 (patch)
treee4cc6b6ade36db2e330fced7998dbf55ca338c88 /plugins
parent3f6109bedbf34e43ec86e2c6202db8ec7fc697ae (diff)
downloadorg.eclipse.tcf-c7465d3975386a92cf43b6ec29cf2c1ba38fe235.tar.gz
org.eclipse.tcf-c7465d3975386a92cf43b6ec29cf2c1ba38fe235.tar.xz
org.eclipse.tcf-c7465d3975386a92cf43b6ec29cf2c1ba38fe235.zip
Bug 392626 - Debug view stops updating after switching to breadcrumb mode
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/RegisterVectorDisplayMenu.java8
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java53
2 files changed, 36 insertions, 25 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/RegisterVectorDisplayMenu.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/RegisterVectorDisplayMenu.java
index 76bc2dac1..e6b720857 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/RegisterVectorDisplayMenu.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/RegisterVectorDisplayMenu.java
@@ -240,7 +240,7 @@ public class RegisterVectorDisplayMenu extends CompoundContributionItem implemen
}
Map<String,String> map = modes.get(elements.get(n));
- TCFModelProxy proxy = node.getModel().getModelProxy(ctx);
+ TCFModelProxy[] proxies = node.getModel().getModelProxies(ctx);
for (Object obj : selection) {
if (obj instanceof TCFNodeRegister) {
TCFNodeRegister reg = (TCFNodeRegister)obj;
@@ -248,10 +248,10 @@ public class RegisterVectorDisplayMenu extends CompoundContributionItem implemen
String rep_id = map != null ? map.get(id) : null;
if (rep_id == null) representation.remove(id);
else representation.put(id, rep_id);
- if (proxy != null) {
- proxy.addDelta(reg, IModelDelta.CONTENT);
+ for (int i = 0; i < proxies.length; i++) {
+ proxies[i].addDelta(reg, IModelDelta.CONTENT);
TCFNode n = node.getModel().getNode(rep_id);
- if (n != null) proxy.expand(n);
+ if (n != null) proxies[i].expand(n);
}
}
}
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
index 51993e538..3daf8e550 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
@@ -224,8 +224,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
private final Map<String,String> action_results = new HashMap<String,String>();
private final HashMap<String,TCFAction> active_actions = new HashMap<String,TCFAction>();
- private final Map<IPresentationContext,TCFModelProxy> model_proxies =
- new HashMap<IPresentationContext,TCFModelProxy>();
+ private final List<TCFModelProxy> model_proxies = new ArrayList<TCFModelProxy>();
private final Map<String,TCFNode> id2node = new HashMap<String,TCFNode>();
@@ -545,7 +544,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
((TCFNodeExecContext)n).onExpressionAddedOrRemoved();
}
}
- for (TCFModelProxy p : model_proxies.values()) {
+ for (TCFModelProxy p : model_proxies) {
String id = p.getPresentationContext().getId();
if (IDebugUIConstants.ID_EXPRESSION_VIEW.equals(id)) {
Object o = p.getInput();
@@ -595,7 +594,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
setDebugViewSelection(id2node.get(id), reason);
}
}
- for (TCFModelProxy p : model_proxies.values()) p.post();
+ for (TCFModelProxy p : model_proxies) p.post();
annotation_manager.updateAnnotations(null, launch);
TCFNodePropertySource.refresh(node);
}
@@ -790,7 +789,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
IProcesses prs = launch.getService(IProcesses.class);
if (prs != null) prs.addListener(prs_listener);
launchChanged();
- for (TCFModelProxy p : model_proxies.values()) {
+ for (TCFModelProxy p : model_proxies) {
String id = p.getPresentationContext().getId();
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(id)) {
Protocol.invokeLater(new InitialSelection());
@@ -915,16 +914,14 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
void onProxyInstalled(TCFModelProxy mp) {
IPresentationContext pc = mp.getPresentationContext();
- model_proxies.put(mp.getPresentationContext(), mp);
+ model_proxies.add(mp);
if (launch_node != null && pc.getId().equals(IDebugUIConstants.ID_DEBUG_VIEW)) {
Protocol.invokeLater(new InitialSelection());
}
}
void onProxyDisposed(TCFModelProxy mp) {
- IPresentationContext ctx = mp.getPresentationContext();
- assert model_proxies.get(ctx) == mp;
- model_proxies.remove(ctx);
+ model_proxies.remove(mp);
}
private void onContextRemoved(String[] context_ids) {
@@ -932,12 +929,12 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
TCFNode node = getNode(id);
if (node instanceof TCFNodeExecContext) {
((TCFNodeExecContext)node).onContextRemoved();
- for (TCFModelProxy p : model_proxies.values()) p.saveExpandState(node);
+ for (TCFModelProxy p : model_proxies) p.saveExpandState(node);
}
action_results.remove(id);
Object o = context_map.remove(id);
if (o instanceof CreateNodeRunnable) ((CreateNodeRunnable)o).onContextRemoved();
- for (TCFModelProxy proxy : model_proxies.values()) {
+ for (TCFModelProxy proxy : model_proxies) {
proxy.clearAutoExpandStack(id);
}
if (mem_blocks_update != null) mem_blocks_update.changeset.remove(id);
@@ -974,7 +971,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
void launchChanged() {
if (launch_node != null) {
- for (TCFModelProxy p : model_proxies.values()) {
+ for (TCFModelProxy p : model_proxies) {
String id = p.getPresentationContext().getId();
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(id)) {
p.addDelta(launch_node, IModelDelta.STATE | IModelDelta.CONTENT);
@@ -986,12 +983,21 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
}
}
- public TCFModelProxy getModelProxy(IPresentationContext ctx) {
- return model_proxies.get(ctx);
+ public TCFModelProxy[] getModelProxies(IPresentationContext ctx) {
+ TCFModelProxy[] proxies = new TCFModelProxy[0];
+ for (TCFModelProxy proxy : model_proxies) {
+ if (ctx.equals(proxy.getPresentationContext())) {
+ TCFModelProxy[] old_proxies = proxies;
+ proxies = new TCFModelProxy[proxies.length + 1];
+ System.arraycopy(old_proxies, 0, proxies, 0, old_proxies.length);
+ proxies[proxies.length - 1] = proxy;
+ }
+ }
+ return proxies;
}
Collection<TCFModelProxy> getModelProxies() {
- return model_proxies.values();
+ return model_proxies;
}
void dispose() {
@@ -1485,9 +1491,11 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
IPresentationContext ctx = getPresentationContext(part);
if (ctx == null) return;
locks.put(part, new TCFSnapshot(ctx));
- TCFModelProxy proxy = model_proxies.get(ctx);
- if (proxy == null) return;
- proxy.addDelta((TCFNode)proxy.getInput(), IModelDelta.CONTENT);
+ for (TCFModelProxy proxy : model_proxies) {
+ if (ctx.equals(proxy.getPresentationContext())) {
+ proxy.addDelta((TCFNode)proxy.getInput(), IModelDelta.CONTENT);
+ }
+ }
}
public boolean isLocked(IWorkbenchPart part) {
@@ -1500,8 +1508,11 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
snapshot.dispose();
IPresentationContext ctx = getPresentationContext(part);
if (ctx != null) {
- TCFModelProxy proxy = model_proxies.get(ctx);
- if (proxy != null) proxy.addDelta((TCFNode)proxy.getInput(), IModelDelta.CONTENT);
+ for (TCFModelProxy proxy : model_proxies) {
+ if (ctx.equals(proxy.getPresentationContext())) {
+ proxy.addDelta((TCFNode)proxy.getInput(), IModelDelta.CONTENT);
+ }
+ }
}
return true;
}
@@ -1554,7 +1565,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
if (node.isDisposed()) return;
runSuspendTrigger(node);
if (reason == null) return;
- for (TCFModelProxy proxy : model_proxies.values()) {
+ for (TCFModelProxy proxy : model_proxies) {
if (proxy.getPresentationContext().getId().equals(IDebugUIConstants.ID_DEBUG_VIEW)) {
boolean user_request =
reason.equals(IRunControl.REASON_USER_REQUEST) ||

Back to the top