42 #include "private/qjsdebugservice_p.h" 43 #include "private/qjsdebuggeragent_p.h" 45 #include <QtCore/qdatastream.h> 46 #include <QtCore/qdebug.h> 47 #include <QtCore/qstringlist.h> 48 #include <QtDeclarative/qdeclarativeengine.h> 58 ds << prefix << time << messageType << scriptId << program <<
fileName << baseLineNumber
59 << lineNumber << columnNumber << returnValue;
65 , m_agent(0), m_deferredSend(true)
77 return serviceInstance();
125 qWarning() <<
"QJSDebugService::messageReceived: No QJSDebuggerAgent available";
132 if (command ==
"BREAKPOINTS") {
140 }
else if (command ==
"WATCH_EXPRESSIONS") {
144 }
else if (command ==
"STEPOVER") {
146 }
else if (command ==
"STEPINTO" || command ==
"INTERRUPT") {
148 }
else if (command ==
"STEPOUT") {
150 }
else if (command ==
"CONTINUE") {
152 }
else if (command ==
"EXEC") {
163 }
else if (command ==
"EXPAND") {
166 ds >> requestId >> objectId;
172 rs <<
QByteArray(
"EXPANDED") << requestId << result;
174 }
else if (command ==
"ACTIVATE_FRAME") {
182 rs <<
QByteArray(
"LOCALS") << frameId << locals;
184 }
else if (command ==
"SET_PROPERTY") {
189 ds >>
id >> objectId >>
property >> value;
194 }
else if (command ==
"PING") {
201 }
else if (command ==
"COVERAGE") {
224 rs <<
QByteArray(
"STOPPED") << backtrace << watches << locals
225 << becauseOfException << exception;
virtual void messageReceived(const QByteArray &)
QList< QDeclarativeEngine * > m_engines
JSAgentWatchData executeExpression(const QString &expr)
void addEngine(QDeclarativeEngine *)
QList< JSAgentCoverageData > m_data
void setProperty(qint64 objectId, const QString &property, const QString &value)
The QByteArray class provides an array of bytes.
QPointer< QJSDebuggerAgent > m_agent
QList< JSAgentWatchData > watches()
void removeEngine(QDeclarativeEngine *)
int count(const T &t) const
Returns the number of occurrences of value in the list.
void messageReceived(const QByteArray &)
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
void processMessage(const JSAgentCoverageData &message)
Q_CORE_EXPORT void qDebug(const char *,...)
void append(const T &t)
Inserts value at the end of the list.
QList< JSAgentWatchData > locals()
JSAgentBreakpoints breakpoints
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
Q_CORE_EXPORT void qWarning(const char *,...)
QList< JSAgentWatchData > localsAtFrame(int frameId)
static const char * data(const QByteArray &arr)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
void setBreakpoints(const JSAgentBreakpoints &)
void setCoverageEnabled(bool enabled)
void clear()
Removes all items from the list.
void setWatchExpressions(const QStringList &)
QList< JSAgentStackData > backtrace()
T & first()
Returns a reference to the first item in the list.
QByteArray toByteArray() const
QJSDebugService(QObject *parent=0)
The QDeclarativeEngine class provides an environment for instantiating QML components.
QList< JSAgentWatchData > expandObjectById(quint64 objectId)
QStringList watchExpressions
void executionStopped(bool becauseOfException, const QString &exception)
QVariant property(const char *name) const
Returns the value of the object's name property.
The QDataStream class provides serialization of binary data to a QIODevice.
void statusChanged(Status status)
static QJSDebugService * instance()
bool isInitialized() const
Indicates whether the agent got the list of breakpoints.
static QString fileName(const QString &fileUrl)
void start()
Starts this timer.
void sendMessage(const QByteArray &)
The QList class is a template class that provides lists.
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.