Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2016-04-15 08:02:31 +0000
committerAnton Leherbauer2016-04-19 06:20:02 +0000
commit32af2c3ae3bce3ab42aa01cafd1b82ee031be7bd (patch)
tree85de4c79c7f48f33d0e0be814e72c7ff43d4e082 /plugins
parent5ee4a8001eb982aa435064cd5098f8a98e3fd828 (diff)
downloadorg.eclipse.tcf-32af2c3ae3bce3ab42aa01cafd1b82ee031be7bd.tar.gz
org.eclipse.tcf-32af2c3ae3bce3ab42aa01cafd1b82ee031be7bd.tar.xz
org.eclipse.tcf-32af2c3ae3bce3ab42aa01cafd1b82ee031be7bd.zip
Bug 491696 - Suspend trigger is not activated for the initial Debug view selection
Change-Id: I7d2d1c4bde71016f2fe4dea38e7444fb11ccf14d Signed-off-by: Anton Leherbauer <anton.leherbauer@windriver.com>
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, 19 insertions, 2 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 3be0377ad..7ea64841c 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
@@ -209,6 +209,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
private final TCFAnnotationManager annotation_manager;
private InitialSelection initial_selection;
+ private InitialSuspendTrigger initial_suspend_trigger;
private final List<ISuspendTriggerListener> suspend_trigger_listeners =
new LinkedList<ISuspendTriggerListener>();
@@ -668,7 +669,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
}
};
- private class InitialSelection implements Runnable {
+ private class InitialSelection extends InitialRunnable {
final TCFModelProxy proxy;
boolean launch_selected;
boolean done;
@@ -709,7 +710,21 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
initial_selection = null;
done = true;
}
- private boolean searchSuspendedThreads(TCFChildren c, ArrayList<TCFNodeExecContext> nodes) {
+ };
+ private class InitialSuspendTrigger extends InitialRunnable {
+ public InitialSuspendTrigger() {
+ initial_suspend_trigger = this;
+ }
+ @Override
+ public void run() {
+ if (launch_node == null || initial_suspend_trigger != this) return;
+ ArrayList<TCFNodeExecContext> nodes = new ArrayList<TCFNodeExecContext>();
+ if (!searchSuspendedThreads(launch_node.getFilteredChildren(), nodes)) return;
+ if (nodes.size() > 0) runSuspendTrigger(nodes.get(0));
+ }
+ };
+ private abstract class InitialRunnable implements Runnable {
+ protected boolean searchSuspendedThreads(TCFChildren c, ArrayList<TCFNodeExecContext> nodes) {
if (!c.validate(this)) return false;
for (TCFNode n : c.toArray()) {
if (!searchSuspendedThreads((TCFNodeExecContext)n, nodes)) return false;
@@ -929,6 +944,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
IProcesses prs = launch.getService(IProcesses.class);
if (prs != null) prs.addListener(prs_listener);
launchChanged();
+ Protocol.invokeLater(new InitialSuspendTrigger());
for (TCFModelProxy p : model_proxies) {
String id = p.getPresentationContext().getId();
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(id)) {
@@ -2287,6 +2303,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
* @param node - suspended context.
*/
private synchronized void runSuspendTrigger(final TCFNode node) {
+ initial_suspend_trigger = null;
if (suspend_trigger_listeners.size() == 0) return;
final ISuspendTriggerListener[] listeners = suspend_trigger_listeners.toArray(
new ISuspendTriggerListener[suspend_trigger_listeners.size()]);

Back to the top