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
qv4debuginstructions_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 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 QV4DEBUGINSTRUCTIONS_P_H
6#define QV4DEBUGINSTRUCTIONS_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <private/qv4bytecodegenerator_p.h>
20
21QT_BEGIN_NAMESPACE
22
23namespace QV4 {
24namespace Moth {
25
26// Inserts Debug instructions into the generated code, so that the debugger can check for
27// breakpoints when it executes them.
29{
30public:
31 static void insert(BytecodeGenerator *generator);
32
33private:
34 using I = BytecodeGenerator::I;
35
36 DebugInstructions(BytecodeGenerator *generator) : m_generator(generator) {}
37 void run();
38 void appendDebug(int line, const I &before);
39 void appendJumpOverDebug(const I &before);
40
41 template <typename Data>
42 static I makeInstruction(const Data &data, int line, int statement)
43 {
44 return BytecodeGenerator::makeInstruction(Data::type, Instr::Factory<Data>::create(data),
45 -1, line, statement);
46 }
47
48 template <typename Data>
49 static I makeJumpInstruction(const Data &data, int line, int statement)
50 {
51 return BytecodeGenerator::makeInstruction(Data::type, Instr::Factory<Data>::create(data),
52 offsetof(Data, offset), line, statement);
53 }
54
55 BytecodeGenerator *m_generator;
56};
57
58} // namespace Moth
59} // namespace QV4
60
61QT_END_NAMESPACE
62
63#endif // QV4DEBUGINSTRUCTIONS_P_H
static void insert(BytecodeGenerator *generator)
Combined button and popup list for selecting options.
static bool isFromOtherLine(int jumpLine, int line)
static int mergeJumpLines(int a, int b)
Definition qjsvalue.h:24