debugger: fix Qt namespace recognition for Qt 5

The "magic" symbol was QString::fromAscii, which might be fully inlined
in Qt 5. Use QString::fromAscii_helper instead, and also make the detection
a bit more robust in case the magic symbol is not found.

Change-Id: I99e61797356a0d90467d32e54acc2d2a104d609a
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2012-08-30 17:33:42 +02:00
parent 00f7677fc4
commit 61291e9421

View File

@@ -5005,12 +5005,15 @@ void GdbEngine::handleNamespaceExtraction(const GdbResponse &response)
QByteArray ba = file.readAll();
file.close();
file.remove();
int pos = ba.indexOf("7QString9fromAscii");
int pos1 = pos - 1;
while (pos1 > 0 && ba.at(pos1) != 'N' && ba.at(pos1) > '@')
--pos1;
++pos1;
const QByteArray ns = ba.mid(pos1, pos - pos1);
QByteArray ns;
int pos = ba.indexOf("7QString16fromAscii_helper");
if (pos > -1) {
int pos1 = pos - 1;
while (pos1 > 0 && ba.at(pos1) != 'N' && ba.at(pos1) > '@')
--pos1;
++pos1;
ns = ba.mid(pos1, pos - pos1);
}
if (ns.isEmpty()) {
showMessage(_("FOUND NON-NAMESPACED QT"));
} else {