Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2013-01-24 17:38:54 -0500
committerEugene Tarassov2013-01-25 01:55:01 -0500
commit635f6fc03d88818645e24c000cac94259853ea7f (patch)
tree5362002cdae82e461b6f5c78a0298865babd968e /plugins
parent6950f4064139fefaf6edcd2710a0231abaf42bbe (diff)
downloadorg.eclipse.tcf-635f6fc03d88818645e24c000cac94259853ea7f.tar.gz
org.eclipse.tcf-635f6fc03d88818645e24c000cac94259853ea7f.tar.xz
org.eclipse.tcf-635f6fc03d88818645e24c000cac94259853ea7f.zip
TCF Debugger: fixed: when 2 debuggers are connected to same target, changing a register value in one debugger does not update stack trace in the Debug view of the second debugger
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java29
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java10
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExecContext.java5
3 files changed, 33 insertions, 11 deletions
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 b1443ccb2..6bfbf3419 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2013 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -510,11 +510,24 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
}
}
- public void registerChanged(String context) {
- TCFNode node = getNode(context);
- if (node instanceof TCFNodeRegister) {
- ((TCFNodeRegister)node).onValueChanged();
- }
+ public void registerChanged(final String id) {
+ /*
+ * We need to propagate register changes to parent node,
+ * because, for example, stack frames might need to be updated.
+ * For that we need to know parent of the register.
+ * It means we have to create register node if it does not exist yet.
+ */
+ // TODO: async handling of registerChanged event - potential data coherency issue
+ Runnable done = new Runnable() {
+ @Override
+ public void run() {
+ TCFNode node = getNode(id);
+ if (node instanceof TCFNodeRegister) {
+ ((TCFNodeRegister)node).onValueChanged();
+ }
+ }
+ };
+ if (createNode(id, done)) done.run();
}
};
@@ -1297,7 +1310,9 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
assert res != null;
assert res != this;
context_map.put(id, res);
- for (Runnable r : waiting_list) r.run();
+ for (Runnable r : waiting_list) {
+ if (createNode(id, r)) r.run();
+ }
}
void onContextRemoved() {
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java
index 7775ed209..098a27639 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2013 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -190,6 +190,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
private final ChildrenUpdate children_update = new ChildrenUpdate();
private TCFNode pending_node;
+ private boolean pending_count;
TCFModelProxy(TCFModel model) {
this.model = model;
@@ -358,13 +359,14 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
}
else if (!node.getLockedData(children_count_update, null)) {
pending_node = node;
+ pending_count = true;
res = EMPTY_NODE_ARRAY;
}
else {
children_update.setLength(children_count_update.count);
if (!node.getLockedData(children_update, null)) {
- assert false;
pending_node = node;
+ pending_count = false;
res = EMPTY_NODE_ARRAY;
}
else {
@@ -613,7 +615,9 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
post();
}
}
- else if (pending_node.getLockedData(children_count_update, this)) {
+ else if (pending_count ?
+ pending_node.getLockedData(children_count_update, this) :
+ pending_node.getLockedData(children_update, this)) {
assert false;
Protocol.invokeLater(this);
}
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExecContext.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExecContext.java
index baa1a8bdd..9f02da9f1 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExecContext.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExecContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2013 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -934,6 +934,9 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
last_stack_trace = empty_node_array;
return true;
}
+ // Force creation of register nodes.
+ // It helps dispatching of registerChanged events to stack frames.
+ if (!children_regs.validate(done)) return false;
children = children_stack;
}
else {

Back to the top