diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 4805545d246..7e461320968 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -703,10 +703,8 @@ class DumperBase: elided, shown = self.computeLimit(size, limit) return elided, self.readMemory(data, shown) - def putCharArrayHelper(self, data, size, charType, - displayFormat = AutomaticFormat, - makeExpandable = True): - charSize = charType.size() + def putCharArrayValue(self, data, size, charSize, + displayFormat = AutomaticFormat): bytelen = size * charSize elided, shown = self.computeLimit(bytelen, self.displayStringLimit) mem = self.readMemory(data, shown) @@ -729,6 +727,12 @@ class DumperBase: elided, shown = self.computeLimit(bytelen, 100000) self.putDisplay(encodingType + ':separate', self.readMemory(data, shown)) + def putCharArrayHelper(self, data, size, charType, + displayFormat = AutomaticFormat, + makeExpandable = True): + charSize = charType.size() + self.putCharArrayValue(data, size, charSize, displayFormat = displayFormat) + if makeExpandable: self.putNumChild(size) if self.isExpanded(): diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 519afdf9826..0385caa129b 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -145,7 +145,8 @@ class PlainDumper: elif sys.version_info[0] <= 2 and isinstance(val, unicode): d.putValue(val) else: # Assuming LazyString - d.putCharArrayHelper(val.address, val.length, val.type) + d.putCharArrayValue(val.address, val.length, + val.type.target().sizeof) d.putNumChild(len(children)) if d.isExpanded():