Display Q<>Pointers/Work towards displaying maps/QMaps in CDB.

Make dumpers pass on more size information initially, namely the
various Q<>Pointers. Introduce enum for those special template types
whose size does not vary with the arguments (Q<>Pointer,
std::allocators...) to make it more easily extensible.
Pass on some common QMapNode<> sizes as well.
Introduce an expression cache to the common QtDumperHelper
class and make dumpers pass some common expression values
(value offsets of common QMapNode<> incarnations).
Make CDBDumperHelper use the expression cache.
Extend dumper tester.
This commit is contained in:
Friedemann Kleint
2009-07-02 16:38:15 +02:00
parent 7196c94c65
commit 6e93f4544d
7 changed files with 316 additions and 91 deletions

View File

@@ -198,7 +198,16 @@ public:
// 'data' excludes the leading indicator character.
static bool parseValue(const char *data, QtDumperResult *r);
static bool needsExpressionSyntax(Type t);
// What kind of debugger expressions are required to dump that type.
// A debugger with restricted expression syntax can handle
// 'NeedsNoExpression' and 'NeedsCachedExpression' if it is found in
// the cache.
enum ExpressionRequirement {
NeedsNoExpression, // None, easy.
NeedsCachedExpression, // Common values might be found in expression cache.
NeedsComplexExpression // Totally arbitrary, adress-dependent expressions
};
static ExpressionRequirement expressionRequirements(Type t);
QString toString(bool debug = false) const;
@@ -214,9 +223,20 @@ private:
NameTypeMap m_nameTypeMap;
SizeCache m_sizeCache;
int m_intSize;
int m_pointerSize;
int m_stdAllocatorSize;
// The initial dumper query function returns sizes of some special
// types to aid CDB since it cannot determine the size of classes.
// They are not complete (std::allocator<X>).
enum SpecialSizeType { IntSize, PointerSize, StdAllocatorSize,
QSharedPointerSize, QSharedDataPointerSize,
QWeakPointerSize, QPointerSize, SpecialSizeCount };
// Resolve name to enumeration or SpecialSizeCount (invalid)
static SpecialSizeType specialSizeType(const QString &t);
int m_specialSizes[SpecialSizeCount];
QMap<QString, QString> m_expressionCache;
int m_qtVersion;
QString m_qtNamespace;
};