diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index ffd883e2cd9..4b7ac701bf7 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -1460,7 +1460,8 @@ void DebuggerManager::runTest(const QString &fileName) m_executable = fileName; m_processArgs = QStringList() << "--run-debuggee"; m_workingDir = QString(); - startNewDebugger(StartInternal); + if (!startNewDebugger(StartInternal)) + emit debuggingFinished(); } #include "debuggermanager.moc" diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index 599dd049077..2a82bbda4cf 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -376,16 +376,18 @@ void GdbEngine::handleResponse(const QByteArray &buff) GdbMi record; while (from != to) { - if (*from != ',') { - qDebug() << "MALFORMED ASYNC OUTPUT" << from; - return; - } - ++from; // skip ',' GdbMi data; - data.parseResultOrValue(from, to); - if (data.isValid()) { - //qDebug() << "parsed response: " << data.toString(); - record.m_children += data; + if (*from == ',') { + ++from; // skip ',' + data.parseResultOrValue(from, to); + if (data.isValid()) { + //qDebug() << "parsed response: " << data.toString(); + record.m_children += data; + record.m_type = GdbMi::Tuple; + } + } else { + // happens on archer where we get + // 23^running *running,thread-id="all" (gdb) record.m_type = GdbMi::Tuple; } } @@ -410,6 +412,8 @@ void GdbEngine::handleResponse(const QByteArray &buff) // Archer has "{id="28902"}" } else if (asyncClass == "thread-exited") { //"{id="1",group-id="28902"}" + } else if (asyncClass == "thread-selected") { + //"{id="2"}" #ifdef Q_OS_MAC } else if (asyncClass == "shlibs-updated") { // MAC announces updated libs @@ -480,14 +484,16 @@ void GdbEngine::handleResponse(const QByteArray &buff) from = inner; if (from != to) { - if (*from != ',') { - qDebug() << "MALFORMED RESULT OUTPUT" << from; - return; + if (*from == ',') { + ++from; + record.data.parseTuple_helper(from, to); + record.data.m_type = GdbMi::Tuple; + record.data.m_name = "data"; + } else { + // Archer has this + record.data.m_type = GdbMi::Tuple; + record.data.m_name = "data"; } - ++from; - record.data.parseTuple_helper(from, to); - record.data.m_type = GdbMi::Tuple; - record.data.m_name = "data"; } //qDebug() << "\nLOG STREAM:" + m_pendingLogStreamOutput; diff --git a/tests/auto/debugger/main.cpp b/tests/auto/debugger/main.cpp index a77d35547fb..f59a54a6790 100644 --- a/tests/auto/debugger/main.cpp +++ b/tests/auto/debugger/main.cpp @@ -86,17 +86,28 @@ public slots: void readStandardError(); private: - QProcess m_proc; // the Qt Creaor process + QProcess m_proc; // the Qt Creator process }; +static QByteArray stripped(QByteArray ba) +{ + for (int i = ba.size(); --i >= 0; ) { + if (ba.at(i) == '\n' || ba.at(i) == ' ') + ba.chop(1); + else + break; + } + return ba; +} + void tst_Debugger::readStandardOutput() { - qDebug() << "qtcreator-out: " << m_proc.readAllStandardOutput(); + qDebug() << "qtcreator-out: " << stripped(m_proc.readAllStandardOutput()); } void tst_Debugger::readStandardError() { - qDebug() << "qtcreator-err: " << m_proc.readAllStandardError(); + qDebug() << "qtcreator-err: " << stripped(m_proc.readAllStandardError()); } void tst_Debugger::runQtc() @@ -107,9 +118,6 @@ void tst_Debugger::runQtc() QStringList env = QProcess::systemEnvironment(); env.append("QTC_DEBUGGER_TEST=" + test); m_proc.setEnvironment(env); - //qDebug() << "APP: " << test << qtc; - //foreach (QString item, env) - // qDebug() << item; connect(&m_proc, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput())); connect(&m_proc, SIGNAL(readyReadStandardError()),