Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qv4datacollector.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QV4DATACOLLECTOR_H
5#define QV4DATACOLLECTOR_H
6
7#include <private/qv4engine_p.h>
8#include <private/qv4persistent_p.h>
9
10#include <QtCore/QJsonObject>
11#include <QtCore/QJsonArray>
12
13#include <QtCore/QJsonObject>
14#include <QtCore/QJsonArray>
15
17
18class QV4Debugger;
20{
21public:
22 typedef uint Ref;
23 typedef QVector<uint> Refs;
24
25 static QV4::Heap::ExecutionContext *findScope(QV4::Heap::ExecutionContext *ctxt, int scope);
26 static int encodeScopeType(QV4::Heap::ExecutionContext::ContextType scopeType);
27
30 QV4::CppStackFrame *findFrame(int frame);
31
32 QV4DataCollector(QV4::ExecutionEngine *engine);
33
34 Ref addValueRef(const QV4::ScopedValue &value);
35
36 bool isValidRef(Ref ref) const;
38
39 bool collectScope(QJsonObject *dict, int frameNr, int scopeNr);
40 QJsonObject buildFrame(const QV4::StackFrame &stackFrame, int frameNr);
41
42 QV4::ExecutionEngine *engine() const { return m_engine; }
43 void clear();
44
45private:
46 Ref addRef(QV4::Value value, bool deduplicate = true);
47 QV4::ReturnedValue getValue(Ref ref);
48
49 QJsonArray collectProperties(const QV4::Object *object);
50 QJsonObject collectAsJson(const QString &name, const QV4::ScopedValue &value);
51
52 QV4::ExecutionEngine *m_engine;
53 QV4::PersistentValue m_values;
54};
55
56QT_END_NAMESPACE
57
58#endif // QV4DATACOLLECTOR_H
void objectCreated(QJSEngine *, QObject *) override
void engineAboutToBeAdded(QJSEngine *) override
void messageReceived(const QByteArray &) override
void engineAboutToBeRemoved(QJSEngine *) override
QQmlDebugStatesDelegate * statesDelegate()
bool collectScope(QJsonObject *dict, int frameNr, int scopeNr)
bool isValidRef(Ref ref) const
Ref addValueRef(const QV4::ScopedValue &value)
static QV4::Heap::ExecutionContext * findScope(QV4::Heap::ExecutionContext *ctxt, int scope)
static int encodeScopeType(QV4::Heap::ExecutionContext::ContextType scopeType)
QJsonObject lookupRef(Ref ref)
QV4::CppStackFrame * findFrame(int frame)
QVector< uint > Refs
QV4DataCollector(QV4::ExecutionEngine *engine)
QV4::ExecutionEngine * engine() const
QVector< QV4::Heap::ExecutionContext::ContextType > getScopeTypes(int frame)
QV4::Heap::ExecutionContext * findContext(int frame)
QJsonObject buildFrame(const QV4::StackFrame &stackFrame, int frameNr)
void send(QJsonObject v4Payload)
void engineAboutToBeRemoved(QJSEngine *engine) override
QV4DebuggerAgent debuggerAgent
void messageReceived(const QByteArray &) override
void stateAboutToBeChanged(State state) override
void signalEmitted(const QString &signal) override
void sendSomethingToSomebody(const char *type, int magicNumber=1)
void engineAdded(QJSEngine *engine) override
void selectFrame(int frameNr)
void setBreakOnThrow(bool onoff)
const QList< QV4Debugger * > & debuggers()
QList< int > breakPointIds(const QString &fileName, int lineNumber) const
void handleDebuggerDeleted(QObject *debugger)
bool breakOnThrow() const
int addBreakPoint(const QString &fileName, int lineNumber, bool enabled=true, const QString &condition=QString())
void addDebugger(QV4Debugger *debugger)
void removeDebugger(QV4Debugger *debugger)
void pause(QV4Debugger *debugger) const
void removeBreakPoint(int id)
void enableBreakPoint(int id, bool onoff)
void debuggerPaused(QV4Debugger *debugger, QV4Debugger::PauseReason reason)
void maybeBreakAtInstruction() override
QV4::Function * getFunction() const
void enteringFunction() override
void scheduleJob()
void runInEngine(QV4DebugJob *job)
QV4DataCollector * collector()
void removeBreakPoint(const QString &fileName, int lineNumber)
QV4::ExecutionEngine * engine() const
void resume(Speed speed)
QVector< QV4::StackFrame > stackTrace(int frameLimit=-1) const
void setBreakOnThrow(bool onoff)
bool pauseAtNextOpportunity() const override
void leavingFunction(const QV4::ReturnedValue &retVal) override
State state() const
QVector< QV4::Heap::ExecutionContext::ContextType > getScopeTypes(int frame=0) const
ExecutionState currentExecutionState() const
const QV4DataCollector * collector() const
QV4Debugger(QV4::ExecutionEngine *engine)
void aboutToThrow() override
void addBreakPoint(const QString &fileName, int lineNumber, const QString &condition=QString())
void clearPauseRequest()
Definition qjsvalue.h:23
QDataStream & operator>>(QDataStream &, QQmlEngineDebugServiceImpl::QQmlObjectProperty &)
QDataStream & operator>>(QDataStream &, QQmlEngineDebugServiceImpl::QQmlObjectData &)