From 33e0dd64f9cb4e517d1fc126e645b341803fb481 Mon Sep 17 00:00:00 2001 From: Aurindam Jana Date: Tue, 23 Apr 2013 13:44:41 +0200 Subject: 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 --- src/qml/debugger/qv8debugservice.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/qml/debugger/qv8debugservice.cpp') diff --git a/src/qml/debugger/qv8debugservice.cpp b/src/qml/debugger/qv8debugservice.cpp index f41907a032..9045b4b50e 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() -- cgit v1.2.3