forked from qt-creator/qt-creator
Debugger: Remove unneeded expression for dumping QVector.
...thus enabling dumping of it in CDB. Reviewed-by: hjk <qtc-committer@nokia.com>
This commit is contained in:
@@ -2744,6 +2744,9 @@ static void qDumpQTextCodec(QDumper &d)
|
||||
|
||||
static void qDumpQVector(QDumper &d)
|
||||
{
|
||||
QVectorTypedData<int> *dummy = 0;
|
||||
const unsigned typeddatasize = (char*)(&dummy->array) - (char*)dummy;
|
||||
|
||||
QVectorData *v = *reinterpret_cast<QVectorData *const*>(d.data);
|
||||
|
||||
// Try to provoke segfaults early to prevent the frontend
|
||||
@@ -2756,8 +2759,7 @@ static void qDumpQVector(QDumper &d)
|
||||
//qCheckAccess(&vec.back());
|
||||
}
|
||||
|
||||
unsigned innersize = d.extraInt[0];
|
||||
unsigned typeddatasize = d.extraInt[1];
|
||||
const unsigned innersize = d.extraInt[0];
|
||||
|
||||
int n = nn;
|
||||
d.putItemCount("value", n);
|
||||
@@ -3348,7 +3350,8 @@ void *watchPoint(int x, int y)
|
||||
}
|
||||
#endif
|
||||
|
||||
// Helper to write out common expression values for CDB:
|
||||
// Helpers to write out common expression values for CDB
|
||||
#ifdef Q_CC_MSVC
|
||||
// Offsets of a map node value which looks like
|
||||
// "(size_t)&(('QMapNode<QString,QString >'*)0)->value")" in gdb syntax
|
||||
|
||||
@@ -3394,6 +3397,8 @@ template <class Key, class Value>
|
||||
return d;
|
||||
}
|
||||
|
||||
#endif // Q_CC_MSVC
|
||||
|
||||
extern "C" Q_DECL_EXPORT
|
||||
void *qDumpObjectData440(
|
||||
int protocolVersion,
|
||||
@@ -3515,6 +3520,7 @@ void *qDumpObjectData440(
|
||||
.put(NS"QMapNode<"NS"QString,"NS"QVariant>=\"").put(sizeof(QMapNode<QString, QVariant>))
|
||||
.put("\"}");
|
||||
// Write out common expression values for CDB
|
||||
#ifdef Q_CC_MSVC
|
||||
d.put(",expressions={");
|
||||
putQMapNodeOffsetExpression<int,int>("int", "int", d).put(',');
|
||||
putQMapNodeOffsetExpression<int,QString>("int", NS"QString", d).put(',');
|
||||
@@ -3534,6 +3540,7 @@ void *qDumpObjectData440(
|
||||
putStdPairValueOffsetExpression<int,std::wstring>("int", stdWideStringTypeUShortC, d).put(',');
|
||||
putStdPairValueOffsetExpression<std::wstring,int>(stdWideStringTypeUShortC, "int", d);
|
||||
d.put('}');
|
||||
#endif // Q_CC_MSVC
|
||||
d.disarm();
|
||||
}
|
||||
|
||||
|
@@ -140,7 +140,7 @@ static int dumpQIntList()
|
||||
|
||||
static int dumpQIntVector()
|
||||
{
|
||||
QVector<int> test = QVector<int>() << 1 << 2;
|
||||
QVector<int> test = QVector<int>() << 42 << 43;
|
||||
prepareInBuffer("QVector", "local.qintvector", "local.qintvector", "int");
|
||||
qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(int), 0, 0, 0);
|
||||
fputs(qDumpOutBuffer, stdout);
|
||||
|
@@ -798,7 +798,6 @@ QtDumperHelper::ExpressionRequirement QtDumperHelper::expressionRequirements(Typ
|
||||
|
||||
switch (t) {
|
||||
case QAbstractItemType:
|
||||
case QVectorType:
|
||||
return NeedsComplexExpression;
|
||||
case QMapType:
|
||||
case QMultiMapType:
|
||||
@@ -1353,14 +1352,6 @@ void QtDumperHelper::evaluationParameters(const WatchData &data,
|
||||
case QAbstractItemType:
|
||||
inner = data.addr.mid(1);
|
||||
break;
|
||||
case QVectorType:
|
||||
if (m_qtVersion >= 0x040600)
|
||||
extraArgs[1] = QString("(char*)&((%1).p->array)-(char*)((%2).p)")
|
||||
.arg(data.exp).arg(data.exp);
|
||||
else
|
||||
extraArgs[1] = QString("(char*)&((%1).d->array)-(char*)((%2).d)")
|
||||
.arg(data.exp).arg(data.exp);
|
||||
break;
|
||||
case QObjectSlotType:
|
||||
case QObjectSignalType: {
|
||||
// we need the number out of something like
|
||||
@@ -1453,6 +1444,7 @@ void QtDumperHelper::evaluationParameters(const WatchData &data,
|
||||
qWarning("Unknown type encountered in %s.\n", Q_FUNC_INFO);
|
||||
break;
|
||||
case SupportedType:
|
||||
case QVectorType:
|
||||
case QObjectType:
|
||||
case QWidgetType:
|
||||
break;
|
||||
|
Reference in New Issue
Block a user