Commit de892283 authored by hjk's avatar hjk
Browse files

debugger: work on test suite

parent a7e67742
......@@ -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"
......@@ -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 <NL> *running,thread-id="all" <NL> (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;
......
......@@ -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()),
......
Markdown is supported
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