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// Qt-Security score:significant
4
5#ifndef QV4DATACOLLECTOR_H
6#define QV4DATACOLLECTOR_H
7
8#include <private/qv4engine_p.h>
9#include <private/qv4persistent_p.h>
10
11#include <QtCore/QJsonObject>
12#include <QtCore/QJsonArray>
13
14#include <QtCore/QJsonObject>
15#include <QtCore/QJsonArray>
16
18
19class QV4Debugger;
21{
22public:
23 typedef uint Ref;
24 typedef QVector<uint> Refs;
25
26 static QV4::Heap::ExecutionContext *findScope(QV4::Heap::ExecutionContext *ctxt, int scope);
27 static int encodeScopeType(QV4::Heap::ExecutionContext::ContextType scopeType);
28
31 QV4::CppStackFrame *findFrame(int frame);
32
33 QV4DataCollector(QV4::ExecutionEngine *engine);
34
35 Ref addValueRef(const QV4::ScopedValue &value);
36
37 bool isValidRef(Ref ref) const;
39
40 bool collectScope(QJsonObject *dict, int frameNr, int scopeNr);
41 QJsonObject buildFrame(const QV4::StackFrame &stackFrame, int frameNr);
42
43 QV4::ExecutionEngine *engine() const { return m_engine; }
44 void clear();
45
46private:
47 Ref addRef(QV4::Value value, bool deduplicate = true);
48 QV4::ReturnedValue getValue(Ref ref);
49
50 QJsonArray collectProperties(const QV4::Object *object);
51 QJsonObject collectAsJson(const QString &name, const QV4::ScopedValue &value);
52
53 QV4::ExecutionEngine *m_engine;
54 QV4::PersistentValue m_values;
55};
56
57QT_END_NAMESPACE
58
59#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()
Combined button and popup list for selecting options.
Definition qjsvalue.h:23
QDataStream & operator>>(QDataStream &, QQmlEngineDebugServiceImpl::QQmlObjectProperty &)
QDataStream & operator>>(QDataStream &, QQmlEngineDebugServiceImpl::QQmlObjectData &)