9#include <private/qqmlengine_p.h>
10#include <private/qv4compileddata_p.h>
19#if __cplusplus
>= 202002L
20# define Q_ATOMIC_FLAG_INIT {}
22# define Q_ATOMIC_FLAG_INIT ATOMIC_FLAG_INIT
27
28
29
30
31
32
33
34
35
36
37
38
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58void QQmlDebuggingEnabler::enableDebugging(
bool printWarning)
60 if (printWarning && !s_printedWarning.test_and_set(std::memory_order_relaxed)) {
61 fprintf(stderr,
"QML debugging is enabled. Only use this in a safe environment.\n");
64 QQmlEnginePrivate::qml_debugging_enabled.store(
true, std::memory_order_relaxed);
67#if QT_DEPRECATED_SINCE(6
, 4
)
69
70
71QQmlDebuggingEnabler::QQmlDebuggingEnabler(
bool printWarning)
73 enableDebugging(printWarning);
78
79
80
81
82
83QStringList QQmlDebuggingEnabler::debuggerServices()
85 return {QV4DebugService::s_key, QQmlEngineDebugService::s_key, QDebugMessageService::s_key};
89
90
91
92
93QStringList QQmlDebuggingEnabler::inspectorServices()
95 return {QQmlInspectorService::s_key};
99
100
101
102
103
104QStringList QQmlDebuggingEnabler::profilerServices()
106 return {QQmlProfilerService::s_key, QQmlEngineControlService::s_key, QDebugMessageService::s_key};
110
111
112
113
114
115QStringList QQmlDebuggingEnabler::nativeDebuggerServices()
117 return {QQmlNativeDebugService::s_key};
121
122
123
124
125
126
127
128
129
130
131
132void QQmlDebuggingEnabler::setServices(
const QStringList &services)
134 QQmlDebugConnector::setServices(services);
138
139
140
141
142
143
144
145
146
149
150
151
152
153
154
155
156
157bool QQmlDebuggingEnabler::startTcpDebugServer(
int port, StartMode mode,
const QString &hostName)
159 QVariantHash configuration;
160 configuration[QLatin1String(
"portFrom")] = configuration[QLatin1String(
"portTo")] = port;
161 configuration[QLatin1String(
"block")] = (mode == WaitForClient);
162 configuration[QLatin1String(
"hostAddress")] = hostName;
163 return startDebugConnector(QLatin1String(
"QQmlDebugServer"), configuration);
167
168
169
170
171
172
173
174
175
176bool QQmlDebuggingEnabler::connectToLocalDebugger(
const QString &socketFileName, StartMode mode)
178 QVariantHash configuration;
179 configuration[QLatin1String(
"fileName")] = socketFileName;
180 configuration[QLatin1String(
"block")] = (mode == WaitForClient);
181 return startDebugConnector(QLatin1String(
"QQmlDebugServer"), configuration);
185
186
187
188
189
190
191
192
193
194bool QQmlDebuggingEnabler::startDebugConnector(
const QString &pluginName,
195 const QVariantHash &configuration)
197 QQmlDebugConnector::setPluginKey(pluginName);
198 QQmlDebugConnector *connector = QQmlDebugConnector::instance();
199 return connector ? connector->open(configuration) :
false;
218 QV4_DATA_STRUCTURE_VERSION
221Q_STATIC_ASSERT(HookCount ==
sizeof(qtDeclarativeHookData) /
sizeof(qtDeclarativeHookData[0]));
#define Q_ATOMIC_FLAG_INIT
static Q_CONSTINIT std::atomic_flag s_printedWarning
QT_REQUIRE_CONFIG(qml_debug)
QDebug Q_QML_EXPORT operator<<(QDebug debug, const QQmlError &error)
Q_STATIC_ASSERT(sizeof(SharedImageHeader) % 4==0)