diff options
author | Peter Kümmel <[email protected]> | 2013-06-04 08:44:10 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2013-06-07 13:48:21 +0200 |
commit | 84dd8dd66903c9c221416f4b32a87a96a264a1e7 (patch) | |
tree | 5ebd2b3b8583bcda9b2dfa5ffceb6885e4b30799 /src/plugins/debugger/debuggerprotocol.cpp | |
parent | 616817258666bd9516a79b7f778ddcfaf116163d (diff) |
gdb version string: ignore (...) content when using rubenvb's build
The often used rubenvb mingw-w64 build reports a GDB version string with
the GCC version in parentheses:
GNU gdb (rubenvb-4.7.2-release) 7.5.50.20120920-cvs
With his patch the content within the parentheses is ignored, and is not
wrongly interpreted as GDB version.
Change-Id: I1a3c54acc81cb6d649d11ebf38dea96fc2685aa1
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerprotocol.cpp')
-rw-r--r-- | src/plugins/debugger/debuggerprotocol.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index 53d787a9d70..c5c418a22e2 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -392,12 +392,25 @@ void extractGdbVersion(const QString &msg, { const QChar dot(QLatin1Char('.')); + const bool ignoreParenthesisContent = msg.contains(QLatin1String("rubenvb")); + const QChar parOpen(QLatin1Char('(')); + const QChar parClose(QLatin1Char(')')); + QString cleaned; QString build; bool inClean = true; + bool inParenthesis = false; foreach (QChar c, msg) { if (inClean && !cleaned.isEmpty() && c != dot && (c.isPunct() || c.isSpace())) inClean = false; + if (ignoreParenthesisContent) { + if (!inParenthesis && c == parOpen) + inParenthesis = true; + if (inParenthesis && c == parClose) + inParenthesis = false; + if (inParenthesis) + continue; + } if (inClean) { if (c.isDigit()) cleaned.append(c); |