Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | class QV4DataCollector; | - | ||||||
6 | class QV4DebugJob | - | ||||||
7 | { | - | ||||||
8 | public: | - | ||||||
9 | virtual ~QV4DebugJob(); | - | ||||||
10 | virtual void run() = 0; | - | ||||||
11 | }; | - | ||||||
12 | - | |||||||
13 | class JavaScriptJob : public QV4DebugJob | - | ||||||
14 | { | - | ||||||
15 | QV4::ExecutionEngine *engine; | - | ||||||
16 | int frameNr; | - | ||||||
17 | int context; | - | ||||||
18 | const QString &script; | - | ||||||
19 | bool resultIsException; | - | ||||||
20 | - | |||||||
21 | public: | - | ||||||
22 | JavaScriptJob(QV4::ExecutionEngine *engine, int frameNr, int context, const QString &script); | - | ||||||
23 | void run() override; | - | ||||||
24 | bool hasExeption() const; | - | ||||||
25 | - | |||||||
26 | protected: | - | ||||||
27 | virtual void handleResult(QV4::ScopedValue &result) = 0; | - | ||||||
28 | }; | - | ||||||
29 | - | |||||||
30 | class CollectJob : public QV4DebugJob | - | ||||||
31 | { | - | ||||||
32 | protected: | - | ||||||
33 | QV4DataCollector *collector; | - | ||||||
34 | QJsonObject result; | - | ||||||
35 | QJsonArray collectedRefs; | - | ||||||
36 | - | |||||||
37 | void flushRedundantRefs() | - | ||||||
38 | { | - | ||||||
39 | if (collector->redundantRefs()
| 74-98 | ||||||
40 | collectedRefs = collector->flushCollectedRefs(); executed 98 times by 1 test: collectedRefs = collector->flushCollectedRefs(); Executed by:
| 98 | ||||||
41 | } executed 172 times by 1 test: end of block Executed by:
| 172 | ||||||
42 | - | |||||||
43 | public: | - | ||||||
44 | CollectJob(QV4DataCollector *collector) : collector(collector) {} executed 174 times by 1 test: end of block Executed by:
| 174 | ||||||
45 | const QJsonObject &returnValue() const { return executed 172 times by 1 test: result;return result; Executed by:
executed 172 times by 1 test: }return result; Executed by:
| 172 | ||||||
46 | - | |||||||
47 | - | |||||||
48 | const QJsonArray &refs() const | - | ||||||
49 | { | - | ||||||
50 | ((collector->redundantRefs()) ? static_cast<void>(0) : qt_assert("collector->redundantRefs()", __FILE__, 96)); | - | ||||||
51 | return never executed: collectedRefs;return collectedRefs; never executed: return collectedRefs; | 0 | ||||||
52 | } | - | ||||||
53 | }; | - | ||||||
54 | - | |||||||
55 | class BacktraceJob: public CollectJob | - | ||||||
56 | { | - | ||||||
57 | int fromFrame; | - | ||||||
58 | int toFrame; | - | ||||||
59 | public: | - | ||||||
60 | BacktraceJob(QV4DataCollector *collector, int fromFrame, int toFrame); | - | ||||||
61 | void run() override; | - | ||||||
62 | }; | - | ||||||
63 | - | |||||||
64 | class FrameJob: public CollectJob | - | ||||||
65 | { | - | ||||||
66 | int frameNr; | - | ||||||
67 | bool success; | - | ||||||
68 | - | |||||||
69 | public: | - | ||||||
70 | FrameJob(QV4DataCollector *collector, int frameNr); | - | ||||||
71 | void run() override; | - | ||||||
72 | bool wasSuccessful() const; | - | ||||||
73 | }; | - | ||||||
74 | - | |||||||
75 | class ScopeJob: public CollectJob | - | ||||||
76 | { | - | ||||||
77 | int frameNr; | - | ||||||
78 | int scopeNr; | - | ||||||
79 | bool success; | - | ||||||
80 | - | |||||||
81 | public: | - | ||||||
82 | ScopeJob(QV4DataCollector *collector, int frameNr, int scopeNr); | - | ||||||
83 | void run() override; | - | ||||||
84 | bool wasSuccessful() const; | - | ||||||
85 | }; | - | ||||||
86 | - | |||||||
87 | class ValueLookupJob: public CollectJob | - | ||||||
88 | { | - | ||||||
89 | const QJsonArray handles; | - | ||||||
90 | QString exception; | - | ||||||
91 | - | |||||||
92 | public: | - | ||||||
93 | ValueLookupJob(const QJsonArray &handles, QV4DataCollector *collector); | - | ||||||
94 | void run() override; | - | ||||||
95 | const QString &exceptionMessage() const; | - | ||||||
96 | }; | - | ||||||
97 | - | |||||||
98 | class ExpressionEvalJob: public JavaScriptJob | - | ||||||
99 | { | - | ||||||
100 | QV4DataCollector *collector; | - | ||||||
101 | QString exception; | - | ||||||
102 | QJsonObject result; | - | ||||||
103 | QJsonArray collectedRefs; | - | ||||||
104 | - | |||||||
105 | public: | - | ||||||
106 | ExpressionEvalJob(QV4::ExecutionEngine *engine, int frameNr, int context, | - | ||||||
107 | const QString &expression, QV4DataCollector *collector); | - | ||||||
108 | void handleResult(QV4::ScopedValue &value) override; | - | ||||||
109 | const QString &exceptionMessage() const; | - | ||||||
110 | const QJsonObject &returnValue() const; | - | ||||||
111 | const QJsonArray &refs() const; | - | ||||||
112 | }; | - | ||||||
113 | - | |||||||
114 | class GatherSourcesJob: public QV4DebugJob | - | ||||||
115 | { | - | ||||||
116 | QV4::ExecutionEngine *engine; | - | ||||||
117 | QStringList sources; | - | ||||||
118 | - | |||||||
119 | public: | - | ||||||
120 | GatherSourcesJob(QV4::ExecutionEngine *engine); | - | ||||||
121 | void run() override; | - | ||||||
122 | const QStringList &result() const; | - | ||||||
123 | }; | - | ||||||
124 | - | |||||||
125 | class EvalJob: public JavaScriptJob | - | ||||||
126 | { | - | ||||||
127 | bool result; | - | ||||||
128 | - | |||||||
129 | public: | - | ||||||
130 | EvalJob(QV4::ExecutionEngine *engine, const QString &script); | - | ||||||
131 | - | |||||||
132 | void handleResult(QV4::ScopedValue &result) override; | - | ||||||
133 | bool resultAsBoolean() const; | - | ||||||
134 | }; | - | ||||||
135 | - | |||||||
136 | - | |||||||
Switch to Source code | Preprocessed file |