forked from qt-creator/qt-creator
QmlDebugger: Exchange supported QDataStream versions
Use the lowest QDataStream version common to both the server and client. The server part was added to Qt 5.0 (commit 7f7cd79e), but we haven't used that yet. THis fixes a regression in the inspector where only some properties are shown. Task-number: QTCREATORBUG-10186 Change-Id: If6699eb7261e480587f6a21d54fb6b6107669b8f Reviewed-by: Robert Loehning <robert.loehning@digia.com> Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
This commit is contained in:
@@ -181,7 +181,7 @@ void BaseEngineDebugClient::statusChanged(ClientStatus status)
|
|||||||
|
|
||||||
void BaseEngineDebugClient::messageReceived(const QByteArray &data)
|
void BaseEngineDebugClient::messageReceived(const QByteArray &data)
|
||||||
{
|
{
|
||||||
QDataStream ds(data);
|
QmlDebugStream ds(data);
|
||||||
int queryId;
|
int queryId;
|
||||||
QByteArray type;
|
QByteArray type;
|
||||||
ds >> type >> queryId;
|
ds >> type >> queryId;
|
||||||
@@ -254,7 +254,7 @@ quint32 BaseEngineDebugClient::addWatch(const PropertyReference &property)
|
|||||||
if (status() == Enabled) {
|
if (status() == Enabled) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("WATCH_PROPERTY") << id << property.m_objectDebugId
|
ds << QByteArray("WATCH_PROPERTY") << id << property.m_objectDebugId
|
||||||
<< property.m_name.toUtf8();
|
<< property.m_name.toUtf8();
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
@@ -276,7 +276,7 @@ quint32 BaseEngineDebugClient::addWatch(const ObjectReference &object,
|
|||||||
if (status() == Enabled) {
|
if (status() == Enabled) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("WATCH_EXPR_OBJECT") << id << object.m_debugId << expr;
|
ds << QByteArray("WATCH_EXPR_OBJECT") << id << object.m_debugId << expr;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
@@ -289,7 +289,7 @@ quint32 BaseEngineDebugClient::addWatch(int objectDebugId)
|
|||||||
if (status() == Enabled) {
|
if (status() == Enabled) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("WATCH_OBJECT") << id << objectDebugId;
|
ds << QByteArray("WATCH_OBJECT") << id << objectDebugId;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
@@ -306,7 +306,7 @@ void BaseEngineDebugClient::removeWatch(quint32 id)
|
|||||||
{
|
{
|
||||||
if (status() == Enabled) {
|
if (status() == Enabled) {
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("NO_WATCH") << id;
|
ds << QByteArray("NO_WATCH") << id;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
@@ -318,7 +318,7 @@ quint32 BaseEngineDebugClient::queryAvailableEngines()
|
|||||||
if (status() == Enabled) {
|
if (status() == Enabled) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("LIST_ENGINES") << id;
|
ds << QByteArray("LIST_ENGINES") << id;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
@@ -331,7 +331,7 @@ quint32 BaseEngineDebugClient::queryRootContexts(const EngineReference &engine)
|
|||||||
if (status() == Enabled && engine.m_debugId != -1) {
|
if (status() == Enabled && engine.m_debugId != -1) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("LIST_OBJECTS") << id << engine.m_debugId;
|
ds << QByteArray("LIST_OBJECTS") << id << engine.m_debugId;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
@@ -344,7 +344,7 @@ quint32 BaseEngineDebugClient::queryObject(int objectId)
|
|||||||
if (status() == Enabled && objectId != -1) {
|
if (status() == Enabled && objectId != -1) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("FETCH_OBJECT") << id << objectId << false <<
|
ds << QByteArray("FETCH_OBJECT") << id << objectId << false <<
|
||||||
true;
|
true;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
@@ -358,7 +358,7 @@ quint32 BaseEngineDebugClient::queryObjectRecursive(int objectId)
|
|||||||
if (status() == Enabled && objectId != -1) {
|
if (status() == Enabled && objectId != -1) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("FETCH_OBJECT") << id << objectId << true <<
|
ds << QByteArray("FETCH_OBJECT") << id << objectId << true <<
|
||||||
true;
|
true;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
@@ -374,7 +374,7 @@ quint32 BaseEngineDebugClient::queryExpressionResult(int objectDebugId,
|
|||||||
if (status() == Enabled && objectDebugId != -1) {
|
if (status() == Enabled && objectDebugId != -1) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("EVAL_EXPRESSION") << id << objectDebugId << expr
|
ds << QByteArray("EVAL_EXPRESSION") << id << objectDebugId << expr
|
||||||
<< engineId;
|
<< engineId;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
@@ -393,7 +393,7 @@ quint32 BaseEngineDebugClient::setBindingForObject(
|
|||||||
if (status() == Enabled && objectDebugId != -1) {
|
if (status() == Enabled && objectDebugId != -1) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("SET_BINDING") << id << objectDebugId << propertyName
|
ds << QByteArray("SET_BINDING") << id << objectDebugId << propertyName
|
||||||
<< bindingExpression << isLiteralValue << source << line;
|
<< bindingExpression << isLiteralValue << source << line;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
@@ -409,7 +409,7 @@ quint32 BaseEngineDebugClient::resetBindingForObject(
|
|||||||
if (status() == Enabled && objectDebugId != -1) {
|
if (status() == Enabled && objectDebugId != -1) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("RESET_BINDING") << id << objectDebugId << propertyName;
|
ds << QByteArray("RESET_BINDING") << id << objectDebugId << propertyName;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
@@ -424,7 +424,7 @@ quint32 BaseEngineDebugClient::setMethodBody(
|
|||||||
if (status() == Enabled && objectDebugId != -1) {
|
if (status() == Enabled && objectDebugId != -1) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("SET_METHOD_BODY") << id << objectDebugId
|
ds << QByteArray("SET_METHOD_BODY") << id << objectDebugId
|
||||||
<< methodName << methodBody;
|
<< methodName << methodBody;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
@@ -439,7 +439,7 @@ quint32 BaseEngineDebugClient::queryObjectsForLocation(
|
|||||||
if (status() == Enabled) {
|
if (status() == Enabled) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("FETCH_OBJECTS_FOR_LOCATION") << id <<
|
ds << QByteArray("FETCH_OBJECTS_FOR_LOCATION") << id <<
|
||||||
fileName << lineNumber << columnNumber << false <<
|
fileName << lineNumber << columnNumber << false <<
|
||||||
true;
|
true;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include "declarativeenginedebugclient.h"
|
#include "declarativeenginedebugclient.h"
|
||||||
#include "qmldebugconstants.h"
|
#include "qmldebugconstants.h"
|
||||||
|
#include "qmldebugclient.h"
|
||||||
|
|
||||||
namespace QmlDebug {
|
namespace QmlDebug {
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ quint32 DeclarativeEngineDebugClient::setBindingForObject(
|
|||||||
if (status() == Enabled && objectDebugId != -1) {
|
if (status() == Enabled && objectDebugId != -1) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("SET_BINDING") << objectDebugId << propertyName
|
ds << QByteArray("SET_BINDING") << objectDebugId << propertyName
|
||||||
<< bindingExpression << isLiteralValue << source << line;
|
<< bindingExpression << isLiteralValue << source << line;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
@@ -65,7 +66,7 @@ quint32 DeclarativeEngineDebugClient::resetBindingForObject(
|
|||||||
if (status() == Enabled && objectDebugId != -1) {
|
if (status() == Enabled && objectDebugId != -1) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("RESET_BINDING") << objectDebugId << propertyName;
|
ds << QByteArray("RESET_BINDING") << objectDebugId << propertyName;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
@@ -80,7 +81,7 @@ quint32 DeclarativeEngineDebugClient::setMethodBody(
|
|||||||
if (status() == Enabled && objectDebugId != -1) {
|
if (status() == Enabled && objectDebugId != -1) {
|
||||||
id = getId();
|
id = getId();
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QmlDebugStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("SET_METHOD_BODY") << objectDebugId
|
ds << QByteArray("SET_METHOD_BODY") << objectDebugId
|
||||||
<< methodName << methodBody;
|
<< methodName << methodBody;
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
@@ -90,7 +91,7 @@ quint32 DeclarativeEngineDebugClient::setMethodBody(
|
|||||||
|
|
||||||
void DeclarativeEngineDebugClient::messageReceived(const QByteArray &data)
|
void DeclarativeEngineDebugClient::messageReceived(const QByteArray &data)
|
||||||
{
|
{
|
||||||
QDataStream ds(data);
|
QmlDebugStream ds(data);
|
||||||
QByteArray type;
|
QByteArray type;
|
||||||
ds >> type;
|
ds >> type;
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,8 @@
|
|||||||
namespace QmlDebug {
|
namespace QmlDebug {
|
||||||
|
|
||||||
const int protocolVersion = 1;
|
const int protocolVersion = 1;
|
||||||
|
int QmlDebugClient::s_dataStreamVersion = QDataStream::Qt_4_7;
|
||||||
|
|
||||||
const QString serverId = QLatin1String("QDeclarativeDebugServer");
|
const QString serverId = QLatin1String("QDeclarativeDebugServer");
|
||||||
const QString clientId = QLatin1String("QDeclarativeDebugClient");
|
const QString clientId = QLatin1String("QDeclarativeDebugClient");
|
||||||
|
|
||||||
@@ -95,7 +97,8 @@ void QmlDebugConnectionPrivate::advertisePlugins()
|
|||||||
void QmlDebugConnectionPrivate::connected()
|
void QmlDebugConnectionPrivate::connected()
|
||||||
{
|
{
|
||||||
QPacket pack;
|
QPacket pack;
|
||||||
pack << serverId << 0 << protocolVersion << plugins.keys();
|
QDataStream str;
|
||||||
|
pack << serverId << 0 << protocolVersion << plugins.keys() << QDataStream().version();
|
||||||
protocol->send(pack);
|
protocol->send(pack);
|
||||||
q->flush();
|
q->flush();
|
||||||
}
|
}
|
||||||
@@ -131,6 +134,12 @@ void QmlDebugConnectionPrivate::readyRead()
|
|||||||
serverPlugins.insert(pluginNames.at(i), pluginVersion);
|
serverPlugins.insert(pluginNames.at(i), pluginVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!pack.isEmpty()) {
|
||||||
|
pack >> QmlDebugClient::s_dataStreamVersion;
|
||||||
|
if (QmlDebugClient::s_dataStreamVersion
|
||||||
|
> QDataStream().version())
|
||||||
|
qWarning() << "Server returned invalid data stream version!";
|
||||||
|
}
|
||||||
validHello = true;
|
validHello = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -409,6 +418,30 @@ void QmlDebugClient::messageReceived(const QByteArray &)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QmlDebugStream::QmlDebugStream()
|
||||||
|
: QDataStream()
|
||||||
|
{
|
||||||
|
setVersion(QmlDebugClient::s_dataStreamVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
QmlDebugStream::QmlDebugStream(QIODevice *d)
|
||||||
|
: QDataStream(d)
|
||||||
|
{
|
||||||
|
setVersion(QmlDebugClient::s_dataStreamVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
QmlDebugStream::QmlDebugStream(QByteArray *ba, QIODevice::OpenMode flags)
|
||||||
|
: QDataStream(ba, flags)
|
||||||
|
{
|
||||||
|
setVersion(QmlDebugClient::s_dataStreamVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
QmlDebugStream::QmlDebugStream(const QByteArray &ba)
|
||||||
|
: QDataStream(ba)
|
||||||
|
{
|
||||||
|
setVersion(QmlDebugClient::s_dataStreamVersion);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace QmlDebug
|
} // namespace QmlDebug
|
||||||
|
|
||||||
#include <qmldebugclient.moc>
|
#include <qmldebugclient.moc>
|
||||||
|
|||||||
@@ -103,6 +103,18 @@ private:
|
|||||||
friend class QmlDebugConnection;
|
friend class QmlDebugConnection;
|
||||||
friend class QmlDebugConnectionPrivate;
|
friend class QmlDebugConnectionPrivate;
|
||||||
QScopedPointer<QmlDebugClientPrivate> d_ptr;
|
QScopedPointer<QmlDebugClientPrivate> d_ptr;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static int s_dataStreamVersion;
|
||||||
|
};
|
||||||
|
|
||||||
|
class QMLDEBUG_EXPORT QmlDebugStream : public QDataStream
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QmlDebugStream();
|
||||||
|
explicit QmlDebugStream(QIODevice *d);
|
||||||
|
QmlDebugStream(QByteArray *ba, QIODevice::OpenMode flags);
|
||||||
|
QmlDebugStream(const QByteArray &ba);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlDebug
|
} // namespace QmlDebug
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
using QmlDebug::QmlDebugStream;
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -522,7 +523,7 @@ void QmlV8DebuggerClientPrivate::setBreakpoint(const QString type, const QString
|
|||||||
// }
|
// }
|
||||||
if (type == _(EVENT)) {
|
if (type == _(EVENT)) {
|
||||||
QByteArray params;
|
QByteArray params;
|
||||||
QDataStream rs(¶ms, QIODevice::WriteOnly);
|
QmlDebugStream rs(¶ms, QIODevice::WriteOnly);
|
||||||
rs << target.toUtf8() << enabled;
|
rs << target.toUtf8() << enabled;
|
||||||
logSendMessage(QString(_("%1 %2 %3 %4")).arg(_(V8DEBUG), _(BREAKONSIGNAL), target, enabled?_("enabled"):_("disabled")));
|
logSendMessage(QString(_("%1 %2 %3 %4")).arg(_(V8DEBUG), _(BREAKONSIGNAL), target, enabled?_("enabled"):_("disabled")));
|
||||||
q->sendMessage(packMessage(BREAKONSIGNAL, params));
|
q->sendMessage(packMessage(BREAKONSIGNAL, params));
|
||||||
@@ -892,7 +893,7 @@ QByteArray QmlV8DebuggerClientPrivate::packMessage(const QByteArray &type, const
|
|||||||
{
|
{
|
||||||
SDEBUG(message);
|
SDEBUG(message);
|
||||||
QByteArray request;
|
QByteArray request;
|
||||||
QDataStream rs(&request, QIODevice::WriteOnly);
|
QmlDebugStream rs(&request, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = V8DEBUG;
|
QByteArray cmd = V8DEBUG;
|
||||||
rs << cmd << type << message;
|
rs << cmd << type << message;
|
||||||
return request;
|
return request;
|
||||||
@@ -1160,7 +1161,7 @@ void QmlV8DebuggerClient::getSourceFiles()
|
|||||||
|
|
||||||
void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
|
void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
|
||||||
{
|
{
|
||||||
QDataStream ds(data);
|
QmlDebugStream ds(data);
|
||||||
QByteArray command;
|
QByteArray command;
|
||||||
ds >> command;
|
ds >> command;
|
||||||
|
|
||||||
|
|||||||
@@ -34,11 +34,14 @@
|
|||||||
#include <debugger/stackhandler.h>
|
#include <debugger/stackhandler.h>
|
||||||
#include <debugger/debuggercore.h>
|
#include <debugger/debuggercore.h>
|
||||||
#include <debugger/debuggerstringutils.h>
|
#include <debugger/debuggerstringutils.h>
|
||||||
|
#include <qmldebug/qmldebugclient.h>
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
using QmlDebug::QmlDebugStream;
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -138,7 +141,7 @@ QScriptDebuggerClient::~QScriptDebuggerClient()
|
|||||||
void QScriptDebuggerClient::executeStep()
|
void QScriptDebuggerClient::executeStep()
|
||||||
{
|
{
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "STEPINTO";
|
QByteArray cmd = "STEPINTO";
|
||||||
rs << cmd;
|
rs << cmd;
|
||||||
d->logSendMessage(QLatin1String(cmd));
|
d->logSendMessage(QLatin1String(cmd));
|
||||||
@@ -148,7 +151,7 @@ void QScriptDebuggerClient::executeStep()
|
|||||||
void QScriptDebuggerClient::executeStepOut()
|
void QScriptDebuggerClient::executeStepOut()
|
||||||
{
|
{
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "STEPOUT";
|
QByteArray cmd = "STEPOUT";
|
||||||
rs << cmd;
|
rs << cmd;
|
||||||
d->logSendMessage(QLatin1String(cmd));
|
d->logSendMessage(QLatin1String(cmd));
|
||||||
@@ -158,7 +161,7 @@ void QScriptDebuggerClient::executeStepOut()
|
|||||||
void QScriptDebuggerClient::executeNext()
|
void QScriptDebuggerClient::executeNext()
|
||||||
{
|
{
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "STEPOVER";
|
QByteArray cmd = "STEPOVER";
|
||||||
rs << cmd;
|
rs << cmd;
|
||||||
d->logSendMessage(QLatin1String(cmd));
|
d->logSendMessage(QLatin1String(cmd));
|
||||||
@@ -168,7 +171,7 @@ void QScriptDebuggerClient::executeNext()
|
|||||||
void QScriptDebuggerClient::executeStepI()
|
void QScriptDebuggerClient::executeStepI()
|
||||||
{
|
{
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "STEPINTO";
|
QByteArray cmd = "STEPINTO";
|
||||||
rs << cmd;
|
rs << cmd;
|
||||||
d->logSendMessage(QLatin1String(cmd));
|
d->logSendMessage(QLatin1String(cmd));
|
||||||
@@ -189,7 +192,7 @@ void QScriptDebuggerClient::executeRunToLine(const ContextData &data)
|
|||||||
void QScriptDebuggerClient::continueInferior()
|
void QScriptDebuggerClient::continueInferior()
|
||||||
{
|
{
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "CONTINUE";
|
QByteArray cmd = "CONTINUE";
|
||||||
rs << cmd;
|
rs << cmd;
|
||||||
d->logSendMessage(QLatin1String(cmd));
|
d->logSendMessage(QLatin1String(cmd));
|
||||||
@@ -199,7 +202,7 @@ void QScriptDebuggerClient::continueInferior()
|
|||||||
void QScriptDebuggerClient::interruptInferior()
|
void QScriptDebuggerClient::interruptInferior()
|
||||||
{
|
{
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "INTERRUPT";
|
QByteArray cmd = "INTERRUPT";
|
||||||
rs << cmd;
|
rs << cmd;
|
||||||
d->logSendMessage(QLatin1String(cmd));
|
d->logSendMessage(QLatin1String(cmd));
|
||||||
@@ -234,7 +237,7 @@ void QScriptDebuggerClient::resetSession()
|
|||||||
void QScriptDebuggerClient::activateFrame(int index)
|
void QScriptDebuggerClient::activateFrame(int index)
|
||||||
{
|
{
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "ACTIVATE_FRAME";
|
QByteArray cmd = "ACTIVATE_FRAME";
|
||||||
rs << cmd
|
rs << cmd
|
||||||
<< index;
|
<< index;
|
||||||
@@ -287,7 +290,7 @@ void QScriptDebuggerClient::changeBreakpoint(const BreakpointModelId &id)
|
|||||||
void QScriptDebuggerClient::synchronizeBreakpoints()
|
void QScriptDebuggerClient::synchronizeBreakpoints()
|
||||||
{
|
{
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "BREAKPOINTS";
|
QByteArray cmd = "BREAKPOINTS";
|
||||||
rs << cmd
|
rs << cmd
|
||||||
<< d->breakpoints;
|
<< d->breakpoints;
|
||||||
@@ -314,7 +317,7 @@ void QScriptDebuggerClient::assignValueInDebugger(const WatchData *data,
|
|||||||
const QVariant &valueV)
|
const QVariant &valueV)
|
||||||
{
|
{
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "EXEC";
|
QByteArray cmd = "EXEC";
|
||||||
rs << cmd;
|
rs << cmd;
|
||||||
QString expression = QString(_("%1 = %2;")).arg(expr).arg(valueV.toString());
|
QString expression = QString(_("%1 = %2;")).arg(expr).arg(valueV.toString());
|
||||||
@@ -328,7 +331,7 @@ void QScriptDebuggerClient::assignValueInDebugger(const WatchData *data,
|
|||||||
void QScriptDebuggerClient::updateWatchData(const WatchData &data)
|
void QScriptDebuggerClient::updateWatchData(const WatchData &data)
|
||||||
{
|
{
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "EXEC";
|
QByteArray cmd = "EXEC";
|
||||||
rs << cmd;
|
rs << cmd;
|
||||||
rs << data.iname << data.name;
|
rs << data.iname << data.name;
|
||||||
@@ -340,7 +343,7 @@ void QScriptDebuggerClient::updateWatchData(const WatchData &data)
|
|||||||
void QScriptDebuggerClient::executeDebuggerCommand(const QString &command)
|
void QScriptDebuggerClient::executeDebuggerCommand(const QString &command)
|
||||||
{
|
{
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "EXEC";
|
QByteArray cmd = "EXEC";
|
||||||
QByteArray console = "console";
|
QByteArray console = "console";
|
||||||
rs << cmd << console << command;
|
rs << cmd << console << command;
|
||||||
@@ -353,7 +356,7 @@ void QScriptDebuggerClient::synchronizeWatchers(const QStringList &watchers)
|
|||||||
{
|
{
|
||||||
// send watchers list
|
// send watchers list
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "WATCH_EXPRESSIONS";
|
QByteArray cmd = "WATCH_EXPRESSIONS";
|
||||||
rs << cmd;
|
rs << cmd;
|
||||||
d->logSendMessage(QString::fromLatin1("%1 (%2)").arg(QLatin1String(cmd),
|
d->logSendMessage(QString::fromLatin1("%1 (%2)").arg(QLatin1String(cmd),
|
||||||
@@ -368,7 +371,7 @@ void QScriptDebuggerClient::expandObject(const QByteArray &iname, quint64 object
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "EXPAND";
|
QByteArray cmd = "EXPAND";
|
||||||
rs << cmd;
|
rs << cmd;
|
||||||
rs << iname << objectId;
|
rs << iname << objectId;
|
||||||
@@ -381,7 +384,7 @@ void QScriptDebuggerClient::sendPing()
|
|||||||
{
|
{
|
||||||
d->ping++;
|
d->ping++;
|
||||||
QByteArray reply;
|
QByteArray reply;
|
||||||
QDataStream rs(&reply, QIODevice::WriteOnly);
|
QmlDebugStream rs(&reply, QIODevice::WriteOnly);
|
||||||
QByteArray cmd = "PING";
|
QByteArray cmd = "PING";
|
||||||
rs << cmd;
|
rs << cmd;
|
||||||
rs << d->ping;
|
rs << d->ping;
|
||||||
@@ -392,7 +395,7 @@ void QScriptDebuggerClient::sendPing()
|
|||||||
void QScriptDebuggerClient::messageReceived(const QByteArray &data)
|
void QScriptDebuggerClient::messageReceived(const QByteArray &data)
|
||||||
{
|
{
|
||||||
QByteArray rwData = data;
|
QByteArray rwData = data;
|
||||||
QDataStream stream(&rwData, QIODevice::ReadOnly);
|
QmlDebugStream stream(&rwData, QIODevice::ReadOnly);
|
||||||
|
|
||||||
QByteArray command;
|
QByteArray command;
|
||||||
stream >> command;
|
stream >> command;
|
||||||
|
|||||||
Reference in New Issue
Block a user