Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-02-19 09:38:38 +0000
committerTobias Schwarz2014-02-19 09:38:38 +0000
commit78d21d19353495c7c387405d181bf19f77ea2a65 (patch)
treec0d66a7594a1bfb9ecd2065f27de9cc06315eef0
parent84f8bf518148c1958727fa59faa302c21594dc53 (diff)
downloadorg.eclipse.tcf-78d21d19353495c7c387405d181bf19f77ea2a65.tar.gz
org.eclipse.tcf-78d21d19353495c7c387405d181bf19f77ea2a65.tar.xz
org.eclipse.tcf-78d21d19353495c7c387405d181bf19f77ea2a65.zip
Target Explorer: fix launch cancel handling
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartDebuggerStep.java2
2 files changed, 7 insertions, 3 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
index 5c7de0599..559c0e34c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
@@ -126,7 +126,7 @@ public class DebugService extends AbstractService implements IDebugService {
delegate.validate(ILaunchManager.DEBUG_MODE, finConfig);
- DebugPlugin.getDefault().getLaunchManager().addLaunchListener(new ILaunchListener() {
+ final ILaunchListener listener = new ILaunchListener() {
@Override
public void launchAdded(ILaunch launch) {
if (launch != null && finConfig.equals(launch.getLaunchConfiguration())) {
@@ -147,8 +147,12 @@ public class DebugService extends AbstractService implements IDebugService {
@Override
public void launchRemoved(ILaunch launch) {
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
+ callback.done(this, Status.CANCEL_STATUS);
}
- });
+ };
+
+ DebugPlugin.getDefault().getLaunchManager().addLaunchListener(listener);
// DebugUITools.launch(...) must be called from within the UI thread.
DisplayUtil.safeAsyncExec(new Runnable() {
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 4278229d0..68ba3f1e5 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
@@ -106,7 +106,7 @@ public class StartDebuggerStep extends AbstractPeerNodeStep {
dbgService.attach(node, props, monitor, new Callback() {
@Override
protected void internalDone(Object caller, IStatus status) {
- if (autoAttachAll) {
+ if ((status == null || status.isOK()) && autoAttachAll) {
// Check if there is a delegate registered
IDelegateService service = ServiceManager.getInstance().getService(node, IDelegateService.class, false);
IDelegate delegate = service != null ? service.getDelegate(node, IDelegate.class) : null;

Back to the top