diff --git a/share/qtcreator/gdbmacros/gdbmacros.cpp b/share/qtcreator/gdbmacros/gdbmacros.cpp index c6051526c679667f0affa4c58efde5a6afbd400f..5f75cc8997e7ba5380f677e7830794fedda0ea2b 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.cpp +++ b/share/qtcreator/gdbmacros/gdbmacros.cpp @@ -219,7 +219,7 @@ QT_END_NAMESPACE Q_DECL_EXPORT char qDumpInBuffer[10000]; // The output buffer. -Q_DECL_EXPORT char qDumpOutBuffer[100000]; +Q_DECL_EXPORT char qDumpOutBuffer[1000000]; namespace { @@ -1206,7 +1206,37 @@ static void qDumpQImage(QDumper &d) const QImage &im = *reinterpret_cast<const QImage *>(d.data); P(d, "value", "(" << im.width() << "x" << im.height() << ")"); P(d, "type", NS"QImage"); + P(d, "numchild", "1"); + if (d.dumpChildren) { + d << ",children=["; + d.beginHash(); + P(d, "name", "key"); + P(d, "type", NS "QImageData"); + P(d, "addr", d.data); + d.endHash(); + } + d.disarm(); +#else + Q_UNUSED(d); +#endif +} + +static void qDumpQImageData(QDumper &d) +{ +#ifdef QT_GUI_LIB + const QImage &im = *reinterpret_cast<const QImage *>(d.data); + const QByteArray ba(QByteArray::fromRawData((const char*)im.bits(), im.numBytes())); + P(d, "type", NS"QImageData"); P(d, "numchild", "0"); +#if 1 + P(d, "value", "<hover here>"); + P(d, "valuetooltipencoded", "1"); + P(d, "valuetooltipsize", ba.size()); + P(d, "valuetooltip", ba); +#else + P(d, "valueencoded", "1"); + P(d, "value", ba); +#endif d.disarm(); #else Q_UNUSED(d); @@ -2560,6 +2590,8 @@ static void handleProtocolVersion2and3(QDumper & d) case 'I': if (isEqual(type, "QImage")) qDumpQImage(d); + else if (isEqual(type, "QImageData")) + qDumpQImageData(d); break; case 'L': if (isEqual(type, "QList")) @@ -2691,6 +2723,7 @@ void *qDumpObjectData440( "\""NS"QHash\"," "\""NS"QHashNode\"," "\""NS"QImage\"," + "\""NS"QImageData\"," "\""NS"QLinkedList\"," "\""NS"QList\"," "\""NS"QLocale\"," diff --git a/src/plugins/debugger/debuggeroutputwindow.cpp b/src/plugins/debugger/debuggeroutputwindow.cpp index 9c51a5300c78785dd3117ac4c8e89b01736428bc..d50536e7ca5bff496c338c8da6564b1045245af3 100644 --- a/src/plugins/debugger/debuggeroutputwindow.cpp +++ b/src/plugins/debugger/debuggeroutputwindow.cpp @@ -252,8 +252,8 @@ void DebuggerOutputWindow::showOutput(const QString &prefix, const QString &outp foreach (QString line, output.split("\n")) { // FIXME: QTextEdit asserts on really long lines... const int n = 3000; - if (line.size() > n) - line = line.left(n) + " [...] <cut off>"; + //if (line.size() > n) + // line = line.left(n) + " [...] <cut off>"; m_combinedText->appendPlainText(prefix + line); } QTextCursor cursor = m_combinedText->textCursor(); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 36fb1d87ad263f550ef14506a9e4cb747cf9dc6e..5d587788485f2efcfeb63e68fed5e9bf90919679 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -2776,10 +2776,12 @@ static void setWatchDataEditValue(WatchData &data, const GdbMi &mi) data.editvalue = mi.data(); } -static void setWatchDataValueToolTip(WatchData &data, const GdbMi &mi) +static void setWatchDataValueToolTip(WatchData &data, const GdbMi &mi, + int encoding = 0) { + qDebug() << "TOOLTIP: " << mi.data().size() << "ENC:" << encoding; if (mi.isValid()) - data.setValueToolTip(_(mi.data())); + data.setValueToolTip(decodeData(mi.data(), encoding)); } static void setWatchDataChildCount(WatchData &data, const GdbMi &mi) @@ -3375,7 +3377,8 @@ void GdbEngine::handleDebuggingHelperValue2(const GdbResultRecord &record, setWatchDataAddress(data, contents.findChild("addr")); setWatchDataSAddress(data, contents.findChild("saddr")); setWatchDataChildCount(data, contents.findChild("numchild")); - setWatchDataValueToolTip(data, contents.findChild("valuetooltip")); + setWatchDataValueToolTip(data, contents.findChild("valuetooltip"), + contents.findChild("valuetooltipencoded").data().toInt()); setWatchDataValueDisabled(data, contents.findChild("valuedisabled")); setWatchDataEditValue(data, contents.findChild("editvalue")); if (qq->watchHandler()->isDisplayedIName(data.iname)) { @@ -3422,7 +3425,8 @@ void GdbEngine::handleDebuggingHelperValue2(const GdbResultRecord &record, item.findChild("valueencoded").data().toInt()); setWatchDataAddress(data1, item.findChild("addr")); setWatchDataSAddress(data1, item.findChild("saddr")); - setWatchDataValueToolTip(data1, item.findChild("valuetooltip")); + setWatchDataValueToolTip(data1, item.findChild("valuetooltip"), + contents.findChild("valuetooltipencoded").data().toInt()); setWatchDataValueDisabled(data1, item.findChild("valuedisabled")); if (!qq->watchHandler()->isExpandedIName(data1.iname)) data1.setChildrenUnneeded(); @@ -3722,7 +3726,7 @@ void GdbEngine::handleVarListChildrenHelper(const GdbMi &item, } else if (exp == "staticMetaObject") { // && item.findChild("type").data() == "const QMetaObject") // FIXME: Namespaces? - // { do nothing } FIXME: make coinfigurable? + // { do nothing } FIXME: make configurable? // special "clever" hack to avoid clutter in the GUI. // I am not sure this is a good idea... } else { diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 421b22e9f1ee8ed4b8db40e61ac03beace2b004d..103545bcf9f33d3d350e5b2131ff20818fcd6349 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -247,6 +247,8 @@ template <class Streamable> QString WatchData::toToolTip() const { + if (!valuetooltip.isEmpty()) + return QString::number(valuetooltip.size()); QString res; QTextStream str(&res); str << "<html><body><table>"; diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp index ae4569ad5049e1953ca4ac843a926562233ad422..de12a5474c71976bb5a4245934095eacf5f51372 100644 --- a/tests/manual/gdbdebugger/simple/app.cpp +++ b/tests/manual/gdbdebugger/simple/app.cpp @@ -1090,6 +1090,7 @@ int main(int argc, char *argv[]) QStringList list; list << "aaa" << "bbb" << "cc"; + testQImage(); testNoArgumentName(1, 2, 3); testIO(); testHidden();