forked from qt-creator/qt-creator
CDB: Unify handling of stopped debugger process.
Task-number: QTCREATORBUG-14344 Change-Id: Id05b16e649d39e354e6fda9ede9aa44984f3f429 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -302,7 +302,6 @@ CdbEngine::CdbEngine(const DebuggerStartParameters &sp) :
|
|||||||
m_operateByInstruction(true), // Default CDB setting
|
m_operateByInstruction(true), // Default CDB setting
|
||||||
m_verboseLogPending(true),
|
m_verboseLogPending(true),
|
||||||
m_verboseLog(false), // Default CDB setting
|
m_verboseLog(false), // Default CDB setting
|
||||||
m_notifyEngineShutdownOnTermination(false),
|
|
||||||
m_hasDebuggee(false),
|
m_hasDebuggee(false),
|
||||||
m_wow64State(wow64Uninitialized),
|
m_wow64State(wow64Uninitialized),
|
||||||
m_elapsedLogTime(0),
|
m_elapsedLogTime(0),
|
||||||
@@ -341,7 +340,6 @@ void CdbEngine::init()
|
|||||||
m_verboseLogPending = boolSetting(VerboseLog);
|
m_verboseLogPending = boolSetting(VerboseLog);
|
||||||
m_operateByInstruction = true; // Default CDB setting
|
m_operateByInstruction = true; // Default CDB setting
|
||||||
m_verboseLog = false; // Default CDB setting
|
m_verboseLog = false; // Default CDB setting
|
||||||
m_notifyEngineShutdownOnTermination = false;
|
|
||||||
m_hasDebuggee = false;
|
m_hasDebuggee = false;
|
||||||
m_sourceStepInto = false;
|
m_sourceStepInto = false;
|
||||||
m_watchPointX = m_watchPointY = 0;
|
m_watchPointX = m_watchPointY = 0;
|
||||||
@@ -903,20 +901,10 @@ void CdbEngine::shutdownEngine()
|
|||||||
} else {
|
} else {
|
||||||
postCommand("q", 0);
|
postCommand("q", 0);
|
||||||
}
|
}
|
||||||
m_notifyEngineShutdownOnTermination = true;
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
// Remote process. No can do, currently
|
// Remote process. No can do, currently
|
||||||
m_notifyEngineShutdownOnTermination = true;
|
|
||||||
SynchronousProcess::stopProcess(m_process);
|
SynchronousProcess::stopProcess(m_process);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
// Lost debuggee, debugger should quit anytime now
|
|
||||||
if (!m_hasDebuggee) {
|
|
||||||
m_notifyEngineShutdownOnTermination = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
interruptInferior();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CdbEngine::abortDebugger()
|
void CdbEngine::abortDebugger()
|
||||||
@@ -935,37 +923,12 @@ void CdbEngine::abortDebugger()
|
|||||||
void CdbEngine::processFinished()
|
void CdbEngine::processFinished()
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug("CdbEngine::processFinished %dms '%s' notify=%d (exit state=%d, ex=%d)",
|
qDebug("CdbEngine::processFinished %dms '%s' (exit state=%d, ex=%d)",
|
||||||
elapsedLogTime(), stateName(state()), m_notifyEngineShutdownOnTermination,
|
elapsedLogTime(), stateName(state()), m_process.exitStatus(), m_process.exitCode());
|
||||||
m_process.exitStatus(), m_process.exitCode());
|
|
||||||
|
|
||||||
const bool crashed = m_process.exitStatus() == QProcess::CrashExit;
|
notifyDebuggerProcessFinished(m_process.exitCode(),
|
||||||
if (crashed)
|
m_process.exitStatus(),
|
||||||
showMessage(tr("CDB crashed"), LogError); // not in your life.
|
QLatin1String("CDB"));
|
||||||
else
|
|
||||||
showMessage(tr("CDB exited (%1)").arg(m_process.exitCode()), LogMisc);
|
|
||||||
|
|
||||||
if (m_notifyEngineShutdownOnTermination) {
|
|
||||||
if (crashed) {
|
|
||||||
if (debug)
|
|
||||||
qDebug("notifyEngineIll");
|
|
||||||
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineIll")
|
|
||||||
notifyEngineIll();
|
|
||||||
} else {
|
|
||||||
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineShutdownOk")
|
|
||||||
notifyEngineShutdownOk();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// The QML/CPP engine relies on the standard sequence of InferiorShutDown,etc.
|
|
||||||
// Otherwise, we take a shortcut.
|
|
||||||
if (isSlaveEngine()) {
|
|
||||||
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorExited")
|
|
||||||
notifyInferiorExited();
|
|
||||||
} else {
|
|
||||||
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSpontaneousShutdown")
|
|
||||||
notifyEngineSpontaneousShutdown();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CdbEngine::detachDebugger()
|
void CdbEngine::detachDebugger()
|
||||||
|
@@ -273,7 +273,6 @@ private:
|
|||||||
bool m_operateByInstruction;
|
bool m_operateByInstruction;
|
||||||
bool m_verboseLogPending; //!< Creator verbose log action changed.
|
bool m_verboseLogPending; //!< Creator verbose log action changed.
|
||||||
bool m_verboseLog;
|
bool m_verboseLog;
|
||||||
bool m_notifyEngineShutdownOnTermination;
|
|
||||||
bool m_hasDebuggee;
|
bool m_hasDebuggee;
|
||||||
enum Wow64State {
|
enum Wow64State {
|
||||||
wow64Uninitialized,
|
wow64Uninitialized,
|
||||||
|
Reference in New Issue
Block a user