Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorbjörn Svensson2018-04-18 10:12:20 -0400
committerTorbjörn Svensson2018-04-18 11:54:44 -0400
commit72a51e79d9694032b967c19b789b58701a297eee (patch)
tree51df9c41821dfade26df43d2f81d9096b945a319 /dsf-gdb
parentbb5f2d7f7873935dc10ca6417723c7a57bf9d49e (diff)
downloadorg.eclipse.cdt-72a51e79d9694032b967c19b789b58701a297eee.tar.gz
org.eclipse.cdt-72a51e79d9694032b967c19b789b58701a297eee.tar.xz
org.eclipse.cdt-72a51e79d9694032b967c19b789b58701a297eee.zip
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>
Diffstat (limited to 'dsf-gdb')
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/GdbPlugin.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/GdbPlugin.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/GdbPlugin.java
index fe0a8db388..b0a10f8dc5 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/GdbPlugin.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/GdbPlugin.java
@@ -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$
}
}
}

Back to the top