summaryrefslogtreecommitdiffstats
path: root/tools/qmlplugindump
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-06-29 08:06:39 (GMT)
committerChristian Kamm <christian.d.kamm@nokia.com>2011-06-29 08:06:39 (GMT)
commita39e975465a5dc0548891ccd93c4ff04165b60cd (patch)
tree9181e3b22a44b41eea600ad9dffe6fe098df0601 /tools/qmlplugindump
parent20f8357c8ee570f57091e20b9c0a9a1455dc1e8d (diff)
downloadQt-a39e975465a5dc0548891ccd93c4ff04165b60cd.zip
Qt-a39e975465a5dc0548891ccd93c4ff04165b60cd.tar.gz
Qt-a39e975465a5dc0548891ccd93c4ff04165b60cd.tar.bz2
qmlplugindump: Improve error message for misbehaving plugin components.
Mirrors 6244008dcb43dde15dea3becbbec07d941b4759c in Qt Creator/2.3. Reviewed-by: Kai Koehne
Diffstat (limited to 'tools/qmlplugindump')
-rw-r--r--tools/qmlplugindump/main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp
index 454f0f8..af291ee 100644
--- a/tools/qmlplugindump/main.cpp
+++ b/tools/qmlplugindump/main.cpp
@@ -68,6 +68,9 @@
QString pluginImportPath;
bool verbose = false;
+QString currentProperty;
+QString inObjectInstantiation;
+
void collectReachableMetaObjects(const QMetaObject *meta, QSet<const QMetaObject *> *metas)
{
if (! meta || metas->contains(meta))
@@ -81,8 +84,6 @@ void collectReachableMetaObjects(const QMetaObject *meta, QSet<const QMetaObject
collectReachableMetaObjects(meta->superClass(), metas);
}
-QString currentProperty;
-
void collectReachableMetaObjects(QObject *object, QSet<const QMetaObject *> *metas)
{
if (! object)
@@ -214,7 +215,10 @@ QSet<const QMetaObject *> collectReachableMetaObjects(const QString &importCode,
QDeclarativeComponent c(engine);
c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/typeinstance.qml"));
+ inObjectInstantiation = tyName;
QObject *object = c.create();
+ inObjectInstantiation.clear();
+
if (object)
collectReachableMetaObjects(object, &metas);
else
@@ -433,6 +437,8 @@ void sigSegvHandler(int) {
fprintf(stderr, "Error: SEGV\n");
if (!currentProperty.isEmpty())
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);
}
#endif