Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2013-11-04 10:45:11 -0500
committerAnton Leherbauer2013-11-04 11:14:34 -0500
commitc0c02ecc5da052d4c21ad4a71d288b47b10ae210 (patch)
tree945b7c051ddef313499e1608bffbeb3d5ac08d92 /plugins
parent540419dc1116a44c06d03862b30f4f98b7520677 (diff)
downloadorg.eclipse.tcf-c0c02ecc5da052d4c21ad4a71d288b47b10ae210.tar.gz
org.eclipse.tcf-c0c02ecc5da052d4c21ad4a71d288b47b10ae210.tar.xz
org.eclipse.tcf-c0c02ecc5da052d4c21ad4a71d288b47b10ae210.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 a03269824..714fad081 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
@@ -656,9 +656,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");
}
}
}
@@ -1641,13 +1646,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) ||
@@ -1655,8 +1661,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