diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index 11c0389a7ab..42ec3005e5c 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -129,6 +129,7 @@ enum DebuggerStartMode enum DebuggerCloseMode { KillAtClose, + KillAndExitMonitorAtClose, DetachAtClose }; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 92c0b26d265..104e593b5a5 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1899,6 +1899,7 @@ void GdbEngine::shutdownInferior() m_commandsToRunOnTemporaryBreak.clear(); switch (startParameters().closeMode) { case KillAtClose: + case KillAndExitMonitorAtClose: postCommand("kill", NeedsStop | LosesChild, CB(handleInferiorShutdown)); return; case DetachAtClose: @@ -1944,7 +1945,8 @@ void GdbEngine::notifyAdapterShutdownOk() m_commandsDoneCallback = 0; switch (m_gdbProc->state()) { case QProcess::Running: - postCommand("monitor exit"); + if (startParameters().closeMode == KillAndExitMonitorAtClose) + postCommand("monitor exit"); postCommand("-gdb-exit", GdbEngine::ExitRequest, CB(handleGdbExit)); break; case QProcess::NotRunning: diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp index 131d7805232..ff22748ad6a 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp @@ -86,6 +86,7 @@ DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const AbstractR const IDevice::ConstPtr device = DeviceKitInformation::device(k); QTC_ASSERT(device, return params); + params.closeMode = KillAndExitMonitorAtClose; params.sysRoot = SysRootKitInformation::sysRoot(k).toString(); params.debuggerCommand = DebuggerKitInformation::debuggerCommand(k).toString(); if (ToolChain *tc = ToolChainKitInformation::toolChain(k))