Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2012-01-27 13:33:35 -0500
committerMarc Khouzam2012-01-27 13:33:35 -0500
commitf13bdf3b334e088e06f032879ebe20f2836ca414 (patch)
tree2c6e3832fd8366a81059b98c482f6d1763a0a222
parent1928101334b17b7a97e4651d95dec114669cabec (diff)
downloadorg.eclipse.cdt-f13bdf3b334e088e06f032879ebe20f2836ca414.tar.gz
org.eclipse.cdt-f13bdf3b334e088e06f032879ebe20f2836ca414.tar.xz
org.eclipse.cdt-f13bdf3b334e088e06f032879ebe20f2836ca414.zip
Bug 368597: Although we don't complete the launch, we still need to shutdown the DSF session as it was started already.
-rw-r--r--cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java16
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java23
2 files changed, 31 insertions, 8 deletions
diff --git a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java
index 79b5907a4d..7228896f96 100644
--- a/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java
+++ b/cross/org.eclipse.cdt.launch.remote/src/org/eclipse/cdt/launch/remote/launching/RemoteGdbLaunchDelegate.java
@@ -13,11 +13,14 @@
*******************************************************************************/
package org.eclipse.cdt.launch.remote.launching;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.RejectedExecutionException;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
+import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.DsfRunnable;
import org.eclipse.cdt.dsf.concurrent.ImmediateRequestMonitor;
+import org.eclipse.cdt.dsf.concurrent.Query;
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch;
import org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate;
@@ -178,6 +181,19 @@ public class RemoteGdbLaunchDelegate extends GdbLaunchDelegate {
if (remoteShellProcess != null) {
remoteShellProcess.destroy();
}
+
+ // Need to shutdown the DSF launch session because it is
+ // partially started already.
+ try {
+ l.getSession().getExecutor().execute(new DsfRunnable() {
+ public void run() {
+ l.shutdownSession(new ImmediateRequestMonitor());
+ }
+ });
+ } catch (RejectedExecutionException e) {
+ // Session disposed.
+ }
+
RSEHelper.abort(Messages.RemoteGdbLaunchDelegate_gdbserverFailedToStartErrorMessage, null,
ICDTLaunchConfigurationConstants.ERR_DEBUGGER_NOT_INSTALLED);
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java
index c12d53cf51..11db047ca3 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 Wind River Systems and others.
+ * Copyright (c) 2006, 2012 Wind River Systems 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * Marc Khouzam (Ericsson) - Fix NPE for partial launches (Bug 368597)
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.launching;
@@ -256,13 +257,19 @@ public class GdbLaunch extends DsfLaunch
fTracker = null;
DsfSession.endSession(fSession);
- // DsfMemoryBlockRetrieval.saveMemoryBlocks();
- fMemRetrieval.saveMemoryBlocks();
-
- // Fire a terminate event for the memory retrieval object so
- // that the hosting memory views can clean up. See 255120 and
- // 283586
- DebugPlugin.getDefault().fireDebugEventSet( new DebugEvent[] { new DebugEvent(fMemRetrieval, DebugEvent.TERMINATE) });
+ // The memory retrieval can be null if the launch was aborted
+ // in the middle. We saw this when doing an automatic remote
+ // launch with an invalid gdbserver
+ // Bug 368597
+ if (fMemRetrieval != null) {
+ // DsfMemoryBlockRetrieval.saveMemoryBlocks();
+ fMemRetrieval.saveMemoryBlocks();
+
+ // Fire a terminate event for the memory retrieval object so
+ // that the hosting memory views can clean up. See 255120 and
+ // 283586
+ DebugPlugin.getDefault().fireDebugEventSet( new DebugEvent[] { new DebugEvent(fMemRetrieval, DebugEvent.TERMINATE) });
+ }
// 'fireTerminate()' removes this launch from the list of 'DebugEvent'
// listeners. The launch may not be terminated at this point: the inferior

Back to the top