Debugger: Don't skip first char after "This GDB was configured as \""

sizeof(needle) includes the \0 terminator, so the first letter of the
target triplet was being skipped too. This caused the architecture to
be mis-detected and (for us on MSYS2) the 32bit GDB to be selected in
64bit Kits.

Change-Id: Id54bc320baf6cc604f2d41fa7ff05aca0756a296
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Ray Donnelly <mingw.android@gmail.com>
This commit is contained in:
hjk
2014-09-09 13:24:58 +02:00
committed by Ray Donnelly
parent ffc00e5ea0
commit bf0e0d80aa

View File

@@ -110,7 +110,7 @@ void DebuggerItem::reinitializeFromFile()
// or "i686-linux-gnu"
int pos1 = ba.indexOf(needle);
if (pos1 != -1) {
pos1 += int(sizeof(needle));
pos1 += int(strlen(needle));
int pos2 = ba.indexOf('"', pos1 + 1);
QByteArray target = ba.mid(pos1, pos2 - pos1);
int pos3 = target.indexOf("--target=");