Fixes: debugger: more quote fixes

This commit is contained in:
hjk
2009-01-27 17:41:31 +01:00
parent 1c55964be0
commit 08e17e6e6b
4 changed files with 52 additions and 49 deletions

View File

@@ -642,7 +642,7 @@ void QDumper::putEllipsis()
#define P(dumper,name,value) \ #define P(dumper,name,value) \
do { \ do { \
dumper.addCommaIfNeeded(); \ dumper.addCommaIfNeeded(); \
dumper << (name) << "=\"" << value << '"'; \ dumper << (name) << "=\"" << value << "\""; \
} while (0) } while (0)
// simple string property // simple string property
@@ -2482,54 +2482,54 @@ void qDumpObjectData440(
// They are mentioned here nevertheless. For types that not listed // They are mentioned here nevertheless. For types that not listed
// here, dumpers won't be used. // here, dumpers won't be used.
d << "dumpers=[" d << "dumpers=["
"'"NS"QByteArray'," "\""NS"QByteArray\","
"'"NS"QDateTime'," "\""NS"QDateTime\","
"'"NS"QDir'," "\""NS"QDir\","
"'"NS"QFile'," "\""NS"QFile\","
"'"NS"QFileInfo'," "\""NS"QFileInfo\","
"'"NS"QHash'," "\""NS"QHash\","
"'"NS"QHashNode'," "\""NS"QHashNode\","
"'"NS"QImage'," "\""NS"QImage\","
"'"NS"QLinkedList'," "\""NS"QLinkedList\","
"'"NS"QList'," "\""NS"QList\","
"'"NS"QLocale'," "\""NS"QLocale\","
"'"NS"QMap'," "\""NS"QMap\","
"'"NS"QMapNode'," "\""NS"QMapNode\","
"'"NS"QModelIndex'," "\""NS"QModelIndex\","
#if QT_VERSION >= 0x040500 #if QT_VERSION >= 0x040500
"'"NS"QMultiMap'," "\""NS"QMultiMap\","
#endif #endif
"'"NS"QObject'," "\""NS"QObject\","
"'"NS"QObjectMethodList'," // hack to get nested properties display "\""NS"QObjectMethodList\"," // hack to get nested properties display
"'"NS"QObjectPropertyList'," "\""NS"QObjectPropertyList\","
#if PRIVATE_OBJECT_ALLOWED #if PRIVATE_OBJECT_ALLOWED
"'"NS"QObjectSignal'," "\""NS"QObjectSignal\","
"'"NS"QObjectSignalList'," "\""NS"QObjectSignalList\","
"'"NS"QObjectSlot'," "\""NS"QObjectSlot\","
"'"NS"QObjectSlotList'," "\""NS"QObjectSlotList\","
#endif // PRIVATE_OBJECT_ALLOWED #endif // PRIVATE_OBJECT_ALLOWED
// << "'"NS"QRegion'," // << "\""NS"QRegion\","
"'"NS"QSet'," "\""NS"QSet\","
"'"NS"QString'," "\""NS"QString\","
"'"NS"QStringList'," "\""NS"QStringList\","
"'"NS"QTextCodec'," "\""NS"QTextCodec\","
"'"NS"QVariant'," "\""NS"QVariant\","
"'"NS"QVector'," "\""NS"QVector\","
"'"NS"QWidget'," "\""NS"QWidget\","
"'string'," "\"string\","
"'wstring'," "\"wstring\","
"'std::basic_string'," "\"std::basic_string\","
"'std::list'," "\"std::list\","
"'std::map'," "\"std::map\","
"'std::string'," "\"std::string\","
"'std::vector'," "\"std::vector\","
"'std::wstring'," "\"std::wstring\","
"]"; "]";
d << ",qtversion=[" d << ",qtversion=["
"'" << ((QT_VERSION >> 16) & 255) << "'," "\"" << ((QT_VERSION >> 16) & 255) << "\","
"'" << ((QT_VERSION >> 8) & 255) << "'," "\"" << ((QT_VERSION >> 8) & 255) << "\","
"'" << ((QT_VERSION) & 255) << "']"; "\"" << ((QT_VERSION) & 255) << "\"]";
d << ",namespace='"NS"'"; d << ",namespace=\""NS"\"";
d.disarm(); d.disarm();
} }

View File

@@ -1096,8 +1096,8 @@ bool DebuggerManager::useFastStart() const
void DebuggerManager::setUseCustomDumpers(bool on) void DebuggerManager::setUseCustomDumpers(bool on)
{ {
m_settings.m_useCustomDumpers = on; //m_settings.m_useCustomDumpers = on;
engine()->setUseCustomDumpers(on); //engine()->setUseCustomDumpers(on);
} }
void DebuggerManager::setUseFastStart(bool on) void DebuggerManager::setUseFastStart(bool on)

View File

@@ -2883,6 +2883,7 @@ static QString sizeofTypeExpression(const QString &type)
void GdbEngine::setUseCustomDumpers(bool on) void GdbEngine::setUseCustomDumpers(bool on)
{ {
qDebug() << "SWITCHING ON/OFF DUMPER DEBUGGING:" << on;
Q_UNUSED(on); Q_UNUSED(on);
// FIXME: a bit too harsh, but otherwise the treeview sometimes look funny // FIXME: a bit too harsh, but otherwise the treeview sometimes look funny
//m_expandedINames.clear(); //m_expandedINames.clear();
@@ -3298,7 +3299,8 @@ void GdbEngine::handleQueryDataDumper2(const GdbResultRecord &record)
QByteArray out = output.data(); QByteArray out = output.data();
out = out.mid(out.indexOf('"') + 2); // + 1 is success marker out = out.mid(out.indexOf('"') + 2); // + 1 is success marker
out = out.left(out.lastIndexOf('"')); out = out.left(out.lastIndexOf('"'));
out = out.replace('\'', '"'); //out.replace('\'', '"');
out.replace("\\", "");
out = "dummy={" + out + "}"; out = "dummy={" + out + "}";
//qDebug() << "OUTPUT: " << out; //qDebug() << "OUTPUT: " << out;
@@ -3488,7 +3490,8 @@ void GdbEngine::handleDumpCustomValue2(const GdbResultRecord &record,
QByteArray out = output.data(); QByteArray out = output.data();
out = out.mid(out.indexOf('"') + 2); // + 1 is the 'success marker' out = out.mid(out.indexOf('"') + 2); // + 1 is the 'success marker'
out = out.left(out.lastIndexOf('"')); out = out.left(out.lastIndexOf('"'));
out = out.replace('\'', '"'); //out.replace('\'', '"');
out.replace("\\", "");
out = "dummy={" + out + "}"; out = "dummy={" + out + "}";
//qDebug() << "OUTPUT: " << out; //qDebug() << "OUTPUT: " << out;

View File

@@ -145,7 +145,7 @@ void testQByteArray()
void testQHash() void testQHash()
{ {
#if 0 #if 1
QHash<int, float> hgg0; QHash<int, float> hgg0;
hgg0[11] = 11.0; hgg0[11] = 11.0;
hgg0[22] = 22.0; hgg0[22] = 22.0;
@@ -171,7 +171,7 @@ void testQHash()
#endif #endif
#if 0 #if 1
QHash<int, QString> hgg2; QHash<int, QString> hgg2;
hgg2[22] = "22.0"; hgg2[22] = "22.0";