aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-09-25 20:56:51 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-09-25 20:56:51 +0200
commitf9ef039ad955db67dc3ab6e9056afc4a325aa9a3 (patch)
tree4928ff85fb630639e306ea4eb7137a2064a80c8b /src/plugins
parent0238c739f81911f0963cf2c40b27dcfc8e3d38b7 (diff)
parent52fb4685e95e5b44e54d2d0f8ea27dea866c75e9 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: src/qml/debugger/qqmldebug.cpp Change-Id: I93de5a81b18cdece475870cf7cfba1b9baef2304
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp29
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h4
-rw-r--r--src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp24
3 files changed, 22 insertions, 35 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
index ff29814de6..b13c469893 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
@@ -43,32 +43,28 @@
QT_BEGIN_NAMESPACE
-QV4::Heap::CallContext *QV4DataCollector::findContext(QV4::Heap::ExecutionContext *ctxt, int frame)
+QV4::CallContext *QV4DataCollector::findContext(QV4::ExecutionEngine *engine, int frame)
{
- if (!ctxt)
- return 0;
-
- QV4::Scope scope(ctxt->engine);
- QV4::ScopedContext ctx(scope, ctxt);
+ QV4::ExecutionContext *ctx = engine->currentContext;
while (ctx) {
QV4::CallContext *cCtxt = ctx->asCallContext();
if (cCtxt && cCtxt->d()->function) {
if (frame < 1)
- return cCtxt->d();
+ return cCtxt;
--frame;
}
- ctx = ctx->d()->parent;
+ ctx = engine->parentContext(ctx);
}
return 0;
}
-QV4::Heap::CallContext *QV4DataCollector::findScope(QV4::Heap::ExecutionContext *ctxt, int scope)
+QV4::Heap::CallContext *QV4DataCollector::findScope(QV4::ExecutionContext *ctxt, int scope)
{
if (!ctxt)
return 0;
- QV4::Scope s(ctxt->engine);
+ QV4::Scope s(ctxt->d()->engine);
QV4::ScopedContext ctx(s, ctxt);
for (; scope > 0 && ctx; --scope)
ctx = ctx->d()->outer;
@@ -82,11 +78,11 @@ QVector<QV4::Heap::ExecutionContext::ContextType> QV4DataCollector::getScopeType
QVector<QV4::Heap::ExecutionContext::ContextType> types;
QV4::Scope scope(engine);
- QV4::Scoped<QV4::CallContext> sctxt(scope, findContext(engine->currentContext(), frame));
+ QV4::CallContext *sctxt = findContext(engine, frame);
if (!sctxt || sctxt->d()->type < QV4::Heap::ExecutionContext::Type_QmlContext)
return types;
- QV4::ScopedContext it(scope, sctxt->d());
+ QV4::ScopedContext it(scope, sctxt);
for (; it; it = it->d()->outer)
types.append(it->d()->type);
@@ -382,8 +378,7 @@ void ArgumentCollectJob::run()
QV4::Scope scope(engine);
QV4::Scoped<QV4::CallContext> ctxt(
- scope, QV4DataCollector::findScope(
- QV4DataCollector::findContext(engine->currentContext(), frameNr), scopeNr));
+ scope, QV4DataCollector::findScope(QV4DataCollector::findContext(engine, frameNr), scopeNr));
if (!ctxt)
return;
@@ -415,8 +410,7 @@ void LocalCollectJob::run()
QV4::Scope scope(engine);
QV4::Scoped<QV4::CallContext> ctxt(
- scope, QV4DataCollector::findScope(
- QV4DataCollector::findContext(engine->currentContext(), frameNr), scopeNr));
+ scope, QV4DataCollector::findScope(QV4DataCollector::findContext(engine, frameNr), scopeNr));
if (!ctxt)
return;
@@ -447,8 +441,7 @@ void ThisCollectJob::run()
bool ThisCollectJob::myRun()
{
QV4::Scope scope(engine);
- QV4::ScopedContext ctxt(scope, QV4DataCollector::findContext(engine->currentContext(),
- frameNr));
+ QV4::ScopedContext ctxt(scope, QV4DataCollector::findContext(engine, frameNr));
while (ctxt) {
if (QV4::CallContext *cCtxt = ctxt->asCallContext())
if (cCtxt->d()->activation)
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h
index 39aed5b868..39d621e95e 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h
@@ -45,8 +45,8 @@ public:
typedef uint Ref;
typedef QVector<uint> Refs;
- static QV4::Heap::CallContext *findContext(QV4::Heap::ExecutionContext *ctxt, int frame);
- static QV4::Heap::CallContext *findScope(QV4::Heap::ExecutionContext *ctxt, int scope);
+ static QV4::CallContext *findContext(QV4::ExecutionEngine *engine, int frame);
+ static QV4::Heap::CallContext *findScope(QV4::ExecutionContext *ctxt, int scope);
static QVector<QV4::Heap::ExecutionContext::ContextType> getScopeTypes(
QV4::ExecutionEngine *engine, int frame);
diff --git a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp
index 6af43b1823..d3a8d1f0d1 100644
--- a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp
+++ b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp
@@ -223,27 +223,21 @@ void QQmlDebugServerThread::run()
Q_ASSERT_X(m_server != 0, Q_FUNC_INFO, "There should always be a debug server available here.");
QQmlDebugServerConnection *connection = loadQQmlDebugServerConnection(m_pluginName);
if (connection) {
- connection->setServer(m_server);
-
- if (m_fileName.isEmpty()) {
- if (!connection->setPortRange(m_portFrom, m_portTo, m_server->blockingMode(),
- m_hostAddress)) {
- delete connection;
- return;
- }
- } else {
- if (!connection->setFileName(m_fileName, m_server->blockingMode())) {
- delete connection;
- return;
- }
- }
-
{
QMutexLocker connectionLocker(&m_server->m_helloMutex);
m_server->m_connection = connection;
+ connection->setServer(m_server);
m_server->m_helloCondition.wakeAll();
}
+ if (m_fileName.isEmpty()) {
+ if (!connection->setPortRange(m_portFrom, m_portTo, m_server->blockingMode(),
+ m_hostAddress))
+ return;
+ } else if (!connection->setFileName(m_fileName, m_server->blockingMode())) {
+ return;
+ }
+
if (m_server->blockingMode())
connection->waitForConnection();
} else {