Commit 1b5e5656 authored by hjk's avatar hjk

Debugger: Fix display of QByteArrays constructed from raw data

The sanity check on sizes introduced in 2ad602bb was too harsh,
marking the fromRawData() case (alloc == 0, size > 0) as invalid.

Change-Id: I9d7e0cedbc3f35024281829cfb1f6fa2e17a1573
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 884be512
......@@ -58,7 +58,7 @@ def qform__QByteArray():
def qdump__QByteArray(d, value):
data, size, alloc = d.byteArrayData(value)
d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 100)
d.check(alloc == 0 or (0 <= size and size <= alloc and alloc <= 100000000))
d.putNumChild(size)
elided, p = d.encodeByteArrayHelper(d.extractPointer(value), d.displayStringLimit)
displayFormat = d.currentItemFormat()
......@@ -79,7 +79,7 @@ def qdump__QByteArray(d, value):
def qdump__QByteArrayData(d, value):
data, size, alloc = d.byteArrayDataHelper(d.addressOf(value))
d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 100)
d.check(alloc == 0 or (0 <= size and size <= alloc and alloc <= 100000000))
d.putValue(d.readMemory(data, size), Hex2EncodedLatin1)
d.putNumChild(1)
if d.isExpanded():
......
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