From fff7acad55f0d2009afe8941ef2c7cd37481da6f Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Wed, 17 Dec 2008 15:19:22 +0100
Subject: [PATCH] fix parsing of gdb version

---
 src/plugins/debugger/gdbengine.cpp      | 4 ++--
 tests/manual/gdbdebugger/simple/app.cpp | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp
index 710bee9aee5..6e650917ce6 100644
--- a/src/plugins/debugger/gdbengine.cpp
+++ b/src/plugins/debugger/gdbengine.cpp
@@ -1362,7 +1362,7 @@ void GdbEngine::handleShowVersion(const GdbResultRecord &response)
     if (response.resultClass == GdbResultDone) {
         m_gdbVersion = 100;
         QString msg = response.data.findChild("consolestreamoutput").data();
-        QRegExp supported("GNU gdb(.*) (\\d+)\\.(\\d+)\\.(\\d+)");
+        QRegExp supported("GNU gdb(.*) (\\d+)\\.(\\d+)(\\.(\\d+))?");
         if (supported.indexIn(msg) == -1) {
             qDebug() << "UNSUPPORTED GDB VERSION " << msg;
             QStringList list = msg.split("\n");
@@ -1384,7 +1384,7 @@ void GdbEngine::handleShowVersion(const GdbResultRecord &response)
         } else {
             m_gdbVersion = 10000 * supported.cap(2).toInt()
                          +   100 * supported.cap(3).toInt()
-                         +     1 * supported.cap(4).toInt();
+                         +     1 * supported.cap(5).toInt();
             //qDebug() << "GDB VERSION " << m_gdbVersion;
         }
     }
diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp
index 149be98c271..ba36298eb1a 100644
--- a/tests/manual/gdbdebugger/simple/app.cpp
+++ b/tests/manual/gdbdebugger/simple/app.cpp
@@ -74,8 +74,6 @@ uint qHash(const double & f)
     return int(f);
 }
 
-#define X myns
-X::QString str;
 
 class  Foo
 {
-- 
GitLab