From afa9b8087addeceb8af34ea2025a11cc1f63c251 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Mon, 25 Jan 2021 04:02:41 +0100 Subject: QmlDebug: make qt_qmlDebugClearBuffer() accessible - also fix that qt_qmlDebugMessageBuffer is always valid Change-Id: I3661e424ecaeb7d8c8bd3b1acb137ae34a3f06e4 Reviewed-by: Ulf Hermann --- src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp b/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp index 09baa73f7d..bbb4ea0d88 100644 --- a/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp +++ b/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp @@ -91,6 +91,8 @@ Q_DECL_EXPORT void qt_qmlDebugObjectAvailable() Q_DECL_EXPORT void qt_qmlDebugClearBuffer() { responseBuffer->clear(); + qt_qmlDebugMessageBuffer = nullptr; + qt_qmlDebugMessageLength = 0; } // Send a message to a service. @@ -157,7 +159,8 @@ quintptr qt_qmlDebugTestHooks[] = { quintptr(&qt_qmlDebugSendDataToService), quintptr(&qt_qmlDebugEnableService), quintptr(&qt_qmlDebugDisableService), - quintptr(&qt_qmlDebugObjectAvailable) + quintptr(&qt_qmlDebugObjectAvailable), + quintptr(&qt_qmlDebugClearBuffer) }; // In blocking mode, this will busy wait until the debugger sets block to false. @@ -279,6 +282,8 @@ void QQmlNativeDebugConnector::announceObjectAvailability(const QString &objectT qt_qmlDebugMessageLength = ba.size(); TRACE_PROTOCOL("Reporting engine availabilty"); qt_qmlDebugObjectAvailable(); // Trigger native breakpoint. + qt_qmlDebugMessageBuffer = nullptr; + qt_qmlDebugMessageLength = 0; } bool QQmlNativeDebugConnector::addService(const QString &name, QQmlDebugService *service) -- cgit v1.2.3