Debugger: Don't issue monitor commands for local debugging

Change-Id: I8a81ae78a279b6f5cc354dde3ba0814b3a650d06
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
This commit is contained in:
hjk
2014-10-09 00:13:33 +02:00
parent eb3584d2d8
commit 1bb2f04d4d
3 changed files with 5 additions and 1 deletions

View File

@@ -129,6 +129,7 @@ enum DebuggerStartMode
enum DebuggerCloseMode enum DebuggerCloseMode
{ {
KillAtClose, KillAtClose,
KillAndExitMonitorAtClose,
DetachAtClose DetachAtClose
}; };

View File

@@ -1899,6 +1899,7 @@ void GdbEngine::shutdownInferior()
m_commandsToRunOnTemporaryBreak.clear(); m_commandsToRunOnTemporaryBreak.clear();
switch (startParameters().closeMode) { switch (startParameters().closeMode) {
case KillAtClose: case KillAtClose:
case KillAndExitMonitorAtClose:
postCommand("kill", NeedsStop | LosesChild, CB(handleInferiorShutdown)); postCommand("kill", NeedsStop | LosesChild, CB(handleInferiorShutdown));
return; return;
case DetachAtClose: case DetachAtClose:
@@ -1944,7 +1945,8 @@ void GdbEngine::notifyAdapterShutdownOk()
m_commandsDoneCallback = 0; m_commandsDoneCallback = 0;
switch (m_gdbProc->state()) { switch (m_gdbProc->state()) {
case QProcess::Running: case QProcess::Running:
postCommand("monitor exit"); if (startParameters().closeMode == KillAndExitMonitorAtClose)
postCommand("monitor exit");
postCommand("-gdb-exit", GdbEngine::ExitRequest, CB(handleGdbExit)); postCommand("-gdb-exit", GdbEngine::ExitRequest, CB(handleGdbExit));
break; break;
case QProcess::NotRunning: case QProcess::NotRunning:

View File

@@ -86,6 +86,7 @@ DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const AbstractR
const IDevice::ConstPtr device = DeviceKitInformation::device(k); const IDevice::ConstPtr device = DeviceKitInformation::device(k);
QTC_ASSERT(device, return params); QTC_ASSERT(device, return params);
params.closeMode = KillAndExitMonitorAtClose;
params.sysRoot = SysRootKitInformation::sysRoot(k).toString(); params.sysRoot = SysRootKitInformation::sysRoot(k).toString();
params.debuggerCommand = DebuggerKitInformation::debuggerCommand(k).toString(); params.debuggerCommand = DebuggerKitInformation::debuggerCommand(k).toString();
if (ToolChain *tc = ToolChainKitInformation::toolChain(k)) if (ToolChain *tc = ToolChainKitInformation::toolChain(k))