diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index d01e82f649f..cb9302211ba 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -457,7 +457,13 @@ void extractGdbVersion(const QString &msg, QString build; bool inClean = true; bool inParenthesis = false; - for (QChar c : msg) { + + int gdbMsgBegin = msg.indexOf("GNU gdb"); + if (gdbMsgBegin == -1) + gdbMsgBegin = 0; + + for (int i = gdbMsgBegin, gdbMsgSize = msg.size(); i < gdbMsgSize; ++i) { + QChar c = msg.at(i); if (inClean && !cleaned.isEmpty() && c != dot && (c.isPunct() || c.isSpace())) inClean = false; if (ignoreParenthesisContent) {