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
qv4debugjob.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 QV4DEBUGJOB_H
5#define QV4DEBUGJOB_H
6
8#include <private/qv4engine_p.h>
9
10#include <QtCore/qjsonarray.h>
11#include <QtCore/qjsonobject.h>
12
13QT_BEGIN_NAMESPACE
14
15class QV4DataCollector;
17{
18public:
19 virtual ~QV4DebugJob();
20 virtual void run() = 0;
21};
22
24{
25 QV4::ExecutionEngine *engine;
26 int frameNr;
27 int context;
28 const QString &script;
29 bool resultIsException;
30
31public:
32 JavaScriptJob(QV4::ExecutionEngine *engine, int frameNr, int context, const QString &script);
33 void run() override;
34 bool hasExeption() const;
35
36protected:
37 virtual void handleResult(QV4::ScopedValue &result) = 0;
38};
39
40class CollectJob : public QV4DebugJob
41{
42protected:
45
46public:
47 CollectJob(QV4DataCollector *collector) : collector(collector) {}
48 const QJsonObject &returnValue() const { return result; }
49};
50
52{
53 int fromFrame;
54 int toFrame;
55public:
56 BacktraceJob(QV4DataCollector *collector, int fromFrame, int toFrame);
57 void run() override;
58};
59
60class FrameJob: public CollectJob
61{
62 int frameNr;
63 bool success;
64
65public:
66 FrameJob(QV4DataCollector *collector, int frameNr);
67 void run() override;
68 bool wasSuccessful() const;
69};
70
71class ScopeJob: public CollectJob
72{
73 int frameNr;
74 int scopeNr;
75 bool success;
76
77public:
78 ScopeJob(QV4DataCollector *collector, int frameNr, int scopeNr);
79 void run() override;
80 bool wasSuccessful() const;
81};
82
84{
85 const QJsonArray handles;
86 QString exception;
87
88public:
89 ValueLookupJob(const QJsonArray &handles, QV4DataCollector *collector);
90 void run() override;
91 const QString &exceptionMessage() const;
92};
93
95{
96 QV4DataCollector *collector;
97 QString exception;
98 QJsonObject result;
99
100public:
101 ExpressionEvalJob(QV4::ExecutionEngine *engine, int frameNr, int context,
102 const QString &expression, QV4DataCollector *collector);
103 void handleResult(QV4::ScopedValue &value) override;
104 const QString &exceptionMessage() const;
105 const QJsonObject &returnValue() const;
106};
107
109{
110 QV4::ExecutionEngine *engine;
111 QStringList sources;
112
113public:
114 GatherSourcesJob(QV4::ExecutionEngine *engine);
115 void run() override;
116 const QStringList &result() const;
117};
118
120{
121 bool result;
122
123public:
124 EvalJob(QV4::ExecutionEngine *engine, const QString &script);
125
126 void handleResult(QV4::ScopedValue &result) override;
127 bool resultAsBoolean() const;
128};
129
130QT_END_NAMESPACE
131
132#endif // QV4DEBUGJOB_H
BacktraceJob(QV4DataCollector *collector, int fromFrame, int toFrame)
void run() override
CapturePreventer(QV4::ExecutionEngine *engine)
QV4DataCollector * collector
Definition qv4debugjob.h:43
const QJsonObject & returnValue() const
Definition qv4debugjob.h:48
CollectJob(QV4DataCollector *collector)
Definition qv4debugjob.h:47
QJsonObject result
Definition qv4debugjob.h:44
EvalJob(QV4::ExecutionEngine *engine, const QString &script)
bool resultAsBoolean() const
void handleResult(QV4::ScopedValue &result) override
const QJsonObject & returnValue() const
ExpressionEvalJob(QV4::ExecutionEngine *engine, int frameNr, int context, const QString &expression, QV4DataCollector *collector)
void handleResult(QV4::ScopedValue &value) override
const QString & exceptionMessage() const
void run() override
bool wasSuccessful() const
FrameJob(QV4DataCollector *collector, int frameNr)
const QStringList & result() const
void run() override
GatherSourcesJob(QV4::ExecutionEngine *engine)
bool hasExeption() const
virtual void handleResult(QV4::ScopedValue &result)=0
JavaScriptJob(QV4::ExecutionEngine *engine, int frameNr, int context, const QString &script)
void run() override
bool collectScope(QJsonObject *dict, int frameNr, int scopeNr)
bool isValidRef(Ref ref) const
Ref addValueRef(const QV4::ScopedValue &value)
QJsonObject lookupRef(Ref ref)
QVector< uint > Refs
QV4DataCollector(QV4::ExecutionEngine *engine)
QVector< QV4::Heap::ExecutionContext::ContextType > getScopeTypes(int frame)
QV4::Heap::ExecutionContext * findContext(int frame)
QJsonObject buildFrame(const QV4::StackFrame &stackFrame, int frameNr)
virtual void run()=0
virtual ~QV4DebugJob()
bool wasSuccessful() const
ScopeJob(QV4DataCollector *collector, int frameNr, int scopeNr)
void run() override
const QString & exceptionMessage() const
ValueLookupJob(const QJsonArray &handles, QV4DataCollector *collector)
void run() override
QJsonObject toRef(QV4DataCollector::Ref ref)
const QV4::Object * collectProperty(const QV4::ScopedValue &value, QV4::ExecutionEngine *engine, QJsonObject &dict)