Commit 84a597e4 authored by hjk's avatar hjk

Debugger: Small dumper cleanups and consolidation

Change-Id: I1511317f8389963e5c98230d6885311a84c2dc25
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 5bfe37c5
......@@ -1006,23 +1006,6 @@ def check(exp):
if not exp:
raise RuntimeError("Check failed")
def checkSimpleRef(ref):
count = ref["_q_value"]
check(count > 0)
check(count < 1000000)
def checkRef(ref):
try:
count = ref["atomic"]["_q_value"] # Qt 5.
minimum = -1
except:
count = ref["_q_value"] # Qt 4.
minimum = 0
# Assume there aren't a million references to any object.
check(count >= minimum)
check(count < 1000000)
#def couldBePointer(p, align):
# type = lookupType("unsigned int")
# ptr = gdb.Value(p).cast(type)
......
......@@ -249,22 +249,6 @@ def isNull(p):
Value = lldb.SBValue
def checkSimpleRef(ref):
count = int(ref["_q_value"])
check(count > 0)
check(count < 1000000)
def checkRef(ref):
try:
count = int(ref["atomic"]["_q_value"]) # Qt 5.
minimum = -1
except:
count = int(ref["_q_value"]) # Qt 4.
minimum = 0
# Assume there aren't a million references to any object.
check(count >= minimum)
check(count < 1000000)
def createPointerValue(context, address, pointeeType):
addr = int(address) & 0xFFFFFFFFFFFFFFFF
return context.CreateValueFromAddress(None, addr, pointeeType).AddressOf()
......@@ -921,8 +905,7 @@ class Dumper:
if limit is None:
return size
if limit == 0:
#return min(size, qqStringCutOff)
return min(size, 100)
return min(size, qqStringCutOff)
return min(size, limit)
def putValue(self, value, encoding = None, priority = 0):
......
......@@ -18,6 +18,23 @@ movableTypes = set([
"QXmlStreamNotationDeclaration", "QXmlStreamEntityDeclaration"
])
def checkSimpleRef(ref):
count = int(ref["_q_value"])
check(count > 0)
check(count < 1000000)
def checkRef(ref):
try:
count = int(ref["atomic"]["_q_value"]) # Qt 5.
minimum = -1
except:
count = int(ref["_q_value"]) # Qt 4.
minimum = 0
# Assume there aren't a million references to any object.
check(count >= minimum)
check(count < 1000000)
def qByteArrayDataData(d, value):
checkRef(value['ref'])
size = int(value['size'])
......@@ -1625,7 +1642,7 @@ def qdump__QString(d, value):
d.putDisplay(StopDisplay)
elif format == 2:
d.putField("editformat", DisplayUtf16String)
d.putField("editvalue", qEncodeString(d, value, None))
d.putField("editvalue", d.encodeString(value, None))
def qdump__QStringRef(d, value):
......@@ -1702,10 +1719,10 @@ def qdump__QUrl(d, value):
try:
# Qt 5
data = value["d"].dereference()
str = qEncodeString(d, data["scheme"])
str = d.encodeString(data["scheme"])
str += "3a002f002f00"
str += qEncodeString(d, data["host"])
str += qEncodeString(d, data["path"])
str += d.encodeString(data["host"])
str += d.encodeString(data["path"])
d.putValue(str, Hex4EncodedLittleEndian)
except:
d.putPlainChildren(value)
......
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