From: Aurindam Jana Date: Tue, 23 Apr 2013 11:44:41 +0000 (+0200) Subject: V8Debugging: Set Isolate when sending debug messages to v8 X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=33e0dd64f9cb4e517d1fc126e645b341803fb481;p=konrad%2Fqtdeclarative.git V8Debugging: Set Isolate when sending debug messages to v8 Pass the Isolate used for setting the DebugMessageDispatchHandler to SendDebugMessage. This is to ensure that the proper dispatch handler is called since the Debugger is per Isolate. Change-Id: I4497155b90d4b678a5c4116859269892441ce70e Reviewed-by: Kai Koehne --- diff --git a/src/qml/debugger/qv8debugservice.cpp b/src/qml/debugger/qv8debugservice.cpp index f41907a..9045b4b 100644 --- a/src/qml/debugger/qv8debugservice.cpp +++ b/src/qml/debugger/qv8debugservice.cpp @@ -107,7 +107,8 @@ class QV8DebugServicePrivate : public QQmlDebugServicePrivate { public: QV8DebugServicePrivate() - : engine(0) + : engine(0), + debugIsolate(0) { } @@ -119,6 +120,7 @@ public: QWaitCondition initializeCondition; QStringList breakOnSignals; const QV8Engine *engine; + v8::Isolate *debugIsolate; }; QV8DebugService::QV8DebugService(QObject *parent) @@ -186,6 +188,9 @@ void QV8DebugService::signalEmitted(const QString &signal) // executed in the gui thread void QV8DebugService::init() { + Q_D(QV8DebugService); + if (!d->debugIsolate) + d->debugIsolate = v8::Isolate::GetCurrent(); v8::Debug::SetMessageHandler2(DebugMessageHandler); v8::Debug::SetDebugMessageDispatchHandler(DebugMessageDispatchHandler); QV4Compiler::enableV4(false); @@ -267,7 +272,8 @@ void QV8DebugService::messageReceived(const QByteArray &message) void QV8DebugService::sendDebugMessage(const QString &message) { - v8::Debug::SendCommand(message.utf16(), message.size()); + Q_D(QV8DebugService); + v8::Debug::SendCommand(message.utf16(), message.size(), 0, d->debugIsolate); } void QV8DebugService::processDebugMessages()