diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index cc9a8e46be2..584c35e1389 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -948,16 +948,28 @@ class DumperBase: else: self.putValue(blob, Hex8EncodedLittleEndian) - if self.currentIName in self.expandedINames: + if self.isExpanded(): try: # May fail on artificial items like xmm register data. - if not self.tryPutArrayContents(p, n, innerType): + #if not self.tryPutArrayContents(p, n, innerType): with Children(self, childType=innerType, addrBase=p, addrStep=ts): self.putFields(value) except: with Children(self, childType=innerType): self.putFields(value) + if hasPlot and self.isSimpleType(innerType): + show = displayFormat == ArrayPlotFormat + iname = self.currentIName + data = [] + if show: + base = self.createPointerValue(p, innerType) + data = [str(base[i]) for i in range(0, n)] + matplotSend(iname, show, data) + else: + #self.putValue(self.currentValue.value + " (not plottable)") + self.putField("plottable", "0") + def cleanAddress(self, addr): if addr is None: return "" @@ -1745,6 +1757,10 @@ class DumperBase: self.qqEditable = {} self.typeCache = {} + if hasPlot: # Hack for generic array type. [] is used as "type" name. + self.qqDumpers['[]'] = "" + self.qqFormats['[]'] = arrayForms() + for mod in self.dumpermodules: m = importlib.import_module(mod) dic = m.__dict__ diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 7c9a85f8dca..4ac3f32082b 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -1007,6 +1007,9 @@ DisplayFormats WatchItem::typeFormatList() const t.replace(QLatin1Char(':'), QLatin1Char('_')); formats << watchModel()->m_reportedTypeFormats.value(t); + if (t.contains(QLatin1Char(']'))) + formats << watchModel()->m_reportedTypeFormats.value(QLatin1String("[]")); + // Fixed artificial string and pointer types. if (origaddr || isPointerType(type)) { formats.append(RawFormat);