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