Commit 3bd633ef authored by hjk's avatar hjk

move some of the code for handling template types from creator proper

to the "user space" (gdbmacros.cpp)
parent b7fe1e79
......@@ -2439,23 +2439,23 @@ void qDumpObjectData440(
d.protocolVersion = protocolVersion;
d.token = token;
//qDebug() << "SOCKET: after connect: state: " << qDumperSocket.state();
// simpledumpers is a list of all available dumpers that are
// _not_ templates. templates currently require special
// hardcoded handling in the debugger plugin.
// don't mention them here in this list
d << "simpledumpers=["
// This is a list of all available dumpers. Note that some templates
// currently require special hardcoded handling in the debugger plugin.
// 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"QImage\","
"\""NS"QFile\","
"\""NS"QFileInfo\","
"\""NS"QHash\","
"\""NS"QHashNode\","
"\""NS"QImage\","
"\""NS"QLocale\","
"\""NS"QMap\","
"\""NS"QMapNode\","
"\""NS"QModelIndex\","
//"\""NS"QHash\"," // handled on GH side
//"\""NS"QHashNode\","
//"\""NS"QMap\"," // handled on GH side
//"\""NS"QMapNode\","
"\""NS"QObject\","
"\""NS"QObjectMethodList\"," // hack to get nested properties display
"\""NS"QObjectPropertyList\","
......@@ -2465,15 +2465,20 @@ void qDumpObjectData440(
"\""NS"QObjectSlot\","
"\""NS"QObjectSlotList\","
#endif // PRIVATE_OBJECT_ALLOWED
"\""NS"QSet\","
"\""NS"QString\","
"\""NS"QStringList\","
"\""NS"QTextCodec\","
"\""NS"QVariant\","
"\""NS"QVector\","
"\""NS"QWidget\","
"\""NS"QDateTime\","
"\"string\","
"\"wstring\","
"\"std::basic_string\","
"\"std::list\","
"\"std::map\","
"\"std::string\","
"\"std::vector\","
"\"std::wstring\","
// << "\""NS"QRegion\","
"]";
......
......@@ -2916,42 +2916,17 @@ bool GdbEngine::isCustomValueDumperAvailable(const QString &type) const
return false;
if (m_dataDumperState != DataDumperAvailable)
return false;
// simple types
if (m_availableSimpleDumpers.contains(type))
return true;
// templates
QString tmplate;
QString inner;
if (extractTemplate(type, &tmplate, &inner)) {
if (type.startsWith(m_namespace)) {
tmplate = tmplate.mid(m_namespace.size());
if (tmplate == "QList")
return true;
if (tmplate == "QVector")
return true;
if (tmplate == "QHash")
return true;
if (tmplate == "QHashNode")
return true;
if (tmplate == "QMap")
return true;
if (tmplate == "QMapNode")
return true;
if (tmplate == "QSet")
return true;
}
if (tmplate == "std::list")
return true;
if (tmplate == "std::map")
return true;
if (tmplate == "std::vector" && inner != "bool")
return true;
if (tmplate == "std::basic_string") {
if (inner.startsWith("char@") || inner.startsWith("wchar_t@"))
return true;
}
}
return false;
if (!extractTemplate(type, &tmplate, &inner))
return false;
return m_availableSimpleDumpers.contains(tmplate);
}
void GdbEngine::runCustomDumper(const WatchData & data0, bool dumpChildren)
......@@ -2968,7 +2943,7 @@ void GdbEngine::runCustomDumper(const WatchData & data0, bool dumpChildren)
inners[i] = inners[i].simplified();
QString outertype = isTemplate ? tmplate : data.type;
// adjust the data extract
if (outertype == "QWidget")
outertype = "QObject";
......@@ -3334,7 +3309,7 @@ void GdbEngine::handleQueryDataDumper2(const GdbResultRecord &record)
//qDebug() << "DATA DUMPER TRIAL:" << record.toString();
GdbMi output = record.data.findChild("customvaluecontents");
GdbMi contents(output.data());
GdbMi simple = contents.findChild("simpledumpers");
GdbMi simple = contents.findChild("dumpers");
m_namespace = contents.findChild("namespace").data();
//qDebug() << "OUTPUT: " << output.toString();
//qDebug() << "CONTENTS: " << contents.toString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment