diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java index 1b2eb78c50d..69ffd05e3db 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java @@ -361,7 +361,10 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses { // If we will terminate GDB as soon as the inferior terminates, then let's // just terminate GDB itself. This is more robust since we actually monitor // the success of terminating GDB. - if (Platform.getPreferencesService().getBoolean("org.eclipse.cdt.dsf.gdb.ui", //$NON-NLS-1$ + // Also, for a core session, there is no concept of killing the inferior, + // so lets kill GDB + if (fBackend.getSessionType() == SessionType.CORE || + Platform.getPreferencesService().getBoolean("org.eclipse.cdt.dsf.gdb.ui", //$NON-NLS-1$ IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, true, null)) { fGdb.terminate(new RequestMonitor(ImmediateExecutor.getInstance(), null)); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java index def6dba6d18..6a773351061 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java @@ -1175,10 +1175,13 @@ public class GDBProcesses_7_0 extends AbstractDsfService // If we will terminate GDB as soon as the last inferior terminates, then let's // just terminate GDB itself if this is the last inferior. // This is more robust since we actually monitor the success of terminating GDB. - if (fNumConnected == 1 && + // Also, for a core session, there is no concept of killing the inferior, + // so lets kill GDB + if (fBackend.getSessionType() == SessionType.CORE || + (fNumConnected == 1 && Platform.getPreferencesService().getBoolean("org.eclipse.cdt.dsf.gdb.ui", //$NON-NLS-1$ IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, - true, null)) { + true, null))) { fCommandControl.terminate(new RequestMonitor(ImmediateExecutor.getInstance(), null)); } else if (thread instanceof IMIProcessDMContext) { getDebuggingContext(