From 08e17e6e6b9e76eb5b5305b09a2387d0eec33d4b Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Tue, 27 Jan 2009 17:41:31 +0100 Subject: [PATCH] Fixes: debugger: more quote fixes --- share/qtcreator/gdbmacros/gdbmacros.cpp | 86 ++++++++++++------------ src/plugins/debugger/debuggermanager.cpp | 4 +- src/plugins/debugger/gdbengine.cpp | 7 +- tests/manual/gdbdebugger/simple/app.cpp | 4 +- 4 files changed, 52 insertions(+), 49 deletions(-) diff --git a/share/qtcreator/gdbmacros/gdbmacros.cpp b/share/qtcreator/gdbmacros/gdbmacros.cpp index d89a6672354..6a1385359fb 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.cpp +++ b/share/qtcreator/gdbmacros/gdbmacros.cpp @@ -642,7 +642,7 @@ void QDumper::putEllipsis() #define P(dumper,name,value) \ do { \ dumper.addCommaIfNeeded(); \ - dumper << (name) << "=\"" << value << '"'; \ + dumper << (name) << "=\"" << value << "\""; \ } while (0) // simple string property @@ -2482,54 +2482,54 @@ void qDumpObjectData440( // They are mentioned here nevertheless. For types that not listed // here, dumpers won't be used. d << "dumpers=[" - "'"NS"QByteArray'," - "'"NS"QDateTime'," - "'"NS"QDir'," - "'"NS"QFile'," - "'"NS"QFileInfo'," - "'"NS"QHash'," - "'"NS"QHashNode'," - "'"NS"QImage'," - "'"NS"QLinkedList'," - "'"NS"QList'," - "'"NS"QLocale'," - "'"NS"QMap'," - "'"NS"QMapNode'," - "'"NS"QModelIndex'," + "\""NS"QByteArray\"," + "\""NS"QDateTime\"," + "\""NS"QDir\"," + "\""NS"QFile\"," + "\""NS"QFileInfo\"," + "\""NS"QHash\"," + "\""NS"QHashNode\"," + "\""NS"QImage\"," + "\""NS"QLinkedList\"," + "\""NS"QList\"," + "\""NS"QLocale\"," + "\""NS"QMap\"," + "\""NS"QMapNode\"," + "\""NS"QModelIndex\"," #if QT_VERSION >= 0x040500 - "'"NS"QMultiMap'," + "\""NS"QMultiMap\"," #endif - "'"NS"QObject'," - "'"NS"QObjectMethodList'," // hack to get nested properties display - "'"NS"QObjectPropertyList'," + "\""NS"QObject\"," + "\""NS"QObjectMethodList\"," // hack to get nested properties display + "\""NS"QObjectPropertyList\"," #if PRIVATE_OBJECT_ALLOWED - "'"NS"QObjectSignal'," - "'"NS"QObjectSignalList'," - "'"NS"QObjectSlot'," - "'"NS"QObjectSlotList'," + "\""NS"QObjectSignal\"," + "\""NS"QObjectSignalList\"," + "\""NS"QObjectSlot\"," + "\""NS"QObjectSlotList\"," #endif // PRIVATE_OBJECT_ALLOWED - // << "'"NS"QRegion'," - "'"NS"QSet'," - "'"NS"QString'," - "'"NS"QStringList'," - "'"NS"QTextCodec'," - "'"NS"QVariant'," - "'"NS"QVector'," - "'"NS"QWidget'," - "'string'," - "'wstring'," - "'std::basic_string'," - "'std::list'," - "'std::map'," - "'std::string'," - "'std::vector'," - "'std::wstring'," + // << "\""NS"QRegion\"," + "\""NS"QSet\"," + "\""NS"QString\"," + "\""NS"QStringList\"," + "\""NS"QTextCodec\"," + "\""NS"QVariant\"," + "\""NS"QVector\"," + "\""NS"QWidget\"," + "\"string\"," + "\"wstring\"," + "\"std::basic_string\"," + "\"std::list\"," + "\"std::map\"," + "\"std::string\"," + "\"std::vector\"," + "\"std::wstring\"," "]"; d << ",qtversion=[" - "'" << ((QT_VERSION >> 16) & 255) << "'," - "'" << ((QT_VERSION >> 8) & 255) << "'," - "'" << ((QT_VERSION) & 255) << "']"; - d << ",namespace='"NS"'"; + "\"" << ((QT_VERSION >> 16) & 255) << "\"," + "\"" << ((QT_VERSION >> 8) & 255) << "\"," + "\"" << ((QT_VERSION) & 255) << "\"]"; + d << ",namespace=\""NS"\""; d.disarm(); } diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index 8180c7cfd10..efa5d1f6333 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -1096,8 +1096,8 @@ bool DebuggerManager::useFastStart() const void DebuggerManager::setUseCustomDumpers(bool on) { - m_settings.m_useCustomDumpers = on; - engine()->setUseCustomDumpers(on); + //m_settings.m_useCustomDumpers = on; + //engine()->setUseCustomDumpers(on); } void DebuggerManager::setUseFastStart(bool on) diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index cff7be0df07..a415f47e3cb 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -2883,6 +2883,7 @@ static QString sizeofTypeExpression(const QString &type) void GdbEngine::setUseCustomDumpers(bool on) { + qDebug() << "SWITCHING ON/OFF DUMPER DEBUGGING:" << on; Q_UNUSED(on); // FIXME: a bit too harsh, but otherwise the treeview sometimes look funny //m_expandedINames.clear(); @@ -3298,7 +3299,8 @@ void GdbEngine::handleQueryDataDumper2(const GdbResultRecord &record) QByteArray out = output.data(); out = out.mid(out.indexOf('"') + 2); // + 1 is success marker out = out.left(out.lastIndexOf('"')); - out = out.replace('\'', '"'); + //out.replace('\'', '"'); + out.replace("\\", ""); out = "dummy={" + out + "}"; //qDebug() << "OUTPUT: " << out; @@ -3488,7 +3490,8 @@ void GdbEngine::handleDumpCustomValue2(const GdbResultRecord &record, QByteArray out = output.data(); out = out.mid(out.indexOf('"') + 2); // + 1 is the 'success marker' out = out.left(out.lastIndexOf('"')); - out = out.replace('\'', '"'); + //out.replace('\'', '"'); + out.replace("\\", ""); out = "dummy={" + out + "}"; //qDebug() << "OUTPUT: " << out; diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp index e5cf4d1a032..442e0e23d1a 100644 --- a/tests/manual/gdbdebugger/simple/app.cpp +++ b/tests/manual/gdbdebugger/simple/app.cpp @@ -145,7 +145,7 @@ void testQByteArray() void testQHash() { -#if 0 +#if 1 QHash<int, float> hgg0; hgg0[11] = 11.0; hgg0[22] = 22.0; @@ -171,7 +171,7 @@ void testQHash() #endif -#if 0 +#if 1 QHash<int, QString> hgg2; hgg2[22] = "22.0"; -- GitLab