qmlplugindump: Improve error message for misbehaving plugin components.
Mirrors 6244008dcb43dde15dea3becbbec07d941b4759c in Qt Creator/2.3. (cherry picked from commit a39e975465a5dc0548891ccd93c4ff04165b60cd) Change-Id: I995eebe065ecf8b4f185d61987240f39ad11b57f Reviewed-on: http://codereview.qt.nokia.com/871 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
parent
32c0f5aa4f
commit
6feeee85f0
|
@ -68,6 +68,9 @@
|
||||||
QString pluginImportPath;
|
QString pluginImportPath;
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
|
QString currentProperty;
|
||||||
|
QString inObjectInstantiation;
|
||||||
|
|
||||||
void collectReachableMetaObjects(const QMetaObject *meta, QSet<const QMetaObject *> *metas)
|
void collectReachableMetaObjects(const QMetaObject *meta, QSet<const QMetaObject *> *metas)
|
||||||
{
|
{
|
||||||
if (! meta || metas->contains(meta))
|
if (! meta || metas->contains(meta))
|
||||||
|
@ -81,8 +84,6 @@ void collectReachableMetaObjects(const QMetaObject *meta, QSet<const QMetaObject
|
||||||
collectReachableMetaObjects(meta->superClass(), metas);
|
collectReachableMetaObjects(meta->superClass(), metas);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString currentProperty;
|
|
||||||
|
|
||||||
void collectReachableMetaObjects(QObject *object, QSet<const QMetaObject *> *metas)
|
void collectReachableMetaObjects(QObject *object, QSet<const QMetaObject *> *metas)
|
||||||
{
|
{
|
||||||
if (! object)
|
if (! object)
|
||||||
|
@ -214,7 +215,10 @@ QSet<const QMetaObject *> collectReachableMetaObjects(const QString &importCode,
|
||||||
QDeclarativeComponent c(engine);
|
QDeclarativeComponent c(engine);
|
||||||
c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/typeinstance.qml"));
|
c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/typeinstance.qml"));
|
||||||
|
|
||||||
|
inObjectInstantiation = tyName;
|
||||||
QObject *object = c.create();
|
QObject *object = c.create();
|
||||||
|
inObjectInstantiation.clear();
|
||||||
|
|
||||||
if (object)
|
if (object)
|
||||||
collectReachableMetaObjects(object, &metas);
|
collectReachableMetaObjects(object, &metas);
|
||||||
else
|
else
|
||||||
|
@ -436,6 +440,8 @@ void sigSegvHandler(int) {
|
||||||
fprintf(stderr, "Error: SEGV\n");
|
fprintf(stderr, "Error: SEGV\n");
|
||||||
if (!currentProperty.isEmpty())
|
if (!currentProperty.isEmpty())
|
||||||
fprintf(stderr, "While processing the property '%s', which probably has uninitialized data.\n", currentProperty.toLatin1().constData());
|
fprintf(stderr, "While processing the property '%s', which probably has uninitialized data.\n", currentProperty.toLatin1().constData());
|
||||||
|
if (!inObjectInstantiation.isEmpty())
|
||||||
|
fprintf(stderr, "While instantiating the object '%s'.\n", inObjectInstantiation.toLatin1().constData());
|
||||||
exit(EXIT_SEGV);
|
exit(EXIT_SEGV);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue