From 36b638d985dbb4fc181b998f006337b7379f69e3 Mon Sep 17 00:00:00 2001 From: Olivier Goffart <olivier.goffart@nokia.com> Date: Wed, 28 Jul 2010 16:25:09 +0200 Subject: [PATCH] QML JS Debugger: support the debugger statement --- src/tools/qml/qmlobserver/jsdebuggeragent.cpp | 18 ++++++++++++++++-- src/tools/qml/qmlobserver/jsdebuggeragent.h | 4 ++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/tools/qml/qmlobserver/jsdebuggeragent.cpp b/src/tools/qml/qmlobserver/jsdebuggeragent.cpp index 0eb01c21b1b..29c3d400319 100644 --- a/src/tools/qml/qmlobserver/jsdebuggeragent.cpp +++ b/src/tools/qml/qmlobserver/jsdebuggeragent.cpp @@ -273,13 +273,11 @@ void JSDebuggerAgent::positionChange(qint64 scriptId, } } - switch (state) { case NoState: case Stopped: // Do nothing break; - case SteppingOutState: if (stepDepth >= 0) break; @@ -318,6 +316,22 @@ void JSDebuggerAgent::exceptionCatch(qint64 scriptId, Q_UNUSED(exception); } +bool JSDebuggerAgent::supportsExtension(QScriptEngineAgent::Extension extension) const +{ + return extension == QScriptEngineAgent::DebuggerInvocationRequest; +} + +QVariant JSDebuggerAgent::extension(QScriptEngineAgent::Extension extension, const QVariant& argument) +{ + if (extension == QScriptEngineAgent::DebuggerInvocationRequest) { + stopped(); + return QVariant(); + } + return QScriptEngineAgent::extension(extension, argument); +} + + + void JSDebuggerAgent::messageReceived(const QByteArray& message) { QDataStream ds(message); diff --git a/src/tools/qml/qmlobserver/jsdebuggeragent.h b/src/tools/qml/qmlobserver/jsdebuggeragent.h index acd7b18c92f..0618dcc0553 100644 --- a/src/tools/qml/qmlobserver/jsdebuggeragent.h +++ b/src/tools/qml/qmlobserver/jsdebuggeragent.h @@ -93,9 +93,9 @@ public: void exceptionCatch(qint64 scriptId, const QScriptValue &exception); -/* bool supportsExtension(Extension extension) const; + bool supportsExtension(Extension extension) const; QVariant extension(Extension extension, - const QVariant &argument = QVariant());*/ + const QVariant &argument = QVariant()); void messageReceived(const QByteArray &); void enabledChanged(bool); -- GitLab