Commit 1398480f authored by hjk's avatar hjk

Debugger: Limit QByteArray and QString display length

Also add '...' for cut-off std::strings.

Change-Id: Ib6129eb43c723f2a863086a0142312c669b65665
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent b8df9313
......@@ -433,14 +433,14 @@ class DumperBase:
data = self.extractBlob(addr, size).toBytes()
return self.hexencode(data)
def encodeByteArray(self, value):
return self.encodeByteArrayHelper(self.extractPointer(value))
def encodeByteArray(self, value, limit = 0):
return self.encodeByteArrayHelper(self.extractPointer(value), limit)
def byteArrayData(self, value):
return self.byteArrayDataHelper(self.extractPointer(value))
def putByteArrayValue(self, value):
return self.putValue(self.encodeByteArray(value), Hex2EncodedLatin1)
return self.putValue(self.encodeByteArray(value, self.stringCutOff), Hex2EncodedLatin1)
def putByteArrayValueByAddress(self, addr):
self.putValue(self.encodeByteArrayHelper(self.extractPointer(addr)),
......@@ -450,8 +450,8 @@ class DumperBase:
self.putValue(self.encodeStringHelper(self.extractPointer(addr)),
Hex4EncodedLittleEndian)
def encodeString(self, value):
return self.encodeStringHelper(self.extractPointer(value))
def encodeString(self, value, limit = 0):
return self.encodeStringHelper(self.extractPointer(value), limit)
def stringData(self, value):
return self.byteArrayDataHelper(self.extractPointer(value))
......@@ -485,7 +485,7 @@ class DumperBase:
return inner.strip()
def putStringValue(self, value):
return self.putValue(self.encodeString(value), Hex4EncodedLittleEndian)
return self.putValue(self.encodeString(value, self.stringCutOff), Hex4EncodedLittleEndian)
def putAddressItem(self, name, value, type = ""):
with SubItem(self, name):
......
......@@ -430,6 +430,8 @@ def qdump__std__stringHelper1__QNX(d, value, charSize):
def qdump_stringHelper(d, data, size, charSize):
cutoff = min(size, d.stringCutOff)
mem = d.readMemory(data, cutoff)
if size > d.stringCutOff:
mem += "2e2e2e"
if charSize == 1:
encodingType = Hex2EncodedLatin1
displayType = DisplayLatin1String
......
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