Commit ebff16f8 authored by hjk's avatar hjk
Browse files

debugger: fix dumper for QString::isNull()

parent 9af00271
...@@ -715,7 +715,10 @@ void QDumper::putBase64Encoded(const char *buf, int n) ...@@ -715,7 +715,10 @@ void QDumper::putBase64Encoded(const char *buf, int n)
void QDumper::putStringValue(const QString &str) void QDumper::putStringValue(const QString &str)
{ {
if (str.isNull()) { if (str.isNull()) {
putItem("value", "\"\" (null)"); beginItem("value");
putBase64Encoded("\"\" (null)", 9);
endItem();
putItem("valueencoded", "5");
} else { } else {
putItem("value", str); putItem("value", str);
putItem("valueencoded", "2"); putItem("valueencoded", "2");
......
...@@ -462,7 +462,8 @@ static const QByteArray ptrToBa(const void *p, bool symbolicNull = true) ...@@ -462,7 +462,8 @@ static const QByteArray ptrToBa(const void *p, bool symbolicNull = true)
static const QByteArray generateQStringSpec(const QString &str, bool isNull = false) static const QByteArray generateQStringSpec(const QString &str, bool isNull = false)
{ {
if (isNull) if (isNull)
return QByteArray("value=''' (null)',type='"NS"QString',numchild='0'"); return QByteArray("value='IiIgKG51bGwp',valueencoded='5',"
"type='"NS"QString',numchild='0'");
return return
QByteArray("value='%',valueencoded='2',type='"NS"QString',numchild='0'") QByteArray("value='%',valueencoded='2',type='"NS"QString',numchild='0'")
<< utfToBase64(str); << utfToBase64(str);
...@@ -2263,7 +2264,7 @@ void tst_Debugger::dumpQSharedPointer() ...@@ -2263,7 +2264,7 @@ void tst_Debugger::dumpQSharedPointer()
void tst_Debugger::dumpQString() void tst_Debugger::dumpQString()
{ {
QString s; QString s;
testDumper("value=''' (null)',type='$T',numchild='0'", testDumper("value='IiIgKG51bGwp',valueencoded='5',type='$T',numchild='0'",
&s, NS"QString", false); &s, NS"QString", false);
s = "abc"; s = "abc";
testDumper("value='YQBiAGMA',valueencoded='2',type='$T',numchild='0'", testDumper("value='YQBiAGMA',valueencoded='2',type='$T',numchild='0'",
...@@ -2427,7 +2428,7 @@ void tst_Debugger::initTestCase() ...@@ -2427,7 +2428,7 @@ void tst_Debugger::initTestCase()
QVERIFY(sizeof(int) == sizeof(d.weakref)); QVERIFY(sizeof(int) == sizeof(d.weakref));
QVERIFY(sizeof(int) == sizeof(d.strongref)); QVERIFY(sizeof(int) == sizeof(d.strongref));
const size_t qObjectPrivateSize = sizeof(QObjectPrivate); const size_t qObjectPrivateSize = sizeof(QObjectPrivate);
const size_t objectPrivateSize = sizeof(ObjectPrivate); const size_t objectPrivateSize = sizeof(ObjectPrivate);
QVERIFY2(qObjectPrivateSize == objectPrivateSize, QString::fromLatin1("QObjectPrivate=%1 ObjectPrivate=%2").arg(qObjectPrivateSize).arg(objectPrivateSize).toLatin1().constData()); QVERIFY2(qObjectPrivateSize == objectPrivateSize, QString::fromLatin1("QObjectPrivate=%1 ObjectPrivate=%2").arg(qObjectPrivateSize).arg(objectPrivateSize).toLatin1().constData());
VERIFY_OFFSETOF(threadData); VERIFY_OFFSETOF(threadData);
VERIFY_OFFSETOF(extraData); VERIFY_OFFSETOF(extraData);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment