From be72a944729145b20266c9dad3756fab13d67455 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 28 Jun 2016 16:47:33 +0200 Subject: [PATCH] Debugger: Show formatted contents of WebKit strings in local view Change-Id: I616c19be20bf32789ab052fdec2b228e145e6be2 Reviewed-by: hjk --- share/qtcreator/debugger/misctypes.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/share/qtcreator/debugger/misctypes.py b/share/qtcreator/debugger/misctypes.py index 0b8c877d091..49bb5d46b84 100644 --- a/share/qtcreator/debugger/misctypes.py +++ b/share/qtcreator/debugger/misctypes.py @@ -346,3 +346,28 @@ def qdump__KDSoapValue(d, value): p = (value.cast(lookupType("char*")) + 4).dereference().cast(lookupType("QString")) d.putStringValue(p) d.putPlainChildren(value["d"]["d"].dereference()) + +####################################################################### +# +# Webkit +# +####################################################################### + +def qdump__WTF__String(d, value): + # WTF::String -> WTF::RefPtr -> WTF::StringImpl* + data = value['m_impl']['m_ptr'] + d.checkPointer(data) + + stringLength = int(data['m_length']) + d.check(0 <= stringLength and stringLength <= 100000000) + + # WTF::StringImpl* -> WTF::StringImpl -> sizeof(WTF::StringImpl) + offsetToData = data.type.target().sizeof + bufferPtr = data.cast(d.charPtrType()) + offsetToData + + is8Bit = data['m_is8Bit'] + charSize = 1 + if not is8Bit: + charSize = 2 + + d.putCharArrayHelper(bufferPtr, stringLength, charSize)