Commit 0a5f0ba5 authored by hjk's avatar hjk
Browse files

debugger: don't limit strings when "displayed"



Change-Id: I156f66f93deaa818d4409b2a02f0b2e046373656
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 3d825fca
......@@ -769,11 +769,18 @@ def qByteArrayData(value):
# Qt 4:
return private['data'], int(private['size']), int(private['alloc'])
def encodeByteArray(value):
def computeLimit(size, limit):
if limit is None:
return size
if limit == 0:
return min(size, qqStringCutOff)
return min(size, limit)
def encodeByteArray(value, limit = None):
data, size, alloc = qByteArrayData(value)
if alloc != 0:
check(0 <= size and size <= alloc and alloc <= 100*1000*1000)
limit = min(size, qqStringCutOff)
limit = computeLimit(size, limit)
s = readRawMemory(data, limit)
if limit < size:
s += "2e2e2e"
......@@ -792,11 +799,11 @@ def qStringData(value):
# Qt 4.
return private['data'], int(private['size']), int(private['alloc'])
def encodeString(value):
def encodeString(value, limit = 0):
data, size, alloc = qStringData(value)
if alloc != 0:
check(0 <= size and size <= alloc and alloc <= 100*1000*1000)
limit = min(size, qqStringCutOff)
limit = computeLimit(size, limit)
s = readRawMemory(data, 2 * limit)
if limit < size:
s += "2e002e002e00"
......
......@@ -55,10 +55,10 @@ def qdump__QByteArray(d, value):
d.putDisplay(StopDisplay)
elif format == 2:
d.putField("editformat", DisplayLatin1String)
d.putField("editvalue", encodeByteArray(value))
d.putField("editvalue", encodeByteArray(value, None))
elif format == 3:
d.putField("editformat", DisplayUtf8String)
d.putField("editvalue", encodeByteArray(value))
d.putField("editvalue", encodeByteArray(value, None))
if d.isExpanded():
d.putArrayData(lookupType("char"), data, size)
......@@ -1474,7 +1474,7 @@ def qdump__QString(d, value):
d.putDisplay(StopDisplay)
elif format == 2:
d.putField("editformat", DisplayUtf16String)
d.putField("editvalue", encodeString(value))
d.putField("editvalue", encodeString(value, None))
def qdump__QStringList(d, value):
......@@ -2120,7 +2120,7 @@ def qdump__std__string(d, value):
elif format == 2:
d.putField("editformat", displayType)
if n != size:
mem = readRawMemory(p, n * charType.sizeof)
mem = readRawMemory(p, size * charType.sizeof)
d.putField("editvalue", mem)
......
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