From 6df967d0d40701ba0c09ad943286f332fec4ae87 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Mon, 8 Jul 2013 14:43:29 -0400 Subject: [PATCH] Bug 374807 - [attach] Terminating the last attached process causes a detach instead by killing GDB Change-Id: I213f9b3a4abe294fc75b10c89fd64fd4202b941d Reviewed-on: https://git.eclipse.org/r/14383 Reviewed-by: Mikhail Khodjaiants IP-Clean: Mikhail Khodjaiants Tested-by: Mikhail Khodjaiants Reviewed-by: Marc Khouzam IP-Clean: Marc Khouzam Tested-by: Marc Khouzam --- .../org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java | 10 ++-------- .../eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java | 11 ++--------- 2 files changed, 4 insertions(+), 17 deletions(-) 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 da76d7b4528..b0c63d0ab41 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 @@ -390,15 +390,9 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses { @Override public void terminate(IThreadDMContext thread, final RequestMonitor rm) { - // 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. - // Also, for a core session, there is no concept of killing the inferior, + // For a core session, there is no concept of killing the inferior, // so lets kill GDB - if (fBackend.getSessionType() == SessionType.CORE || - Platform.getPreferencesService().getBoolean(GdbPlugin.PLUGIN_ID, - IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, - true, null)) { + if (fBackend.getSessionType() == SessionType.CORE) { fGdb.terminate(rm); } else if (thread instanceof IMIProcessDMContext) { getDebuggingContext( 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 1793892e9dd..1a33469dc30 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 @@ -1243,16 +1243,9 @@ public class GDBProcesses_7_0 extends AbstractDsfService @Override public void terminate(IThreadDMContext thread, final RequestMonitor rm) { - // 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. - // Also, for a core session, there is no concept of killing the inferior, + // 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(GdbPlugin.PLUGIN_ID, - IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, - true, null))) { + if (fBackend.getSessionType() == SessionType.CORE) { fCommandControl.terminate(rm); } else if (thread instanceof IMIProcessDMContext) { getDebuggingContext(