forked from qt-creator/qt-creator
QmlV8DebuggerClient: Changes related to v8DebugService protocol
V8DebugService uses a different protocol. This fix now uses the new protocol. It also optimizes the number of debug requests made to retrieve debug information. Change-Id: I40d7b1d4ab0535831c6a19cadd9b48763934c1de Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -158,7 +158,6 @@ void QmlAdapter::clientStatusChanged(QDeclarativeDebugClient::Status status)
|
||||
|
||||
if (status == QDeclarativeDebugClient::Enabled) {
|
||||
d->m_qmlClient = d->debugClients.value(serviceName);
|
||||
d->m_qmlClient->flushSendBuffer();
|
||||
d->m_qmlClient->startSession();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,5 +82,17 @@ void QmlDebuggerClient::flushSendBuffer()
|
||||
d->sendBuffer.clear();
|
||||
}
|
||||
|
||||
//TODO:: remove this method
|
||||
QList<QByteArray> QmlDebuggerClient::cachedMessages()
|
||||
{
|
||||
return d->sendBuffer;
|
||||
}
|
||||
|
||||
//TODO:: remove this method
|
||||
void QmlDebuggerClient::clearCachedMessages()
|
||||
{
|
||||
d->sendBuffer.clear();
|
||||
}
|
||||
|
||||
} // Internal
|
||||
} // Debugger
|
||||
|
||||
@@ -92,6 +92,9 @@ protected:
|
||||
virtual void statusChanged(Status status);
|
||||
void sendMessage(const QByteArray &msg);
|
||||
|
||||
QList<QByteArray> cachedMessages();
|
||||
void clearCachedMessages();
|
||||
|
||||
private:
|
||||
QmlDebuggerClientPrivate *d;
|
||||
friend class QmlDebuggerClientPrivate;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -61,13 +61,6 @@ class QmlV8DebuggerClient : public QmlDebuggerClient
|
||||
Next
|
||||
};
|
||||
|
||||
enum V8DebugServiceStates
|
||||
{
|
||||
RunningState,
|
||||
WaitingForRequestState,
|
||||
ProcessingRequestState
|
||||
};
|
||||
|
||||
public:
|
||||
explicit QmlV8DebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection *client);
|
||||
~QmlV8DebuggerClient();
|
||||
@@ -94,7 +87,7 @@ public:
|
||||
void assignValueInDebugger(const QByteArray expr, const quint64 &id,
|
||||
const QString &property, const QString &value);
|
||||
|
||||
void updateWatchData(const WatchData &data);
|
||||
void updateWatchData(const WatchData &);
|
||||
void executeDebuggerCommand(const QString &command);
|
||||
|
||||
void synchronizeWatchers(const QStringList &watchers);
|
||||
@@ -105,13 +98,12 @@ public:
|
||||
|
||||
protected:
|
||||
void messageReceived(const QByteArray &data);
|
||||
void sendMessage(const QByteArray &msg);
|
||||
|
||||
private:
|
||||
void updateStack(const QVariant &bodyVal, const QVariant &refsVal);
|
||||
StackFrame createStackFrame(const QVariant &bodyVal, const QVariant &refsVal);
|
||||
void updateLocals(const QVariant &localsVal, const QVariant &refsVal);
|
||||
void updateScope(const QVariant &localsVal, const QVariant &refsVal);
|
||||
StackFrame insertStackFrame(const QVariant &bodyVal, const QVariant &refsVal);
|
||||
void setCurrentFrameDetails(const QVariant &bodyVal, const QVariant &refsVal);
|
||||
void updateScope(const QVariant &bodyVal, const QVariant &refsVal);
|
||||
|
||||
void updateEvaluationResult(int sequence, bool success, const QVariant &bodyVal,
|
||||
const QVariant &refsVal);
|
||||
@@ -125,10 +117,6 @@ private:
|
||||
const QString &errorMessage);
|
||||
void clearExceptionSelection();
|
||||
|
||||
void resetDebugger();
|
||||
|
||||
void updateLocalsAndWatchers();
|
||||
|
||||
private:
|
||||
QmlV8DebuggerClientPrivate *d;
|
||||
friend class QmlV8DebuggerClientPrivate;
|
||||
|
||||
@@ -36,6 +36,12 @@
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
const float CURRENT_SUPPORTED_VERSION = 2.0;
|
||||
const char V8REQUEST[] = "v8request";
|
||||
const char V8MESSAGE[] = "v8message";
|
||||
const char SIGNALHANDLER[] = "signalhandler";
|
||||
const char CONNECT[] = "connect";
|
||||
const char INTERRUPT[] = "interrupt";
|
||||
const char V8DEBUG[] = "V8DEBUG";
|
||||
const char SEQ[] = "seq";
|
||||
const char TYPE[] = "type";
|
||||
@@ -88,9 +94,6 @@ const char LISTBREAKPOINTS[] = "listbreakpoints";
|
||||
const char GARBAGECOLLECTOR[] = "gc";
|
||||
//const char PROFILE[] = "profile";
|
||||
|
||||
const char CONNECT[] = "connect";
|
||||
const char INTERRUPT[] = "interrupt";
|
||||
|
||||
const char REQUEST[] = "request";
|
||||
const char IN[] = "in";
|
||||
const char NEXT[] = "next";
|
||||
@@ -98,6 +101,7 @@ const char OUT[] = "out";
|
||||
|
||||
const char FUNCTION[] = "function";
|
||||
const char SCRIPT[] = "script";
|
||||
const char SCRIPTREGEXP[] = "scriptRegExp";
|
||||
const char EVENT[] = "event";
|
||||
|
||||
const char ALL[] = "all";
|
||||
|
||||
@@ -204,6 +204,9 @@ void QScriptDebuggerClient::interruptInferior()
|
||||
|
||||
void QScriptDebuggerClient::startSession()
|
||||
{
|
||||
//Flush buffered data
|
||||
flushSendBuffer();
|
||||
|
||||
//Set all breakpoints
|
||||
BreakHandler *handler = d->engine->breakHandler();
|
||||
foreach (BreakpointModelId id, handler->engineBreakpointIds(d->engine)) {
|
||||
|
||||
Reference in New Issue
Block a user