Commit 5d1bc385 authored by hjk's avatar hjk

Debugger: Add simple QV4::String dumper

Change-Id: Ide277128d30c4dcc5c396441ebd6e40aa3fc8b51
Reviewed-by: default avatarSimon Hausmann <simon.hausmann@digia.com>
Reviewed-by: default avatarLars Knoll <lars.knoll@digia.com>
parent b950c8c1
......@@ -360,6 +360,9 @@ class DumperBase:
def is32bit(self):
return self.ptrSize() == 4
def is64bit(self):
return self.ptrSize() == 8
def isQt3Support(self):
# assume no Qt 3 support by default
return False
......
......@@ -664,6 +664,14 @@ class Dumper(DumperBase):
index -= 1;
return None
def directBaseObject(self, value, index = 0):
for f in value.type.fields():
if f.is_base_class:
if index == 0:
return value.cast(f.type)
index -= 1;
return None
def checkPointer(self, p, align = 1):
if not self.isNull(p):
p.dereference()
......
......@@ -2228,6 +2228,40 @@ def qdump__QxXmlAttributes(d, value):
pass
#######################################################################
#
# V4
#
#######################################################################
def qdump__QV4__String(d, value):
d.putStringValue(value["identifier"]["string"])
d.putNumChild(0)
def qdump__QV4__TypedValue(d, value):
qdump__QV4__Value(d, d.directBaseObject(value))
d.putBetterType(value.type)
def qdump__QV4__Value(d, value):
try:
if d.is64bit():
vtable = value["m"]["internalClass"]["vtable"]
if toInteger(vtable["isString"]):
d.putBetterType(d.qtNamespace() + "QV4::Value (String)")
d.putStringValue(value["s"]["identifier"]["string"])
d.putNumChild(0)
return
except:
pass
# Fall back for cases that we do not handle specifically.
d.putEmptyValue()
d.putNumChild(1)
if d.isExpanded():
with Children(d):
d.putFields(value)
#######################################################################
#
# Webkit
......
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