Commit 80d3ebed authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlDebugger: Make sure v8 messages show up in the debugger log



Change-Id: Icd65cde2bcb09eaa35cf67399e60e9d9f4484105
Reviewed-by: default avatarAurindam Jana <aurindam.jana@nokia.com>
parent b67c0d5f
......@@ -420,7 +420,6 @@ void QmlEngine::continueInferior()
{
QTC_ASSERT(state() == InferiorStopOk, qDebug() << state());
if (d->m_adapter.activeDebuggerClient()) {
logMessage(LogSend, "CONTINUE");
d->m_adapter.activeDebuggerClient()->continueInferior();
}
resetLocation();
......@@ -431,7 +430,6 @@ void QmlEngine::continueInferior()
void QmlEngine::interruptInferior()
{
if (d->m_adapter.activeDebuggerClient()) {
logMessage(LogSend, "INTERRUPT");
d->m_adapter.activeDebuggerClient()->interruptInferior();
}
notifyInferiorStopOk();
......@@ -440,7 +438,6 @@ void QmlEngine::interruptInferior()
void QmlEngine::executeStep()
{
if (d->m_adapter.activeDebuggerClient()) {
logMessage(LogSend, "STEPINTO");
d->m_adapter.activeDebuggerClient()->executeStep();
}
notifyInferiorRunRequested();
......@@ -450,7 +447,6 @@ void QmlEngine::executeStep()
void QmlEngine::executeStepI()
{
if (d->m_adapter.activeDebuggerClient()) {
logMessage(LogSend, "STEPINTO");
d->m_adapter.activeDebuggerClient()->executeStepI();
}
notifyInferiorRunRequested();
......@@ -460,7 +456,6 @@ void QmlEngine::executeStepI()
void QmlEngine::executeStepOut()
{
if (d->m_adapter.activeDebuggerClient()) {
logMessage(LogSend, "STEPOUT");
d->m_adapter.activeDebuggerClient()->executeStepOut();
}
notifyInferiorRunRequested();
......@@ -470,7 +465,6 @@ void QmlEngine::executeStepOut()
void QmlEngine::executeNext()
{
if (d->m_adapter.activeDebuggerClient()) {
logMessage(LogSend, "STEPOVER");
d->m_adapter.activeDebuggerClient()->executeNext();
}
notifyInferiorRunRequested();
......@@ -506,7 +500,6 @@ void QmlEngine::activateFrame(int index)
return;
if (d->m_adapter.activeDebuggerClient()) {
logMessage(LogSend, QString("%1 %2").arg(QString("ACTIVATE_FRAME"), QString::number(index)));
d->m_adapter.activeDebuggerClient()->activateFrame(index);
}
gotoLocation(stackHandler()->frames().value(index));
......@@ -684,9 +677,6 @@ void QmlEngine::assignValueInDebugger(const WatchData *data,
{
quint64 objectId = data->id;
if (objectId > 0 && !expression.isEmpty() && d->m_adapter.activeDebuggerClient()) {
logMessage(LogSend, QString("%1 %2 %3 %4 %5").arg(
QString("SET_PROPERTY"), QString::number(objectId), QString(expression),
valueV.toString()));
d->m_adapter.activeDebuggerClient()->assignValueInDebugger(expression.toUtf8(), objectId, expression, valueV.toString());
}
}
......@@ -700,8 +690,6 @@ void QmlEngine::updateWatchData(const WatchData &data,
if (!data.name.isEmpty() && d->m_adapter.activeDebuggerClient()) {
if (data.isValueNeeded()) {
logMessage(LogSend, QString("%1 %2 %3").arg(QString("EXEC"), QString(data.iname),
QString(data.name)));
d->m_adapter.activeDebuggerClient()->updateWatchData(data);
}
if (data.isChildrenNeeded()
......@@ -720,8 +708,6 @@ void QmlEngine::synchronizeWatchers()
{
QStringList watchedExpressions = watchHandler()->watchedExpressions();
// send watchers list
logMessage(LogSend, QString("%1 %2").arg(
QString("WATCH_EXPRESSIONS"), watchedExpressions.join(", ")));
if (d->m_adapter.activeDebuggerClient()) {
d->m_adapter.activeDebuggerClient()->synchronizeWatchers(watchedExpressions);
} else {
......@@ -778,8 +764,6 @@ void QmlEngine::wrongSetupMessageBoxFinished(int result)
void QmlEngine::executeDebuggerCommand(const QString& command)
{
if (d->m_adapter.activeDebuggerClient()) {
logMessage(LogSend, QString("%1 %2 %3").arg(QString("EXEC"), QString("console"),
QString(command)));
d->m_adapter.activeDebuggerClient()->executeDebuggerCommand(command);
}
}
......@@ -790,13 +774,13 @@ QString QmlEngine::qmlImportPath() const
return startParameters().environment.value("QML_IMPORT_PATH");
}
void QmlEngine::logMessage(LogDirection direction, const QString &message)
void QmlEngine::logMessage(const QString &service, LogDirection direction, const QString &message)
{
QString msg = "QmlDebugger";
QString msg = service;
if (direction == LogSend) {
msg += " sending ";
msg += ": sending ";
} else {
msg += " receiving ";
msg += ": receiving ";
}
msg += message;
showMessage(msg, LogDebug);
......
......@@ -72,7 +72,7 @@ public:
QString toFileInProject(const QUrl &fileUrl);
void inferiorSpontaneousStop();
void logMessage(LogDirection direction, const QString &str);
void logMessage(const QString &service, LogDirection direction, const QString &str);
QmlAdapter *adapter() const;
......
......@@ -122,10 +122,14 @@ public:
QmlV8ObjectData extractData(const QVariant &data);
void clearCache();
void logSendMessage(const QString &msg) const;
void logReceiveMessage(const QString &msg) const;
private:
QByteArray packMessage(const QByteArray &message);
QScriptValue initObject();
public:
QmlV8DebuggerClient *q;
......@@ -175,6 +179,7 @@ void QmlV8DebuggerClientPrivate::connect()
jsonVal.setProperty(_(COMMAND), QScriptValue(_(CONNECT)));
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -188,6 +193,7 @@ void QmlV8DebuggerClientPrivate::disconnect()
jsonVal.setProperty(_(COMMAND), QScriptValue(_(DISCONNECT)));
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -201,6 +207,7 @@ void QmlV8DebuggerClientPrivate::interrupt()
jsonVal.setProperty(_(COMMAND), QScriptValue(_(INTERRUPT)));
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -241,6 +248,7 @@ void QmlV8DebuggerClientPrivate::continueDebugging(QmlV8DebuggerClient::StepActi
}
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -298,6 +306,7 @@ void QmlV8DebuggerClientPrivate::evaluate(const QString expr, bool global,
jsonVal.setProperty(_(ARGUMENTS), args);
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -330,6 +339,7 @@ void QmlV8DebuggerClientPrivate::lookup(QList<int> handles, bool includeSource)
jsonVal.setProperty(_(ARGUMENTS), args);
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -361,6 +371,7 @@ void QmlV8DebuggerClientPrivate::backtrace(int fromFrame, int toFrame, bool bott
jsonVal.setProperty(_(ARGUMENTS), args);
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -383,6 +394,7 @@ void QmlV8DebuggerClientPrivate::frame(int number)
}
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -410,6 +422,7 @@ void QmlV8DebuggerClientPrivate::scope(int number, int frameNumber)
}
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -433,6 +446,7 @@ void QmlV8DebuggerClientPrivate::scopes(int frameNumber)
}
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -475,6 +489,7 @@ void QmlV8DebuggerClientPrivate::scripts(int types, const QList<int> ids, bool i
jsonVal.setProperty(_(ARGUMENTS), args);
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -506,6 +521,7 @@ void QmlV8DebuggerClientPrivate::source(int frame, int fromLine, int toLine)
jsonVal.setProperty(_(ARGUMENTS), args);
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -550,6 +566,7 @@ void QmlV8DebuggerClientPrivate::setBreakpoint(const QString type, const QString
jsonVal.setProperty(_(ARGUMENTS), args);
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -584,6 +601,7 @@ void QmlV8DebuggerClientPrivate::changeBreakpoint(int breakpoint, bool enabled,
jsonVal.setProperty(_(ARGUMENTS), args);
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -606,6 +624,7 @@ void QmlV8DebuggerClientPrivate::clearBreakpoint(int breakpoint)
jsonVal.setProperty(_(ARGUMENTS), args);
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -638,6 +657,7 @@ void QmlV8DebuggerClientPrivate::setExceptionBreak(QmlV8DebuggerClient::Exceptio
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -652,6 +672,7 @@ void QmlV8DebuggerClientPrivate::listBreakpoints()
QScriptValue(_(LISTBREAKPOINTS)));
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -674,6 +695,7 @@ void QmlV8DebuggerClientPrivate::v8flags(const QString flags)
jsonVal.setProperty(_(ARGUMENTS), args);
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -687,6 +709,7 @@ void QmlV8DebuggerClientPrivate::version()
jsonVal.setProperty(_(COMMAND), QScriptValue(_(VERSION)));
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -711,6 +734,7 @@ void QmlV8DebuggerClientPrivate::version()
// jsonVal.setProperty(_(ARGUMENTS), args);
// const QScriptValue jsonMessage = m_stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
// logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
// q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
//}
......@@ -733,6 +757,7 @@ void QmlV8DebuggerClientPrivate::gc()
jsonVal.setProperty(_(ARGUMENTS), args);
const QScriptValue jsonMessage = stringifier.call(QScriptValue(), QScriptValueList() << jsonVal);
logSendMessage(QString(_("%1 %2")).arg(_(V8DEBUG), jsonMessage.toString()));
q->sendMessage(packMessage(jsonMessage.toString().toUtf8()));
}
......@@ -860,6 +885,18 @@ QScriptValue QmlV8DebuggerClientPrivate::initObject()
return jsonVal;
}
void QmlV8DebuggerClientPrivate::logSendMessage(const QString &msg) const
{
if (engine)
engine->logMessage("V8DebuggerClient", QmlEngine::LogSend, msg);
}
void QmlV8DebuggerClientPrivate::logReceiveMessage(const QString &msg) const
{
if (engine)
engine->logMessage("V8DebuggerClient", QmlEngine::LogReceive, msg);
}
///////////////////////////////////////////////////////////////////////
//
// QmlV8DebuggerClient
......@@ -1078,6 +1115,7 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
QString responseString(response);
SDEBUG(responseString);
d->logReceiveMessage(QString(_("%1 %2")).arg(_(V8DEBUG), responseString));
const QVariantMap resp = d->parser.call(QScriptValue(),
QScriptValueList() <<
......@@ -1090,9 +1128,6 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
bool success = resp.value(_("success")).toBool();
if (!success) {
SDEBUG("Request was unsuccessful");
d->engine->logMessage(QmlEngine::LogReceive,
QString(_("V8 Response Error: %1")).arg(
resp.value(_("message")).toString()));
}
const QString debugCommand(resp.value(_(COMMAND)).toString());
......
......@@ -39,6 +39,7 @@
#include "qmlengine.h"
#include "stackhandler.h"
#include "debuggercore.h"
#include "debuggerstringutils.h"
#include <QTextDocument>
#include <QFileInfo>
......@@ -125,6 +126,9 @@ public:
int ping;
QmlEngine *engine;
JSAgentBreakpoints breakpoints;
void logSendMessage(const QString &msg) const;
void logReceiveMessage(const QString &msg) const;
};
QScriptDebuggerClient::QScriptDebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection* client)
......@@ -144,6 +148,7 @@ void QScriptDebuggerClient::executeStep()
QDataStream rs(&reply, QIODevice::WriteOnly);
QByteArray cmd = "STEPINTO";
rs << cmd;
d->logSendMessage(cmd);
sendMessage(reply);
}
......@@ -153,6 +158,7 @@ void QScriptDebuggerClient::executeStepOut()
QDataStream rs(&reply, QIODevice::WriteOnly);
QByteArray cmd = "STEPOUT";
rs << cmd;
d->logSendMessage(cmd);
sendMessage(reply);
}
......@@ -162,6 +168,7 @@ void QScriptDebuggerClient::executeNext()
QDataStream rs(&reply, QIODevice::WriteOnly);
QByteArray cmd = "STEPOVER";
rs << cmd;
d->logSendMessage(cmd);
sendMessage(reply);
}
......@@ -171,6 +178,7 @@ void QScriptDebuggerClient::executeStepI()
QDataStream rs(&reply, QIODevice::WriteOnly);
QByteArray cmd = "STEPINTO";
rs << cmd;
d->logSendMessage(cmd);
sendMessage(reply);
}
......@@ -180,6 +188,7 @@ void QScriptDebuggerClient::continueInferior()
QDataStream rs(&reply, QIODevice::WriteOnly);
QByteArray cmd = "CONTINUE";
rs << cmd;
d->logSendMessage(cmd);
sendMessage(reply);
}
......@@ -189,6 +198,7 @@ void QScriptDebuggerClient::interruptInferior()
QDataStream rs(&reply, QIODevice::WriteOnly);
QByteArray cmd = "INTERRUPT";
rs << cmd;
d->logSendMessage(cmd);
sendMessage(reply);
}
......@@ -213,6 +223,7 @@ void QScriptDebuggerClient::activateFrame(int index)
QByteArray cmd = "ACTIVATE_FRAME";
rs << cmd
<< index;
d->logSendMessage(QString(_("%1 %2")).arg(cmd, QString::number(index)));
sendMessage(reply);
}
......@@ -256,6 +267,15 @@ void QScriptDebuggerClient::synchronizeBreakpoints()
QByteArray cmd = "BREAKPOINTS";
rs << cmd
<< d->breakpoints;
QStringList logBreakpoints;
foreach (const JSAgentBreakpointData &bp, d->breakpoints) {
logBreakpoints << QString("[%1, %2, %3]").arg(bp.functionName,
bp.fileUrl,
QString::number(bp.lineNumber));
}
d->logSendMessage(QString(_("%1 (%2)")).arg(cmd, logBreakpoints.join(", ")));
sendMessage(reply);
}
......@@ -267,6 +287,8 @@ void QScriptDebuggerClient::assignValueInDebugger(const QByteArray expr, const q
QByteArray cmd = "SET_PROPERTY";
rs << cmd;
rs << expr << id << property << value;
d->logSendMessage(QString(_("%1 %2 %3 %4 %5")).arg(cmd, expr, QString::number(id), property,
value));
sendMessage(reply);
}
......@@ -277,6 +299,7 @@ void QScriptDebuggerClient::updateWatchData(const WatchData &data)
QByteArray cmd = "EXEC";
rs << cmd;
rs << data.iname << data.name;
d->logSendMessage(QString(_("%1 %2 %3")).arg(cmd, data.iname, data.name));
sendMessage(reply);
}
......@@ -287,6 +310,7 @@ void QScriptDebuggerClient::executeDebuggerCommand(const QString &command)
QByteArray cmd = "EXEC";
QByteArray console = "console";
rs << cmd << console << command;
d->logSendMessage(QString(_("%1 %2 %3")).arg(cmd, console, command));
sendMessage(reply);
}
......@@ -297,7 +321,7 @@ void QScriptDebuggerClient::synchronizeWatchers(const QStringList &watchers)
QDataStream rs(&reply, QIODevice::WriteOnly);
QByteArray cmd = "WATCH_EXPRESSIONS";
rs << cmd;
rs << watchers;
d->logSendMessage(QString(_("%1 (%2)")).arg(cmd, watchers.join(", ")));
sendMessage(reply);
}
......@@ -308,6 +332,7 @@ void QScriptDebuggerClient::expandObject(const QByteArray &iname, quint64 object
QByteArray cmd = "EXPAND";
rs << cmd;
rs << iname << objectId;
d->logSendMessage(QString(_("%1 %2 %3")).arg(cmd, iname, QString::number(objectId)));
sendMessage(reply);
}
......@@ -319,6 +344,7 @@ void QScriptDebuggerClient::sendPing()
QByteArray cmd = "PING";
rs << cmd;
rs << d->ping;
d->logSendMessage(cmd);
sendMessage(reply);
}
......@@ -398,7 +424,7 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
logString += QLatin1Char(' ');
logString += error;
d->engine->logMessage(QmlEngine::LogReceive, logString);
d->logReceiveMessage(logString);
QString msg = stackFrames.isEmpty()
? tr("<p>An uncaught exception occurred:</p><p>%1</p>")
......@@ -436,7 +462,7 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
}
}
d->engine->logMessage(QmlEngine::LogReceive, logString);
d->logReceiveMessage(logString);
}
if (!ideStackFrames.isEmpty())
......@@ -447,8 +473,8 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
QByteArray iname;
stream >> iname >> data;
d->engine->logMessage(QmlEngine::LogReceive, QString("%1 %2 %3").arg(QString(command),
QString(iname), QString(data.value)));
d->logReceiveMessage(QString("%1 %2 %3").arg(QString(command), QString(iname),
QString(data.value)));
data.iname = iname;
if (iname.startsWith("watch.")) {
d->engine->watchHandler()->insertData(data);
......@@ -461,10 +487,11 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
QList<WatchData> result;
QByteArray iname;
stream >> iname >> result;
d->engine->logMessage(QmlEngine::LogReceive, QString("%1 %2 (%3 x watchdata)").arg(
QString(command), QString(iname), QString::number(result.size())));
d->logReceiveMessage(QString("%1 %2 (%3 x watchdata)").arg( QString(command),
QString(iname),
QString::number(result.size())));
bool needPing = false;
foreach (WatchData data, result) {
data.iname = iname + '.' + data.exp;
d->engine->watchHandler()->insertData(data);
......@@ -485,7 +512,7 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
stream >> watches;
}
d->engine->logMessage(QmlEngine::LogReceive, QString("%1 %2 (%3 x locals) (%4 x watchdata)").arg(
d->logReceiveMessage(QString("%1 %2 (%3 x locals) (%4 x watchdata)").arg(
QString(command), QString::number(frameId),
QString::number(locals.size()),
QString::number(watches.size())));
......@@ -518,13 +545,13 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
int ping;
stream >> ping;
d->engine->logMessage(QmlEngine::LogReceive, QString("%1 %2").arg(QString(command), QString::number(ping)));
d->logReceiveMessage(QString("%1 %2").arg(QString(command), QString::number(ping)));
if (ping == d->ping)
d->engine->watchHandler()->endCycle();
} else {
qDebug() << Q_FUNC_INFO << "Unknown command: " << command;
d->engine->logMessage(QmlEngine::LogReceive, QString("%1 UNKNOWN COMMAND!!").arg(QString(command)));
d->logReceiveMessage(QString("%1 UNKNOWN COMMAND!!").arg(QString(command)));
}
}
......@@ -534,5 +561,17 @@ void QScriptDebuggerClient::setEngine(QmlEngine *engine)
d->engine = engine;
}
void QScriptDebuggerClientPrivate::logSendMessage(const QString &msg) const
{
if (engine)
engine->logMessage("QScriptDebuggerClient", QmlEngine::LogSend, msg);
}
void QScriptDebuggerClientPrivate::logReceiveMessage(const QString &msg) const
{
if (engine)
engine->logMessage("QScriptDebuggerClient", QmlEngine::LogReceive, msg);
}
} // Internal
} // Debugger
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment