forked from qt-creator/qt-creator
Dumper: More tests
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <QtCore/QSharedPointer>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtGui/QAction>
|
||||
|
||||
@@ -159,6 +160,16 @@ static int dumpQIntVector()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dumpQQStringVector()
|
||||
{
|
||||
QVector<QString> test = QVector<QString>() << "42s" << "43s";
|
||||
prepareInBuffer("QVector", "local.qstringvector", "local.qstringvector", "QString");
|
||||
qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(QString), 0, 0, 0);
|
||||
fputs(qDumpOutBuffer, stdout);
|
||||
fputc('\n', stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dumpQMapIntInt()
|
||||
{
|
||||
QMap<int,int> test;
|
||||
@@ -187,6 +198,19 @@ static int dumpQMapIntString()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dumpQSetInt()
|
||||
{
|
||||
QSet<int> test;
|
||||
test.insert(42);
|
||||
test.insert(43);
|
||||
prepareInBuffer("QSet", "local.qsetint", "local.qsetint", "int");
|
||||
qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(int), 0, 0, 0);
|
||||
fputs(qDumpOutBuffer, stdout);
|
||||
fputc('\n', stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int dumpQMapQStringString()
|
||||
{
|
||||
QMap<QString,QString> test;
|
||||
@@ -445,9 +469,11 @@ static TypeDumpFunctionMap registerTypes()
|
||||
rc.insert("QLinkedList<int>", dumpQIntLinkedList);
|
||||
rc.insert("QList<std::string>", dumpStdStringQList);
|
||||
rc.insert("QVector<int>", dumpQIntVector);
|
||||
rc.insert("QVector<QString>", dumpQQStringVector);
|
||||
rc.insert("QMap<int,QString>", dumpQMapIntString);
|
||||
rc.insert("QMap<QString,QString>", dumpQMapQStringString);
|
||||
rc.insert("QMap<int,int>", dumpQMapIntInt);
|
||||
rc.insert("QSet<int>", dumpQSetInt);
|
||||
rc.insert("string", dumpStdString);
|
||||
rc.insert("wstring", dumpStdWString);
|
||||
rc.insert("list<int>", dumpStdIntList);
|
||||
|
||||
@@ -595,9 +595,9 @@ bool CdbSymbolGroupContext::debugValueToInteger(const DEBUG_VALUE &dv, qint64 *v
|
||||
* To add further types, have a look at the toString() output of the
|
||||
* symbol group. */
|
||||
|
||||
static QString msgStructuralError(const QString &type, int code)
|
||||
static QString msgStructuralError(const QString &name, const QString &type, int code)
|
||||
{
|
||||
return QString::fromLatin1("Warning: Internal dumper for '%1' failed with %2.").arg(type).arg(code);
|
||||
return QString::fromLatin1("Warning: Internal dumper for '%1' (%2) failed with %3.").arg(name, type).arg(code);
|
||||
}
|
||||
|
||||
static inline bool isStdStringOrPointer(const QString &type)
|
||||
@@ -631,7 +631,7 @@ CdbSymbolGroupContext::DumperResult
|
||||
rc = DumperError;
|
||||
break;
|
||||
default:
|
||||
qWarning("%s\n", qPrintable(msgStructuralError(wd->type, drc)));
|
||||
qWarning("%s\n", qPrintable(msgStructuralError(wd->iname, wd->type, drc)));
|
||||
rc = DumperNotHandled;
|
||||
break;
|
||||
}
|
||||
@@ -647,7 +647,7 @@ CdbSymbolGroupContext::DumperResult
|
||||
rc = DumperError;
|
||||
break;
|
||||
default:
|
||||
qWarning("%s\n", qPrintable(msgStructuralError(wd->type, drc)));
|
||||
qWarning("%s\n", qPrintable(msgStructuralError(wd->iname, wd->type, drc)));
|
||||
rc = DumperNotHandled;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user