summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-06-21 07:05:12 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-06-21 07:05:12 (GMT)
commitd5631f115c2e32f8201e98813613010c9d7cb590 (patch)
tree9cf57674f8c70d53ca15e2530af1663c16f60e9d /src
parent1ba1c20a38442d91bcba2761d6d90d6077b7b361 (diff)
parentca8ad516ff5e2a4579359c4c8a2a03ae8b7cd8b2 (diff)
downloadQt-d5631f115c2e32f8201e98813613010c9d7cb590.zip
Qt-d5631f115c2e32f8201e98813613010c9d7cb590.tar.gz
Qt-d5631f115c2e32f8201e98813613010c9d7cb590.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-qml-staging: QDeclarativeDebug: Fix cases where multiple packets arrive in one go Fix js debugging autotest on Windows + Add license header Rewrite autotests for js debugging Rename qdeclarativescriptdebugging autotest directory Create property cache in case of Component{} root
Diffstat (limited to 'src')
-rw-r--r--src/declarative/debugger/qjsdebuggeragent_p.h11
-rw-r--r--src/declarative/debugger/qpacketprotocol.cpp19
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp6
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp21
4 files changed, 44 insertions, 13 deletions
diff --git a/src/declarative/debugger/qjsdebuggeragent_p.h b/src/declarative/debugger/qjsdebuggeragent_p.h
index 309588e..4b27fc8 100644
--- a/src/declarative/debugger/qjsdebuggeragent_p.h
+++ b/src/declarative/debugger/qjsdebuggeragent_p.h
@@ -94,6 +94,12 @@ inline QDataStream &operator<<(QDataStream &s, const JSAgentWatchData &data)
<< data.type << data.hasChildren << data.objectId;
}
+inline QDataStream &operator>>(QDataStream &s, JSAgentWatchData &data)
+{
+ return s >> data.exp >> data.name >> data.value
+ >> data.type >> data.hasChildren >> data.objectId;
+}
+
struct JSAgentStackData
{
QByteArray functionName;
@@ -106,6 +112,11 @@ inline QDataStream &operator<<(QDataStream &s, const JSAgentStackData &data)
return s << data.functionName << data.fileUrl << data.lineNumber;
}
+inline QDataStream &operator>>(QDataStream &s, JSAgentStackData &data)
+{
+ return s >> data.functionName >> data.fileUrl >> data.lineNumber;
+}
+
struct JSAgentBreakpointData
{
QByteArray functionName;
diff --git a/src/declarative/debugger/qpacketprotocol.cpp b/src/declarative/debugger/qpacketprotocol.cpp
index 9caaa79..f53d2a3 100644
--- a/src/declarative/debugger/qpacketprotocol.cpp
+++ b/src/declarative/debugger/qpacketprotocol.cpp
@@ -164,12 +164,16 @@ public Q_SLOTS:
void readyToRead()
{
+ bool gotPackets = false;
while (true) {
- // Need to get trailing data
+ // Get size header (if not in progress)
if (-1 == inProgressSize) {
// We need a size header of sizeof(qint32)
- if (sizeof(qint32) > (uint)dev->bytesAvailable())
- return;
+ if (sizeof(qint32) > (uint)dev->bytesAvailable()) {
+ if (gotPackets)
+ emit readyRead();
+ return; // no more data available
+ }
// Read size header
int read = dev->read((char *)&inProgressSize, sizeof(qint32));
@@ -200,9 +204,12 @@ public Q_SLOTS:
inProgress.clear();
waitingForPacket = false;
- emit readyRead();
- } else
- return;
+ gotPackets = true;
+ } else {
+ if (gotPackets)
+ emit readyRead();
+ return; // packet in progress is not yet complete
+ }
}
}
}
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index e642a67..abde4ad 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -622,6 +622,7 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine,
out->dumpInstructions();
if (compilerStatDump())
dumpStats();
+ Q_ASSERT(out->rootPropertyCache);
} else {
reset(out);
}
@@ -1218,6 +1219,11 @@ void QDeclarativeCompiler::genComponent(QDeclarativeParser::Object *obj)
id.setId.index = obj->idIndex;
output->bytecode << id;
}
+
+ if (obj == unitRoot) {
+ output->rootPropertyCache = output->types[obj->type].createPropertyCache(engine);
+ output->rootPropertyCache->addref();
+ }
}
bool QDeclarativeCompiler::buildComponent(QDeclarativeParser::Object *obj,
diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
index abc60e1..283f7d4 100644
--- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
+++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp
@@ -125,7 +125,13 @@ void QTcpServerConnection::disconnect()
bool QTcpServerConnection::waitForMessage()
{
Q_D(QTcpServerConnection);
- return d->protocol->waitForReadyRead(-1);
+ if (d->protocol->packetsAvailable() > 0) {
+ QPacket packet = d->protocol->read();
+ d->debugServer->receiveMessage(packet.data());
+ return true;
+ } else {
+ return d->protocol->waitForReadyRead(-1);
+ }
}
void QTcpServerConnection::setPort(int port, bool block)
@@ -145,10 +151,11 @@ void QTcpServerConnection::listen()
d->tcpServer = new QTcpServer(this);
QObject::connect(d->tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection()));
- if (d->tcpServer->listen(QHostAddress::Any, d->port))
+ if (d->tcpServer->listen(QHostAddress::Any, d->port)) {
qWarning("QDeclarativeDebugServer: Waiting for connection on port %d...", d->port);
- else
+ } else {
qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port);
+ }
}
@@ -158,10 +165,10 @@ void QTcpServerConnection::readyRead()
if (!d->protocol)
return;
- QPacket packet = d->protocol->read();
-
- QByteArray content = packet.data();
- d->debugServer->receiveMessage(content);
+ while (d->protocol->packetsAvailable() > 0) {
+ QPacket packet = d->protocol->read();
+ d->debugServer->receiveMessage(packet.data());
+ }
}
void QTcpServerConnection::newConnection()