1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 533766 - Deadlock at IDE shutdown with active debug session

When shutting down eclipse and there is an active debug session, eclipse
might deadlock if it can't destroy the debug session and would normally
leave a zombie process for the eclipse instance.  This fix allows
eclipse to properly shutdown if the debug session is destroyed in less
than 1 minute, else the IDE will simply be terminated.

Change-Id: Icb9b019c7ff2ec9cdc9870a392a657fe0dfde81b
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
This commit is contained in:
Torbjörn Svensson 2018-04-18 16:12:20 +02:00
parent bb5f2d7f78
commit 72a51e79d9

View file

@ -10,11 +10,14 @@
* Abeer Bagul (Tensilica) - Updated error message (Bug 339048)
* Jason Litton (Sage Electronic Engineering, LLC) - Added support for dynamic tracing option (Bug 379169)
* Alvaro Sanchez-Leon (Ericsson AB) - Each memory context needs a different MemoryRetrieval (Bug 250323)
* Torbjörn Svensson (STMicroelectronics) - Bug 533766
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.internal;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.Query;
@ -133,11 +136,13 @@ public class GdbPlugin extends Plugin {
// The Query.get() method is a synchronous call which blocks until the
// query completes.
try {
launchShutdownQuery.get();
launchShutdownQuery.get(1, TimeUnit.MINUTES);
} catch (InterruptedException e) {
getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, "InterruptedException while shutting down launch " + gdbLaunch, e.getCause())); //$NON-NLS-1$
} catch (ExecutionException e) {
getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, "Exception while shutting down launch " + gdbLaunch, e.getCause())); //$NON-NLS-1$
} catch (TimeoutException e) {
getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, "TimeoutException while shutting down launch " + gdbLaunch, e.getCause())); //$NON-NLS-1$
}
}
}