Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2013-11-04 15:45:11 +0000
committerAnton Leherbauer2013-11-04 16:13:58 +0000
commit72a6703f577922374bbac8b89ff4d8a81bedbf0e (patch)
tree08734c863482a0eaceb73f908847e1cac02c6d5a /plugins
parent988b4f2519dd4e8e907d91523f22aff5e6866bf9 (diff)
downloadorg.eclipse.tcf-72a6703f577922374bbac8b89ff4d8a81bedbf0e.tar.gz
org.eclipse.tcf-72a6703f577922374bbac8b89ff4d8a81bedbf0e.tar.xz
org.eclipse.tcf-72a6703f577922374bbac8b89ff4d8a81bedbf0e.zip
TCF Debugger: Bug 420740 - On connect make sure to select a suspended context
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java21
1 files changed, 14 insertions, 7 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 90f48299d..2dbeed102 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
@@ -657,9 +657,14 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
setDebugViewSelectionForProxy(proxy, n, "Launch");
}
else {
+ boolean node_selected = false;
for (TCFNodeExecContext n : nodes) {
String reason = n.getState().getData().suspend_reason;
- setDebugViewSelectionForProxy(proxy, n, reason);
+ node_selected |= setDebugViewSelectionForProxy(proxy, n, reason);
+ }
+ if (!node_selected) {
+ // bug 420740: No node was selected - select the first one
+ setDebugViewSelectionForProxy(proxy, nodes.get(0), "Launch");
}
}
}
@@ -1712,13 +1717,14 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
* @param proxy - model proxy for a given debug view instance
* @param node - model node that represents the debug context.
* @param reason - suspend reason.
+ * @return whether the node was selected
*/
- public void setDebugViewSelectionForProxy(TCFModelProxy proxy, TCFNode node, String reason) {
+ public boolean setDebugViewSelectionForProxy(TCFModelProxy proxy, TCFNode node, String reason) {
assert Protocol.isDispatchThread();
- if (!proxy.getPresentationContext().getId().equals(IDebugUIConstants.ID_DEBUG_VIEW)) return;
- if (node == null) return;
- if (node.isDisposed()) return;
- if (reason == null) return;
+ if (!proxy.getPresentationContext().getId().equals(IDebugUIConstants.ID_DEBUG_VIEW)) return false;
+ if (node == null) return false;
+ if (node.isDisposed()) return false;
+ if (reason == null) return false;
boolean user_request =
reason.equals(IRunControl.REASON_USER_REQUEST) ||
@@ -1726,8 +1732,9 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
reason.equals(IRunControl.REASON_CONTAINER) ||
delay_stack_update_until_last_step && launch.getContextActionsCount(node.id) != 0;
if (proxy.getAutoExpandNode(node, user_request)) proxy.expand(node);
- if (reason.equals(IRunControl.REASON_USER_REQUEST)) return;
+ if (reason.equals(IRunControl.REASON_USER_REQUEST)) return false;
proxy.setSelection(node);
+ return true;
}
/**

Back to the top