Commit 0068b9ee authored by David Schulz's avatar David Schulz
Browse files

Cdbext: Add simple dumper for QTextCursor.



Change-Id: I092ab69445028c8b359ae0edca764f17b4a6d6cd
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent 6ab4adab
......@@ -72,6 +72,7 @@ enum KnownType
KT_QBasicAtomicInt = KT_Qt_Type + KT_HasSimpleDumper + 18,
KT_QAtomicInt = KT_Qt_Type + KT_HasSimpleDumper + 19,
KT_QStringRef = KT_Qt_Type + KT_HasSimpleDumper + 20,
KT_QTextCursor = KT_Qt_Type + KT_HasSimpleDumper + 21,
KT_QObject = KT_Qt_Type + KT_HasSimpleDumper + KT_HasComplexDumper + 20,
KT_QWindow = KT_Qt_Type + KT_HasSimpleDumper + KT_HasComplexDumper + 21,
KT_QWidget = KT_Qt_Type + KT_HasSimpleDumper + KT_HasComplexDumper + 22,
......
......@@ -1281,6 +1281,8 @@ static KnownType knownClassTypeHelper(const std::string &type,
return KT_QFixedPoint;
if (!type.compare(qPos, 11, "QScriptLine"))
return KT_QScriptLine;
if (!type.compare(qPos, 11, "QTextCursor"))
return KT_QTextCursor;
break;
case 12:
if (!type.compare(qPos, 12, "QKeySequence"))
......@@ -2383,6 +2385,18 @@ static inline bool dumpQWindow(const SymbolGroupValue &v, std::wostream &str, vo
return true;
}
//Dump a QTextCursor
static inline bool dumpQTextCursor(const SymbolGroupValue &v, std::wostream &str)
{
const unsigned offset = SymbolGroupValue::pointerSize() + SymbolGroupValue::sizeOf("double");
const ULONG64 posAddr = addressOfQPrivateMember(v, QPDM_qSharedDataPadded, offset);
if (!posAddr)
return false;
const int position = SymbolGroupValue::readIntValue(v.context().dataspaces, posAddr);
str << position;
return true;
}
// Dump a std::string.
static bool dumpStd_W_String(const SymbolGroupValue &v, int type, std::wostream &str,
MemoryHandle **memoryHandle = 0)
......@@ -2796,6 +2810,10 @@ unsigned dumpSimpleType(SymbolGroupNode *n, const SymbolGroupValueContext &ctx,
case KT_StdWString:
rc = dumpStd_W_String(v, kt, str, memoryHandleIn) ? SymbolGroupNode::SimpleDumperOk : SymbolGroupNode::SimpleDumperFailed;
break;
case KT_QTextCursor:
rc = dumpQTextCursor(v, str) ? SymbolGroupNode::SimpleDumperOk
: SymbolGroupNode::SimpleDumperFailed;
break;
default:
break;
}
......
Supports Markdown
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