From b94d0419e9643b62f85db0264cc1eca47a758494 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Tue, 16 Mar 2010 03:14:08 +0000 Subject: [PATCH] [305949] Allow to cleanly cancel a progress monitor during a launch --- .../eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java index 918741ebf98..eaeba2e8434 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java @@ -13,6 +13,7 @@ *******************************************************************************/ package org.eclipse.cdt.dsf.gdb.launching; +import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import org.eclipse.cdt.core.model.ICProject; @@ -140,6 +141,9 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2 throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Interrupted Exception in dispatch thread", e1)); //$NON-NLS-1$ } catch (ExecutionException e1) { throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error in services launch sequence", e1.getCause())); //$NON-NLS-1$ + } catch (CancellationException e1) { + // Launch aborted, so exit cleanly + return; } if (monitor.isCanceled()) @@ -173,6 +177,9 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2 throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Interrupted Exception in dispatch thread", e1)); //$NON-NLS-1$ } catch (ExecutionException e1) { throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error in final launch sequence", e1.getCause())); //$NON-NLS-1$ + } catch (CancellationException e1) { + // Launch aborted, so exit cleanly + return; } finally { if (!succeed) { // finalLaunchSequence failed. Shutdown the session so that all started