forked from qt-creator/qt-creator
Filter leading GDB messages during version detection
When using GDB through a script, additional messages can be printed before the line reporting the version number, and some digits of those messages could be interpreted as a version value, leading to wrong version detection. This patch searches for the "GNU gdb" tag first, so the correct line is evaluated. Change-Id: Ief64a056a20a963ad01c44941777361abcce00fc Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -457,7 +457,13 @@ void extractGdbVersion(const QString &msg,
|
|||||||
QString build;
|
QString build;
|
||||||
bool inClean = true;
|
bool inClean = true;
|
||||||
bool inParenthesis = false;
|
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()))
|
if (inClean && !cleaned.isEmpty() && c != dot && (c.isPunct() || c.isSpace()))
|
||||||
inClean = false;
|
inClean = false;
|
||||||
if (ignoreParenthesisContent) {
|
if (ignoreParenthesisContent) {
|
||||||
|
Reference in New Issue
Block a user