From 300304de192e918dd4741ec8cf52e0996734c73c Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 13 Apr 2015 14:35:47 +0200 Subject: [PATCH] Debugger: Parse openSUSE's gdb version strings Change-Id: I49cfb29a3d6ec2245ed05956bb2cd46c6a2338cc Reviewed-by: Christian Stenger --- src/plugins/debugger/debuggerprotocol.cpp | 6 +++++- tests/auto/debugger/tst_gdb.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index 26b0ad1d60e..f3515afe3a5 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -423,12 +423,16 @@ QByteArray DebuggerResponse::toString() const // ////////////////////////////////////////////////////////////////////////////////// +// Tested in tests/auto/debugger/tst_gdb.cpp + void extractGdbVersion(const QString &msg, int *gdbVersion, int *gdbBuildVersion, bool *isMacGdb, bool *isQnxGdb) { 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 parClose(QLatin1Char(')')); diff --git a/tests/auto/debugger/tst_gdb.cpp b/tests/auto/debugger/tst_gdb.cpp index 2b7d079d511..9f65b4fd20f 100644 --- a/tests/auto/debugger/tst_gdb.cpp +++ b/tests/auto/debugger/tst_gdb.cpp @@ -61,9 +61,7 @@ void tst_gdb::version() bool qnx = true; Debugger::Internal::extractGdbVersion(msg, &v, &bv, &mac, &qnx); //qDebug() << msg << " -> " << v << bv << mac << qnx; - QEXPECT_FAIL("openSUSE 13.1", "Not done yet", Continue); QCOMPARE(v, gdbVersion); - QEXPECT_FAIL("openSUSE 13.1", "Not done yet", Continue); QCOMPARE(bv, gdbBuildVersion); QCOMPARE(mac, isMacGdb); QCOMPARE(qnx, isQnxGdb); @@ -124,6 +122,10 @@ void tst_gdb::version_data() QTest::newRow("openSUSE 13.1") << "GNU gdb (GDB; openSUSE 13.1) 7.6.50.20130731-cvs" << 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)