Commit eab55aac authored by hjk's avatar hjk
Browse files

debugger: move state change to EngineStarting into the base class

parent c8fae112
......@@ -376,13 +376,12 @@ void CdbDebugEngine::startupChecks()
void CdbDebugEngine::startDebugger()
{
setState(EngineStarting, Q_FUNC_INFO, __LINE__);
QTC_ASSERT(state() == EngineStarting, qDebug() << state());
const DebuggerStartParameters &sp = startParameters();
if (debugCDBExecution)
qDebug() << "startDebugger";
CdbCore::BreakPoint::clearNormalizeFileNameCache();
startupChecks();
setState(AdapterStarting, Q_FUNC_INFO, __LINE__);
m_d->checkVersion();
if (m_d->m_hDebuggeeProcess) {
warning(QLatin1String("Internal error: Attempt to start debugger while another process is being debugged."));
......
......@@ -635,6 +635,7 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
theDebuggerAction(OperateByInstruction)
->setEnabled(engineCapabilities & DisassemblerCapability);
setState(EngineStarting);
startDebugger();
}
......
......@@ -1762,8 +1762,7 @@ AbstractGdbAdapter *GdbEngine::createAdapter()
void GdbEngine::startDebugger()
{
//qDebug() << "GDB START DEBUGGER";
QTC_ASSERT(state() == DebuggerNotReady, setState(DebuggerNotReady));
setState(EngineStarting);
QTC_ASSERT(state() == EngineStarting, qDebug() << state());
QTC_ASSERT(m_debuggingHelperState == DebuggingHelperUninitialized, /**/);
QTC_ASSERT(m_gdbAdapter == 0, /**/);
......
......@@ -140,7 +140,7 @@ void PdbEngine::exitDebugger()
void PdbEngine::startDebugger()
{
setState(EngineStarting);
QTC_ASSERT(state() == EngineStarting, qDebug() << state());
m_scriptFileName = QFileInfo(startParameters().executable).absoluteFilePath();
QFile scriptFile(m_scriptFileName);
......
......@@ -228,8 +228,7 @@ const int serverPort = 3768;
void QmlEngine::startDebugger()
{
QTC_ASSERT(state() == DebuggerNotReady, setState(DebuggerNotReady));
setState(EngineStarting);
QTC_ASSERT(state() == EngineStarting, qDebug() << state());
const DebuggerStartParameters &sp = startParameters();
const int pos = sp.remoteChannel.indexOf(QLatin1Char(':'));
const QString host = sp.remoteChannel.left(pos);
......
......@@ -231,9 +231,8 @@ void ScriptEngine::exitDebugger()
void ScriptEngine::startDebugger()
{
QTC_ASSERT(state() == EngineStarting, qDebug() << state());
showMessage(_("STARTING SCRIPT DEBUGGER"), LogMisc);
QTC_ASSERT(state() == DebuggerNotReady, setState(DebuggerNotReady));
setState(EngineStarting);
if (m_scriptEngine.isNull())
m_scriptEngine = Core::ICore::instance()->scriptManager()->scriptEngine();
if (!m_scriptAgent)
......
......@@ -202,6 +202,7 @@ void TcfEngine::exitDebugger()
void TcfEngine::startDebugger()
{
QTC_ASSERT(state() == EngineStarting, qDebug() << state());
setState(InferiorRunningRequested);
showStatusMessage(tr("Running requested..."), 5000);
const DebuggerStartParameters &sp = startParameters();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment