Debugger: Parse openSUSE's gdb version strings

Change-Id: I49cfb29a3d6ec2245ed05956bb2cd46c6a2338cc
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2015-04-13 14:35:47 +02:00
parent 1f969614b3
commit 300304de19
2 changed files with 9 additions and 3 deletions

View File

@@ -423,12 +423,16 @@ QByteArray DebuggerResponse::toString() const
// //
////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
// Tested in tests/auto/debugger/tst_gdb.cpp
void extractGdbVersion(const QString &msg, void extractGdbVersion(const QString &msg,
int *gdbVersion, int *gdbBuildVersion, bool *isMacGdb, bool *isQnxGdb) int *gdbVersion, int *gdbBuildVersion, bool *isMacGdb, bool *isQnxGdb)
{ {
const QChar dot(QLatin1Char('.')); const QChar dot(QLatin1Char('.'));
const bool ignoreParenthesisContent = msg.contains(QLatin1String("rubenvb")); const bool ignoreParenthesisContent = msg.contains(QLatin1String("rubenvb"))
|| msg.contains(QLatin1String("openSUSE"));
const QChar parOpen(QLatin1Char('(')); const QChar parOpen(QLatin1Char('('));
const QChar parClose(QLatin1Char(')')); const QChar parClose(QLatin1Char(')'));

View File

@@ -61,9 +61,7 @@ void tst_gdb::version()
bool qnx = true; bool qnx = true;
Debugger::Internal::extractGdbVersion(msg, &v, &bv, &mac, &qnx); Debugger::Internal::extractGdbVersion(msg, &v, &bv, &mac, &qnx);
//qDebug() << msg << " -> " << v << bv << mac << qnx; //qDebug() << msg << " -> " << v << bv << mac << qnx;
QEXPECT_FAIL("openSUSE 13.1", "Not done yet", Continue);
QCOMPARE(v, gdbVersion); QCOMPARE(v, gdbVersion);
QEXPECT_FAIL("openSUSE 13.1", "Not done yet", Continue);
QCOMPARE(bv, gdbBuildVersion); QCOMPARE(bv, gdbBuildVersion);
QCOMPARE(mac, isMacGdb); QCOMPARE(mac, isMacGdb);
QCOMPARE(qnx, isQnxGdb); QCOMPARE(qnx, isQnxGdb);
@@ -124,6 +122,10 @@ void tst_gdb::version_data()
QTest::newRow("openSUSE 13.1") QTest::newRow("openSUSE 13.1")
<< "GNU gdb (GDB; openSUSE 13.1) 7.6.50.20130731-cvs" << "GNU gdb (GDB; openSUSE 13.1) 7.6.50.20130731-cvs"
<< 70650 << 20130731 << false << false; << 70650 << 20130731 << false << false;
QTest::newRow("openSUSE 13.2")
<< "GNU gdb (GDB; openSUSE 13.2) 7.8"
<< 70800 << 0 << false << false;
} }
static QString chopConst(QString type) static QString chopConst(QString type)