Commit 996c67ca authored by David Schulz's avatar David Schulz

Cdbext: Add Dumper for QIPv6Address.

Change-Id: Id46c1aa3eb05df85c3edb145c8ef7a302d0fd710
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 1aa8c525
......@@ -145,6 +145,7 @@ enum KnownType
KT_QHostAddress = KT_Qt_Type + KT_HasSimpleDumper + 92,
KT_QProcess = KT_Qt_Type + KT_HasSimpleDumper + 93,
KT_QTimeZone = KT_Qt_Type + KT_HasSimpleDumper + 94,
KT_QIPv6Address = KT_Qt_Type + KT_HasSimpleDumper + 95,
// Types: Qt primitive types
KT_QFixed = KT_Qt_Type + KT_Qt_PrimitiveType + 90,
KT_QTextItem = KT_Qt_Type + KT_Qt_PrimitiveType + 91,
......
......@@ -1324,6 +1324,8 @@ static KnownType knownClassTypeHelper(const std::string &type,
return KT_QKeySequence;
if (!type.compare(qPos, 12, "QHostAddress"))
return KT_QHostAddress;
if (!type.compare(qPos, 12, "QIPv6Address"))
return KT_QIPv6Address;
if (!type.compare(qPos, 12, "QScriptValue"))
return KT_QScriptValue;
break;
......@@ -1928,9 +1930,27 @@ static inline bool dumpQFile(const SymbolGroupValue &v, std::wostream &str)
return dumpQStringFromQPrivateClass(v, QPDM_qVirtual, qFileBasePrivateSize, str);
}
static inline bool dumpQIPv6Address(const SymbolGroupValue &v, std::wostream &str, int *encoding)
{
unsigned char *p = SymbolGroupValue::readMemory( v.context().dataspaces, v["c"].address(), 16);
if (!p || !encoding)
return false;
const wchar_t oldFill = str.fill('0');
str << std::hex;
for (unsigned char *it = p; it < p + 16; ++it) {
if ((p - it) % 2 == 0 && it != p)
str << ':';
str << std::setw(2) << *it;
}
str << std::dec;
str.fill(oldFill);
*encoding = DumpEncodingIPv6AddressAndHexScopeId;
return true;
}
/* Dump QHostAddress, for whose private class no debugging information is available.
* Dump string 'ipString' past of its private class. Does not currently work? */
static inline bool dumpQHostAddress(const SymbolGroupValue &v, std::wostream &str)
static inline bool dumpQHostAddress(const SymbolGroupValue &v, std::wostream &str, int *encoding)
{
// Determine offset in private struct: qIPv6AddressType (array, unaligned) + uint32 + enum.
const QtInfo info = QtInfo::get(v.context());
......@@ -1953,6 +1973,8 @@ static inline bool dumpQHostAddress(const SymbolGroupValue &v, std::wostream &st
return true;
}
if (protocol == 1) {
if (dumpQIPv6Address(qHostAddressPrivateValue["a6"], str, encoding))
return true;
str << L"IPv6 protocol";
return true;
}
......@@ -2875,7 +2897,10 @@ unsigned dumpSimpleType(SymbolGroupNode *n, const SymbolGroupValueContext &ctx,
rc = dumpQUrl(v, str) ? SymbolGroupNode::SimpleDumperOk : SymbolGroupNode::SimpleDumperFailed;
break;
case KT_QHostAddress:
rc = dumpQHostAddress(v, str) ? SymbolGroupNode::SimpleDumperOk : SymbolGroupNode::SimpleDumperFailed;
rc = dumpQHostAddress(v, str, encoding) ? SymbolGroupNode::SimpleDumperOk : SymbolGroupNode::SimpleDumperFailed;
break;
case KT_QIPv6Address:
rc = dumpQIPv6Address(v, str, encoding) ? SymbolGroupNode::SimpleDumperOk : SymbolGroupNode::SimpleDumperFailed;
break;
case KT_QProcess:
rc = dumpQProcess(v, str) ? SymbolGroupNode::SimpleDumperOk : SymbolGroupNode::SimpleDumperFailed;
......
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