Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-06-18 08:15:46 +0000
committerUwe Stieber2013-06-18 08:15:46 +0000
commit9581f63a6cdf57862b86bf5beb5b572b2b421b23 (patch)
tree183f15c8b518130c4b9843e0d5b064befbbc114e /target_explorer
parentb35168239d3af6396d97dd8a994083a8e6b5b8ea (diff)
downloadorg.eclipse.tcf-9581f63a6cdf57862b86bf5beb5b572b2b421b23.tar.gz
org.eclipse.tcf-9581f63a6cdf57862b86bf5beb5b572b2b421b23.tar.xz
org.eclipse.tcf-9581f63a6cdf57862b86bf5beb5b572b2b421b23.zip
Target Explorer: Fix debugger is attached even if there is no run control on the target
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml404
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java128
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartDebuggerStep.java209
3 files changed, 393 insertions, 348 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
index bf8c6abb9..9046ef953 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
@@ -1,202 +1,202 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-
-<!-- Protocol state change listener contributions -->
- <extension point="org.eclipse.tcf.te.tcf.core.listeners">
- <protocolStateChangeListener
- class="org.eclipse.tcf.te.tcf.locator.listener.ProtocolStateChangeListener"
- id="org.eclipse.tcf.te.tcf.locator.protocolStateChangeListener">
- </protocolStateChangeListener>
- </extension>
-
-<!-- Adapter factory contributions -->
- <extension point="org.eclipse.core.runtime.adapters">
- <factory
- adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"
- class="org.eclipse.tcf.te.tcf.locator.internal.adapters.AdapterFactory">
- <adapter type="org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider"/>
- <adapter type="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext"/>
- <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel"/>
- </factory>
- <factory
- adaptableType="org.eclipse.tcf.protocol.IPeer"
- class="org.eclipse.tcf.te.tcf.locator.internal.adapters.AdapterFactory">
- <adapter type="org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider"/>
- <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- </factory>
- <factory
- adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider"
- class="org.eclipse.tcf.te.tcf.locator.internal.adapters.AdapterFactory">
- <adapter type="org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider"/>
- <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- </factory>
- </extension>
-
-<!-- Model node factory delegate contributions -->
- <extension point="org.eclipse.tcf.te.runtime.model.factoryDelegates">
- <delegate
- class="org.eclipse.tcf.te.tcf.locator.internal.ModelNodeFactoryDelegate"
- id="org.eclipse.tcf.te.tcf.locator.model.factory.delegate">
- <nodeType class="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- </delegate>
- </extension>
-
-<!-- Eclipse core expressions property tester -->
- <extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.tcf.te.tcf.locator.internal.LocatorModelPropertyTester"
- id="org.eclipse.tcf.te.tcf.locator.LocatorModelPropertyTester"
- namespace="org.eclipse.tcf.te.tcf.locator"
- properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isStaticPeer,isRedirected,isProxy,isValueAdd,isOfType"
- type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
- </propertyTester>
-
- <propertyTester
- class="org.eclipse.tcf.te.tcf.locator.internal.LocatorModelPropertyTester"
- id="org.eclipse.tcf.te.tcf.locator.LocatorModelPropertyTester2"
- namespace="org.eclipse.tcf.te.tcf.locator"
- properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isStaticPeer,isRedirected,isProxy,isValueAdd,isOfType"
- type="org.eclipse.tcf.protocol.IPeer">
- </propertyTester>
-
- <propertyTester
- class="org.eclipse.tcf.te.tcf.locator.internal.SimulatorPropertyTester"
- id="org.eclipse.tcf.te.tcf.locator.SimulatorPropertyTester"
- namespace="org.eclipse.tcf.te.tcf.locator"
- properties="isSimulatorState,canStartSimulator"
- type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
- </propertyTester>
- </extension>
-
-<!-- Persistence delegate contributions -->
- <extension point="org.eclipse.tcf.te.runtime.persistence.delegates">
- <delegate
- id="org.eclipse.tcf.te.tcf.locator.persistence.gson.peer"
- class="org.eclipse.tcf.te.tcf.locator.persistence.GsonPeerPersistenceDelegate">
- </delegate>
- </extension>
-
-<!-- Persistence delegate bindings contributions -->
- <extension
- point="org.eclipse.tcf.te.runtime.persistence.bindings">
- <binding
- delegateId="org.eclipse.tcf.te.tcf.locator.persistence.gson.peer"
- id="org.eclipse.tcf.te.tcf.locator.binding.gson.peer">
- <enablement>
- <with variable="container">
- <or>
- <instanceof value="java.net.URI"/>
- <instanceof value="java.lang.String"/>
- <and>
- <instanceof value="java.lang.Class"/>
- <with variable="containerClass">
- <equals value="java.lang.String"/>
- </with>
- </and>
- </or>
- </with>
- <with variable="context">
- <or>
- <instanceof value="org.eclipse.tcf.protocol.IPeer"/>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider"/>
- <and>
- <instanceof value="java.lang.Class"/>
- <with variable="contextClass">
- <equals value="org.eclipse.tcf.protocol.IPeer"/>
- </with>
- </and>
- </or>
- </with>
- </enablement>
- </binding>
- </extension>
-
-<!-- Service contributions -->
- <extension point="org.eclipse.tcf.te.runtime.services.services">
- <service
- class="org.eclipse.tcf.te.tcf.locator.internal.services.PropertiesAccessService"
- id="org.eclipse.tcf.te.runtime.services.tcf.propertiesAccess">
- <serviceType
- bundleId="org.eclipse.tcf.te.runtime.services"
- class="org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService"/>
- <enablement>
- <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
- </enablement>
- </service>
- </extension>
-
-<!-- Step contributions -->
- <extension point="org.eclipse.tcf.te.runtime.stepper.steps">
- <step
- id="org.eclipse.tcf.te.tcf.locator.checkServiceStep"
- class="org.eclipse.tcf.te.tcf.locator.steps.CheckServiceStep"
- label="%CheckServiceStep.name">
- <requires id="org.eclipse.tcf.te.tcf.core.openChannelStep"/>
- </step>
- <step
- id="org.eclipse.tcf.te.tcf.locator.startSimulatorStep"
- class="org.eclipse.tcf.te.tcf.locator.steps.StartSimulatorStep"
- label="%StartSimulatorStep.name"/>
- <step
- id="org.eclipse.tcf.te.tcf.locator.stopSimulatorStep"
- class="org.eclipse.tcf.te.tcf.locator.steps.StopSimulatorStep"
- label="%StopSimulatorStep.name"/>
- <step
- id="org.eclipse.tcf.te.tcf.locator.startDebuggerStep"
- class="org.eclipse.tcf.te.tcf.locator.steps.StartDebuggerStep"
- label="%StartDebuggerStep.name"/>
- <step
- id="org.eclipse.tcf.te.tcf.locator.stopDebuggerStep"
- class="org.eclipse.tcf.te.tcf.locator.steps.StopDebuggerStep"
- label="%StopDebuggerStep.name"/>
- <step
- id="org.eclipse.tcf.te.tcf.locator.setWaitForReadyStep"
- class="org.eclipse.tcf.te.tcf.locator.steps.SetWaitForReadyStep"
- label="%SetWaitForReadyStep.name"/>
- <step
- id="org.eclipse.tcf.te.tcf.locator.waitForReadyStep"
- class="org.eclipse.tcf.te.tcf.locator.steps.WaitForReadyStep"
- label="%WaitForReadyStep.name"/>
- </extension>
-
-<!-- Step group contributions -->
- <extension point="org.eclipse.tcf.te.runtime.stepper.stepGroups">
- <stepGroup
- id="org.eclipse.tcf.te.tcf.locator.connectStepGroup">
- <references>
- <reference id="org.eclipse.tcf.te.tcf.locator.setWaitForReadyStep"/>
- <reference id="org.eclipse.tcf.te.tcf.locator.startSimulatorStepGroup"/>
- <reference id="org.eclipse.tcf.te.tcf.locator.startDebuggerStepGroup"/>
- </references>
- </stepGroup>
-
- <stepGroup
- id="org.eclipse.tcf.te.tcf.locator.disconnectStepGroup">
- <references>
- <reference id="org.eclipse.tcf.te.tcf.locator.stopDebuggerStep"/>
- <reference id="org.eclipse.tcf.te.tcf.core.shutDownStep"/>
- <reference id="org.eclipse.tcf.te.tcf.locator.stopSimulatorStep"/>
- </references>
- </stepGroup>
-
- <stepGroup
- id="org.eclipse.tcf.te.tcf.locator.startSimulatorStepGroup"
- iterator="org.eclipse.tcf.te.tcf.locator.iterators.StartSimulatorIterator">
- <references>
- <reference id="org.eclipse.tcf.te.tcf.locator.startSimulatorStep"/>
- </references>
- </stepGroup>
-
- <stepGroup
- id="org.eclipse.tcf.te.tcf.locator.startDebuggerStepGroup"
- iterator="org.eclipse.tcf.te.tcf.locator.iterators.StartDebuggerIterator">
- <references>
- <reference id="org.eclipse.tcf.te.tcf.locator.waitForReadyStep"/>
- <reference id="org.eclipse.tcf.te.tcf.locator.startDebuggerStep"/>
- </references>
- </stepGroup>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+<!-- Protocol state change listener contributions -->
+ <extension point="org.eclipse.tcf.te.tcf.core.listeners">
+ <protocolStateChangeListener
+ class="org.eclipse.tcf.te.tcf.locator.listener.ProtocolStateChangeListener"
+ id="org.eclipse.tcf.te.tcf.locator.protocolStateChangeListener">
+ </protocolStateChangeListener>
+ </extension>
+
+<!-- Adapter factory contributions -->
+ <extension point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"
+ class="org.eclipse.tcf.te.tcf.locator.internal.adapters.AdapterFactory">
+ <adapter type="org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider"/>
+ <adapter type="org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext"/>
+ <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel"/>
+ </factory>
+ <factory
+ adaptableType="org.eclipse.tcf.protocol.IPeer"
+ class="org.eclipse.tcf.te.tcf.locator.internal.adapters.AdapterFactory">
+ <adapter type="org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider"/>
+ <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ </factory>
+ <factory
+ adaptableType="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider"
+ class="org.eclipse.tcf.te.tcf.locator.internal.adapters.AdapterFactory">
+ <adapter type="org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider"/>
+ <adapter type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ </factory>
+ </extension>
+
+<!-- Model node factory delegate contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.model.factoryDelegates">
+ <delegate
+ class="org.eclipse.tcf.te.tcf.locator.internal.ModelNodeFactoryDelegate"
+ id="org.eclipse.tcf.te.tcf.locator.model.factory.delegate">
+ <nodeType class="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ </delegate>
+ </extension>
+
+<!-- Eclipse core expressions property tester -->
+ <extension point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.tcf.te.tcf.locator.internal.LocatorModelPropertyTester"
+ id="org.eclipse.tcf.te.tcf.locator.LocatorModelPropertyTester"
+ namespace="org.eclipse.tcf.te.tcf.locator"
+ properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isStaticPeer,isRedirected,isProxy,isValueAdd,isOfType"
+ type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ </propertyTester>
+
+ <propertyTester
+ class="org.eclipse.tcf.te.tcf.locator.internal.LocatorModelPropertyTester"
+ id="org.eclipse.tcf.te.tcf.locator.LocatorModelPropertyTester2"
+ namespace="org.eclipse.tcf.te.tcf.locator"
+ properties="name,nameRegex,osName,osNameRegex,hasLocalService,hasRemoteService,hasOfflineService,hasAttribute,isAttribute,isStaticPeer,isRedirected,isProxy,isValueAdd,isOfType"
+ type="org.eclipse.tcf.protocol.IPeer">
+ </propertyTester>
+
+ <propertyTester
+ class="org.eclipse.tcf.te.tcf.locator.internal.SimulatorPropertyTester"
+ id="org.eclipse.tcf.te.tcf.locator.SimulatorPropertyTester"
+ namespace="org.eclipse.tcf.te.tcf.locator"
+ properties="isSimulatorState,canStartSimulator"
+ type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ </propertyTester>
+ </extension>
+
+<!-- Persistence delegate contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.persistence.delegates">
+ <delegate
+ id="org.eclipse.tcf.te.tcf.locator.persistence.gson.peer"
+ class="org.eclipse.tcf.te.tcf.locator.persistence.GsonPeerPersistenceDelegate">
+ </delegate>
+ </extension>
+
+<!-- Persistence delegate bindings contributions -->
+ <extension
+ point="org.eclipse.tcf.te.runtime.persistence.bindings">
+ <binding
+ delegateId="org.eclipse.tcf.te.tcf.locator.persistence.gson.peer"
+ id="org.eclipse.tcf.te.tcf.locator.binding.gson.peer">
+ <enablement>
+ <with variable="container">
+ <or>
+ <instanceof value="java.net.URI"/>
+ <instanceof value="java.lang.String"/>
+ <and>
+ <instanceof value="java.lang.Class"/>
+ <with variable="containerClass">
+ <equals value="java.lang.String"/>
+ </with>
+ </and>
+ </or>
+ </with>
+ <with variable="context">
+ <or>
+ <instanceof value="org.eclipse.tcf.protocol.IPeer"/>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProvider"/>
+ <and>
+ <instanceof value="java.lang.Class"/>
+ <with variable="contextClass">
+ <equals value="org.eclipse.tcf.protocol.IPeer"/>
+ </with>
+ </and>
+ </or>
+ </with>
+ </enablement>
+ </binding>
+ </extension>
+
+<!-- Service contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.services.services">
+ <service
+ class="org.eclipse.tcf.te.tcf.locator.internal.services.PropertiesAccessService"
+ id="org.eclipse.tcf.te.runtime.services.tcf.propertiesAccess">
+ <serviceType
+ bundleId="org.eclipse.tcf.te.runtime.services"
+ class="org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService"/>
+ <enablement>
+ <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/>
+ </enablement>
+ </service>
+ </extension>
+
+<!-- Step contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.stepper.steps">
+ <step
+ id="org.eclipse.tcf.te.tcf.locator.checkServiceStep"
+ class="org.eclipse.tcf.te.tcf.locator.steps.CheckServiceStep"
+ label="%CheckServiceStep.name">
+ <requires id="org.eclipse.tcf.te.tcf.core.openChannelStep"/>
+ </step>
+ <step
+ id="org.eclipse.tcf.te.tcf.locator.startSimulatorStep"
+ class="org.eclipse.tcf.te.tcf.locator.steps.StartSimulatorStep"
+ label="%StartSimulatorStep.name"/>
+ <step
+ id="org.eclipse.tcf.te.tcf.locator.stopSimulatorStep"
+ class="org.eclipse.tcf.te.tcf.locator.steps.StopSimulatorStep"
+ label="%StopSimulatorStep.name"/>
+ <step
+ id="org.eclipse.tcf.te.tcf.locator.startDebuggerStep"
+ class="org.eclipse.tcf.te.tcf.locator.steps.StartDebuggerStep"
+ label="%StartDebuggerStep.name"/>
+ <step
+ id="org.eclipse.tcf.te.tcf.locator.stopDebuggerStep"
+ class="org.eclipse.tcf.te.tcf.locator.steps.StopDebuggerStep"
+ label="%StopDebuggerStep.name"/>
+ <step
+ id="org.eclipse.tcf.te.tcf.locator.setWaitForReadyStep"
+ class="org.eclipse.tcf.te.tcf.locator.steps.SetWaitForReadyStep"
+ label="%SetWaitForReadyStep.name"/>
+ <step
+ id="org.eclipse.tcf.te.tcf.locator.waitForReadyStep"
+ class="org.eclipse.tcf.te.tcf.locator.steps.WaitForReadyStep"
+ label="%WaitForReadyStep.name"/>
+ </extension>
+
+<!-- Step group contributions -->
+ <extension point="org.eclipse.tcf.te.runtime.stepper.stepGroups">
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.locator.connectStepGroup">
+ <references>
+ <reference id="org.eclipse.tcf.te.tcf.locator.setWaitForReadyStep"/>
+ <reference id="org.eclipse.tcf.te.tcf.locator.startSimulatorStepGroup"/>
+ <reference id="org.eclipse.tcf.te.tcf.locator.startDebuggerStepGroup"/>
+ </references>
+ </stepGroup>
+
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.locator.disconnectStepGroup">
+ <references>
+ <reference id="org.eclipse.tcf.te.tcf.locator.stopDebuggerStep"/>
+ <reference id="org.eclipse.tcf.te.tcf.core.shutDownStep"/>
+ <reference id="org.eclipse.tcf.te.tcf.locator.stopSimulatorStep"/>
+ </references>
+ </stepGroup>
+
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.locator.startSimulatorStepGroup"
+ iterator="org.eclipse.tcf.te.tcf.locator.iterators.StartSimulatorIterator">
+ <references>
+ <reference id="org.eclipse.tcf.te.tcf.locator.startSimulatorStep"/>
+ </references>
+ </stepGroup>
+
+ <stepGroup
+ id="org.eclipse.tcf.te.tcf.locator.startDebuggerStepGroup"
+ iterator="org.eclipse.tcf.te.tcf.locator.iterators.StartDebuggerIterator">
+ <references>
+ <reference id="org.eclipse.tcf.te.tcf.locator.waitForReadyStep"/>
+ <reference id="org.eclipse.tcf.te.tcf.locator.startDebuggerStep"/>
+ </references>
+ </stepGroup>
+ </extension>
+
+</plugin>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java
index b4aa313ff..35e14e2bb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java
@@ -1,64 +1,64 @@
-/*******************************************************************************
- * Copyright (c) 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 http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tcf.te.tcf.locator.iterators;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
-
-/**
- * Step group iterator for debugger attach.
- */
-public class StartDebuggerIterator extends AbstractPeerModelStepGroupIterator {
-
- /**
- * Constructor.
- */
- public StartDebuggerIterator() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#initialize(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void initialize(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- super.initialize(context, data, fullQualifiedId, monitor);
-
- final AtomicBoolean autoStartDbg = new AtomicBoolean(false);
-
- final IPeer peer = getActivePeerContext(context, data, fullQualifiedId);
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- String value = peer.getAttributes().get(IPeerModelProperties.PROP_AUTO_START_DEBUGGER);
- autoStartDbg.set(value != null ? Boolean.parseBoolean(value) : false);
- }
- };
- Protocol.invokeAndWait(runnable);
-
- setIterations(autoStartDbg.get() ? 1 : 0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#internalNext(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void internalNext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- }
-}
+/*******************************************************************************
+ * Copyright (c) 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 http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tcf.te.tcf.locator.iterators;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
+
+/**
+ * Step group iterator for debugger attach.
+ */
+public class StartDebuggerIterator extends AbstractPeerModelStepGroupIterator {
+
+ /**
+ * Constructor.
+ */
+ public StartDebuggerIterator() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#initialize(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void initialize(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ super.initialize(context, data, fullQualifiedId, monitor);
+
+ final AtomicBoolean autoStartDbg = new AtomicBoolean(false);
+
+ final IPeerModel node = getActivePeerModelContext(context, data, fullQualifiedId);
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ String value = node.getPeer().getAttributes().get(IPeerModelProperties.PROP_AUTO_START_DEBUGGER);
+ autoStartDbg.set(value != null ? Boolean.parseBoolean(value) : false);
+ }
+ };
+ Protocol.invokeAndWait(runnable);
+
+ setIterations(autoStartDbg.get() ? 1 : 0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#internalNext(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void internalNext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartDebuggerStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartDebuggerStep.java
index 40e62a59d..af866e541 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartDebuggerStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartDebuggerStep.java
@@ -1,82 +1,127 @@
-/*******************************************************************************
- * Copyright (c) 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 http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.locator.steps;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.stepper.steps.AbstractStep;
-
-/**
- * Start debugger step implementation.
- */
-public class StartDebuggerStep extends AbstractStep {
-
- /**
- * Constructor.
- */
- public StartDebuggerStep() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void validateExecute(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor) throws CoreException {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void execute(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor, final ICallback callback) {
- final Object activeContext = getActiveContext(context, data, fullQualifiedId);
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- IDebugService dbgService = ServiceManager.getInstance().getService(activeContext, IDebugService.class, false);
- if (dbgService != null) {
- // Attach the debugger and all cores (OCDDevices)
- IPropertiesContainer props = new PropertiesContainer();
- dbgService.attach(activeContext, props, monitor, callback);
- }
- else {
- callback.done(StartDebuggerStep.this, Status.OK_STATUS);
- }
- }
- };
- Protocol.invokeLater(runnable);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.steps.AbstractStep#rollback(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IStatus, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void rollback(IStepContext context, IPropertiesContainer data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
- final Object activeContext = getActiveContext(context, data, fullQualifiedId);
- IDebugService dbgService = ServiceManager.getInstance().getService(activeContext, IDebugService.class, false);
- if (dbgService != null) {
- IPropertiesContainer props = new PropertiesContainer();
- dbgService.detach(activeContext, props, null, callback);
- }
- else {
- callback.done(this, Status.OK_STATUS);
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 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 http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.locator.steps;
+
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.services.IRunControl;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService;
+
+/**
+ * Start debugger step implementation.
+ */
+public class StartDebuggerStep extends AbstractPeerModelStep {
+
+ /**
+ * Constructor.
+ */
+ public StartDebuggerStep() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void validateExecute(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor) throws CoreException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void execute(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor, final ICallback callback) {
+ final IPeerModel node = getActivePeerModelContext(context, data, fullQualifiedId);
+ Assert.isNotNull(node);
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ // Don't attach the debugger if no run control is provided by the target
+ final ILocatorModelPeerNodeQueryService queryService = node.getModel().getService(ILocatorModelPeerNodeQueryService.class);
+ Assert.isNotNull(queryService);
+ queryService.queryServicesAsync(node, new ILocatorModelPeerNodeQueryService.DoneQueryServices() {
+ @Override
+ public void doneQueryServices(Throwable error) {
+ if (error == null) {
+ // Get the list of available remote services
+ String remoteServices = node.getStringProperty(IPeerModelProperties.PROP_REMOTE_SERVICES);
+ Assert.isNotNull(remoteServices);
+ boolean canAttachDbg = false;
+ StringTokenizer tokenizer = new StringTokenizer(remoteServices, ","); //$NON-NLS-1$
+ while (tokenizer.hasMoreTokens()) {
+ String svc = tokenizer.nextToken().trim();
+ if (IRunControl.NAME.equals(svc)) {
+ canAttachDbg = true;
+ break;
+ }
+ }
+
+ if (canAttachDbg) {
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ IDebugService dbgService = ServiceManager.getInstance().getService(node, IDebugService.class, false);
+ if (dbgService != null) {
+ // Attach the debugger and all cores (OCDDevices)
+ IPropertiesContainer props = new PropertiesContainer();
+ dbgService.attach(node, props, monitor, callback);
+ }
+ else {
+ callback.done(StartDebuggerStep.this, Status.OK_STATUS);
+ }
+ }
+ };
+ Protocol.invokeLater(runnable);
+ } else {
+ callback.done(StartDebuggerStep.this, Status.OK_STATUS);
+ }
+ } else {
+ callback.done(StartDebuggerStep.this, StatusHelper.getStatus(error));
+ }
+ }
+ });
+ }
+ };
+
+ Protocol.invokeLater(runnable);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.steps.AbstractStep#rollback(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IStatus, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void rollback(IStepContext context, IPropertiesContainer data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
+ final IPeerModel node = getActivePeerModelContext(context, data, fullQualifiedId);
+ IDebugService dbgService = ServiceManager.getInstance().getService(node, IDebugService.class, false);
+ if (dbgService != null) {
+ IPropertiesContainer props = new PropertiesContainer();
+ dbgService.detach(node, props, null, callback);
+ }
+ else {
+ callback.done(this, Status.OK_STATUS);
+ }
+ }
+}

Back to the top