aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@theqtcompany.com>2015-04-27 15:00:12 +0200
committerDavid Schulz <david.schulz@theqtcompany.com>2015-04-28 07:00:52 +0000
commite4e998362214aecab257dc3a56e80e6564076ee6 (patch)
tree66e9bdfd1490f8d90f683f152c4819bc611ee940
parente2fd350f023aeb26e32cba0eeb7c97940cff624f (diff)
CDB: Unify handling of stopped debugger process.
Task-number: QTCREATORBUG-14344 Change-Id: Id05b16e649d39e354e6fda9ede9aa44984f3f429 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp47
-rw-r--r--src/plugins/debugger/cdb/cdbengine.h1
2 files changed, 5 insertions, 43 deletions
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index 153519b52b..69e0d20cf2 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -302,7 +302,6 @@ CdbEngine::CdbEngine(const DebuggerStartParameters &sp) :
m_operateByInstruction(true), // Default CDB setting
m_verboseLogPending(true),
m_verboseLog(false), // Default CDB setting
- m_notifyEngineShutdownOnTermination(false),
m_hasDebuggee(false),
m_wow64State(wow64Uninitialized),
m_elapsedLogTime(0),
@@ -341,7 +340,6 @@ void CdbEngine::init()
m_verboseLogPending = boolSetting(VerboseLog);
m_operateByInstruction = true; // Default CDB setting
m_verboseLog = false; // Default CDB setting
- m_notifyEngineShutdownOnTermination = false;
m_hasDebuggee = false;
m_sourceStepInto = false;
m_watchPointX = m_watchPointY = 0;
@@ -903,20 +901,10 @@ void CdbEngine::shutdownEngine()
} else {
postCommand("q", 0);
}
- m_notifyEngineShutdownOnTermination = true;
- return;
} else {
// Remote process. No can do, currently
- m_notifyEngineShutdownOnTermination = true;
SynchronousProcess::stopProcess(m_process);
- return;
- }
- // Lost debuggee, debugger should quit anytime now
- if (!m_hasDebuggee) {
- m_notifyEngineShutdownOnTermination = true;
- return;
}
- interruptInferior();
}
void CdbEngine::abortDebugger()
@@ -935,37 +923,12 @@ void CdbEngine::abortDebugger()
void CdbEngine::processFinished()
{
if (debug)
- qDebug("CdbEngine::processFinished %dms '%s' notify=%d (exit state=%d, ex=%d)",
- elapsedLogTime(), stateName(state()), m_notifyEngineShutdownOnTermination,
- m_process.exitStatus(), m_process.exitCode());
+ qDebug("CdbEngine::processFinished %dms '%s' (exit state=%d, ex=%d)",
+ elapsedLogTime(), stateName(state()), m_process.exitStatus(), m_process.exitCode());
- const bool crashed = m_process.exitStatus() == QProcess::CrashExit;
- if (crashed)
- showMessage(tr("CDB crashed"), LogError); // not in your life.
- 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();
- }
- }
+ notifyDebuggerProcessFinished(m_process.exitCode(),
+ m_process.exitStatus(),
+ QLatin1String("CDB"));
}
void CdbEngine::detachDebugger()
diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h
index e57b2ca1ab..778b29f261 100644
--- a/src/plugins/debugger/cdb/cdbengine.h
+++ b/src/plugins/debugger/cdb/cdbengine.h
@@ -273,7 +273,6 @@ private:
bool m_operateByInstruction;
bool m_verboseLogPending; //!< Creator verbose log action changed.
bool m_verboseLog;
- bool m_notifyEngineShutdownOnTermination;
bool m_hasDebuggee;
enum Wow64State {
wow64Uninitialized,