From 9ceeaaac7984523fdc08c2040fcadf5698254c2d Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Fri, 14 Mar 2014 09:00:26 +0200 Subject: WinRT: Add debug message handler for winrtrunner By placing debug messages in shared memory, the application can share debug messages with winrtrunner (or any utility which passes -qdevel to the app and opens the corresponding shared memory area). Task-number: QTBUG-37308 Change-Id: Id0e04cfd5f0f701d552a448f780788c7cbf9b438 Reviewed-by: Oliver Wolff --- src/winmain/qtmain_winrt.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src') diff --git a/src/winmain/qtmain_winrt.cpp b/src/winmain/qtmain_winrt.cpp index 151294d2c4..22d3f5bd91 100644 --- a/src/winmain/qtmain_winrt.cpp +++ b/src/winmain/qtmain_winrt.cpp @@ -81,6 +81,27 @@ typedef ITypedEventHandler(data) + 1, 4096 - sizeof(quint32), + message.data(), (message.length() + 1) * sizeof(wchar_t)); + UnmapViewOfFile(data); + SetEvent(event); +#endif // !Q_OS_WINPHONE + defaultMessageHandler(type, context, message); +} + class AppContainer : public Microsoft::WRL::RuntimeClass { public: @@ -127,6 +148,10 @@ public: // (Unused) handle will automatically be closed when the app exits CreateFile2(reinterpret_cast(pidFileName.utf16()), 0, FILE_SHARE_READ|FILE_SHARE_DELETE, CREATE_ALWAYS, ¶ms); + // Install the develMode message handler +#ifndef Q_OS_WINPHONE + defaultMessageHandler = qInstallMessageHandler(devMessageHandler); +#endif } // Wait for debugger before continuing if (debugWait) { -- cgit v1.2.3