diff options
Diffstat (limited to 'src/plugins/qmltooling/qmldbg_debugger')
-rw-r--r-- | src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp | 18 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h | 4 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp index f788a0a217..db8c1feb92 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp @@ -43,14 +43,14 @@ QT_BEGIN_NAMESPACE -QV4::Heap::CallContext *QV4DataCollector::findContext(QV4::ExecutionEngine *engine, int frame) +QV4::CallContext *QV4DataCollector::findContext(QV4::ExecutionEngine *engine, int frame) { 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 = engine->parentContext(ctx); @@ -59,12 +59,12 @@ QV4::Heap::CallContext *QV4DataCollector::findContext(QV4::ExecutionEngine *engi 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; @@ -78,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, 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); @@ -379,8 +379,7 @@ void ArgumentCollectJob::run() QV4::Scope scope(engine); QV4::Scoped<QV4::CallContext> ctxt( - scope, QV4DataCollector::findScope( - QV4DataCollector::findContext(engine, frameNr), scopeNr)); + scope, QV4DataCollector::findScope(QV4DataCollector::findContext(engine, frameNr), scopeNr)); if (!ctxt) return; @@ -412,8 +411,7 @@ void LocalCollectJob::run() QV4::Scope scope(engine); QV4::Scoped<QV4::CallContext> ctxt( - scope, QV4DataCollector::findScope( - QV4DataCollector::findContext(engine, frameNr), scopeNr)); + scope, QV4DataCollector::findScope(QV4DataCollector::findContext(engine, frameNr), scopeNr)); if (!ctxt) return; diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h index f8cd0c1508..fb78c1614a 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::ExecutionEngine *engine, 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); |