Fix QML/JS debugging.
authorErik Verbruggen <erik.verbruggen@digia.com>
Fri, 10 Jul 2015 12:30:05 +0000 (14:30 +0200)
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>
Sun, 12 Jul 2015 13:44:44 +0000 (13:44 +0000)
Converting from any ScopedObject to Object* resulted in the same
pointer value. Prevent this by not using either, but instead use the
QV4::Value directly.

Task-number: QTBUG-47061
Change-Id: I98d3889f5504dbd5962099d30d4af9d57bc518f9
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
src/qml/debugger/qv4debugservice.cpp

index 32b7b38..cefb29e 100644 (file)
@@ -330,14 +330,14 @@ private:
         refsToInclude.append(value);
     }
 
-    void cacheObjectRef(QV4::Object *obj, int ref)
+    void cacheObjectRef(QV4::Value obj, int ref)
     {
-        objectRefs.insert(obj, ref);
+        objectRefs.insert(obj.val, ref);
     }
 
-    int cachedObjectRef(QV4::Object *obj) const
+    int cachedObjectRef(QV4::Value obj) const
     {
-        return objectRefs.value(obj, -1);
+        return objectRefs.value(obj.val, -1);
     }
 
 private:
@@ -347,7 +347,7 @@ private:
     QJsonArray *destination;
     QSet<int> usedRefs;
     QHash<int, QSet<int> > refsByHandle;
-    QHash<QV4::Object *, int> objectRefs;
+    QHash<quint64, int> objectRefs;
 };
 
 class QV4DebugServicePrivate : public QQmlConfigurableDebugServicePrivate