aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmltooling/qmldbg_server
Commit message (Collapse)AuthorAgeFilesLines
* Tooling: Guard use of QRegularExpressionUlf Hermann2019-05-231-4/+5
| | | | | | | | | | | | The Qt we are using might be compiled without regular expressions. The epxression in qqmldebugserver.cpp is actually not needed as QString::toInt() can do this check for us. The ones in globalinspector.cpp are only for reformatting the name in a nicer way for the selection highlight. We can skip those in case there are no regular expressions. Change-Id: I71e3f0314d8a68a41c3da2568207e311c6b41d1b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Tooling: Use QRegularExpression rather than QRegExpUlf Hermann2019-05-221-4/+1
| | | | | | | Task-number: QTBUG-72588 Change-Id: Ib79107ea01de2dee49dc783f1d88807d1852c3ba Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-04-261-1/+2
|\ | | | | | | | | | | | | | | Conflicts: src/imports/imports.pro src/src.pro Change-Id: Icdc39b6169d15b2102acd0e4d550a8d91e4b0744
| * Make QPacketProtocol independent of QmlUlf Hermann2018-04-231-1/+2
| | | | | | | | | | | | | | | | | | | | Just because we need a data stream version for QQmlDebugPacket, we don't need to add such a huge dependency. Using a template here adds some boiler plate to all users of QQmlDebugPacket, but this is worth it. Task-number: QTBUG-60996 Change-Id: Ibade8757e28ac772942129c22c8721b504da3aee Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QPacketProtocol: Add proper error handlingUlf Hermann2018-04-051-6/+6
| | | | | | | | | | | | | | | | The device is not guaranteed to write or read all the data we ask for in one go. Retry and check for read or write errors. Change-Id: I640bdaf4d9eb7b900c8f7145bd42eb5d667a9cad Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QmlDebug: Drop support for non-multipacket clientsUlf Hermann2018-03-211-23/+17
|/ | | | | | | All known clients support multipackets by now. Change-Id: I74f017f5e11b01ee967fcfb5cecfefa54aad8ef7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-6/+6
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Dissolve src/plugins/qmltooling/sharedUlf Hermann2017-11-052-11/+4
| | | | | | | | | QQmlDebugPacket is moved to PacketProtocol, and the other headers to src/qml/debugger. This makes it easier to develop debug plugins in external repositories. Change-Id: I1ab099a304dad793ec13aaef414071cab6d7d408 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-251-9/+9
| | | | | Change-Id: I176f91a8c51e81a2df3fe91733118261491223ee Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLars Knoll2017-05-021-0/+1
|\ | | | | | | Change-Id: I71275a2076c3d32ee2896571be882067320a2e9e
| * Run includemocs in qtdeclarativeThiago Macieira2017-04-261-0/+1
| | | | | | | | | | Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | sources: Add missing override and remove redundant virtualAlexander Volkov2017-02-231-1/+1
|/ | | | | | | Change-Id: I48e26b1491024d41ebf75d40f0d1a7e9a1b20f22 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* headers: Add missing override and remove redundant virtualAlexander Volkov2016-12-071-1/+1
| | | | | | Change-Id: Ifa816ebcd79372afca42dbd0dc0ecde006bb688a Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QmlDebug: Allow specifying debug connectors on the command lineUlf Hermann2016-11-241-2/+2
| | | | | | | | | | With this change arbitrary debug connector plugins can be loaded by specifying them in the "-qmljsdebugger=..." argument. It was already possible to load them by using startDebugConnector(...), but that requires source code modification. Change-Id: I06ec7f54ec65add7cff2846ed4083ea878a04765 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Plugins: replace 'foreach' with 'range for'Anton Kudryavtsev2016-08-261-6/+6
| | | | | | | | | | Mark some local variables as const to prevent detach()'ing. Use qAsConst where is not possible mark as const. If a container is changed in a loop's body, just make copy like 'foreach'. Change-Id: Ic453a688a9edf8a864d47f6e3a605164508a027c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Tooling: Convert connects to Qt5 styleUlf Hermann2016-07-281-36/+40
| | | | | Change-Id: I6746b777f73d047f5cf610bfca9b320ac1e13676 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-191-2/+0
|\ | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4engine_p.h Change-Id: I89ffccd699bee675732758d039e22224b275d60d
| * QmlDebug: Drop explicit Q_IMPORT_PLUGIN statementsUlf Hermann2016-05-091-2/+0
| | | | | | | | | | | | | | | | | | | | qmake is clever enough to include the plugins without this. Furthermore, the explicit imports duplicate the plugins in static builds and they lead to cross linking from QtQml to QtQuick. Task-number: QTBUG-50306 Change-Id: I822e000481f583f513b863f54f65eb8ff772c0c3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Use QStringRef to optimize memory allocationAnton Kudryavtsev2016-04-261-20/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. While touching the code, also port loops to C++11 style. Change-Id: I04c99b24ea6afd3715e3edf9ea00bfab838fd53c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | QmlDebug: Adapt to renaming of Qt Creators "QML/JS" consoleUlf Hermann2016-04-221-1/+1
| | | | | | | | | | Change-Id: Ic9d1a1f90bfda07d2796bca71a1ea61e94ffb6da Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QQmlEngineDebugService: Make translating the usage simpler.Friedemann Kleint2016-03-251-38/+42
| | | | | | | | | | | | | | | | Remove whitespace and formatting from the messages where possible to reduce the chances of them being overlooked by the translators. Change-Id: Ie0d0b29e03b13ae4f46dce1b57dd2a85d427c8c6 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* | QmlDebug: Support sending multiple messages per packetUlf Hermann2016-03-111-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | This reduces the overhead caused by the prepending of service names to packets. When running the planets example from qtcanvas3d through qmlprofiler the average message length, without service name, is 26 bytes. The average full packet, with name and length, is 64 bytes long. In fact, the time between stopping the application and the last message arriving in the profiling client is reduced by 30-50% with this change. Change-Id: I0ffdd0483d45bbe8b092c59a9dcd63c6dc59119c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7J-P Nurmi2016-03-011-4/+4
|\| | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro Change-Id: I3ca8f0422828191b7e19539c25f31f2d048e9f18
| * consistently put {qt,qml}_{module,plugin} at the end of project filesOswald Buddenhagen2016-02-251-4/+4
| | | | | | | | | | | | | | | | this fixes static builds by ensuring that all dependencies are exported. Task-number: QTBUG-51071 Change-Id: I5928f853a1d13b6a73533f9c6f6eae9da0e52a26 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-192-28/+40
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Make QQmlDebugConnector::hasEngine() constUlf Hermann2015-12-221-3/+3
| | | | | | | | | | Change-Id: I7441c24e3c2ae00ac274aa053d2e03d8f61ac830 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | QmlDebug: Add functionality to query if a server knows an engineUlf Hermann2015-12-151-0/+16
| | | | | | | | | | Change-Id: Iba40a1705c18d19c4ef5723aeb8ee5113e31041c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Use QJSEngine instead of QQmlEngine in debug servicesUlf Hermann2015-11-171-22/+22
| | | | | | | | | | | | | | | | | | This allows us to use the debug infrastructure in a JavaScript-only environment. Also add override declarations to make such changes easier in the future. Change-Id: I171271f0ad3868b3de71a8a2316a24602f94200a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QmlDebug: Restructure QPacket and QPacketProtocolUlf Hermann2015-11-172-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We cannot use the same data stream version for the client and server versions of QPacket and QPacketProtocol should not deal with QPackets but with simple byte arrays because the underlying QDataStream is hard to copy. The new QQmlDebugPacket picks its data stream version from QQmlDebugConnector now, which adjusts it when connecting. As there can only ever be one QQmlDebugConnector, we can keep the version static. The clients need to query the connection for the correct version. We may connect to several different servers sequentially or we may have a server running while using a client, and we don't want to confuse the versions between those. With this in place, all remaining occurrences of QDataStream are replaced with QPacket or QQmlDebugPacket. Change-Id: I3f6ba73fcbfad5e8df917c5feb9308116738a614 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | QmlDebug: move QQuickProfiler into a pluginUlf Hermann2015-11-171-1/+1
| | | | | | | | | | | | | | | | This saves some code in QtQuick and allows us to split up QPacket into different versions for client and server. Change-Id: I9b8c723274fb11d6321c5002910148b193aa6b40 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Use QStringRef in a bunch of places.wip/dbusSérgio Martins2015-10-181-1/+1
| | | | | | | | | | | | | | Done automatically with clazy static analyzer. Change-Id: Ia0cf8fa24331ab102a3c3c30c2aa92ef1ba772e2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Put QPacketProtocol into its own static libraryUlf Hermann2015-10-152-23/+14
| | | | | | | | | | | | | | | | | | | | | | | | We need it in 3 places in qtdeclarative and we could also use it in QtCreator. We don't want to bundle it with the debug client code as it is also necessary for the server. QPacket replaces QQmlDebugStream as it has the same purpose. This also fixes the inconsitent handling of data stream versions. Change-Id: I650fae353f267511c551b427d9169f4d718aa7f2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-09-251-15/+9
|\| | | | | | | | | | | | | Conflicts: src/qml/debugger/qqmldebug.cpp Change-Id: I93de5a81b18cdece475870cf7cfba1b9baef2304
| * QmlDebug: Make sure debug server knows connection before any messagesUlf Hermann2015-09-211-15/+9
| | | | | | | | | | | | | | | | | | In some cases the connection may relay a message to the server directly when calling one of the connect methods. This leads to a crash if the server, due to not knowing the connection yet, cannot reply. Change-Id: Iac2da08c621b70c2e5a1922efad0cd6ae4edc4e1 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | QQmlDebugServer: Drop duplicate service removalUlf Hermann2015-09-151-2/+0
| | | | | | | | | | Change-Id: I84dbca02dfa5ae7b0dd094b9999d08459f8e2084 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Improve usage message for -qmljsdebugger arguments.Ulf Hermann2015-09-151-6/+47
|/ | | | | | | | | Document all the options available and avoid the extra "Cannot load plugin" message if invalid options were given by not trying to start the thread with an empty plugin name. Change-Id: I87cb4185b58a8672db2ac3ea9c6b8b2155cbbe5d Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Remove unused member variable QQmlDebugServerThread::m_block.Friedemann Kleint2015-08-211-1/+0
| | | | | | | | | | | Fix CLANG build error: qqmldebugserver.cpp:115:10: error: private field 'm_block' is not used [-Werror,-Wunused-private-field] bool m_block; Change-Id: I3be87c1ec0347b46e90e40c8769aeb507cf22c26 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Allow specification of loadable debug services via command lineUlf Hermann2015-08-131-0/+6
| | | | | | | | | We don't want to load the debugger when profiling and vice versa. This makes it easier to prevent unwanted services from getting loaded. Task-number: QTBUG-47623 Change-Id: I28893b6218110274a6d30b27805d89dbb443add3 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Parse debug server arguments in ctorUlf Hermann2015-08-131-153/+91
| | | | | | | | | | | We will need them to determine which services to load. Also, drop all the complicated indirection. With all relevant code in one place we don't need the actions anymore. Setting the server's blocking mode only makes sense before the thread starts. Afterwards the result is undefined, so we don't have to specially protect it. Change-Id: I58135cd598c31d3a02ccd3f67b238da01a176934 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Clean up QQmlDebugConnector's addService() and removeService()Ulf Hermann2015-08-041-18/+18
| | | | | | | | | | | As we look up services by name we should also add and remove them by name. As the thread doesn't run during adding and removing of services we don't have to check the client plugins for the initial state. It's also a good idea to eventually disconnect any signals that we connect on addService(). Change-Id: I9acd17d2caafe15831f32b7b959dc2dea9cab08c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Don't ask QQmlDebugService for name() when we already know itUlf Hermann2015-08-041-10/+12
| | | | | Change-Id: Ibae6602bd1725d98ddaa751bfc00391a20a1460e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use QQmlDebugPluginManager for loading connection pluginsUlf Hermann2015-08-041-69/+8
| | | | | | | | Also remove all the hacks that deal with static builds, QT_NO_LIBRARY and friends. QQmlDebugPluginManager handles those cases. Change-Id: I62f13b787292108fa25d09fabc775332394989be Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Deduplicate debug server connection code.Ulf Hermann2015-08-042-27/+64
| | | | | | | | | | | | | The packet protocol can be part of the server, now that the server is not part of QtQml anymore. This enables us to remove some duplicated code from the connections. As an added benefit, with more control over the sending process, QQmlDebugServer can now efficiently send single packets, without creating a QList<QByteArray> first. Change-Id: I13cc831e254c02b737e64816d6d3ab051d760995 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove QT_NO_QML_DEBUGGER ifdefs from QQmlDebugServerUlf Hermann2015-08-041-15/+2
| | | | | | | Plugins in qmltooling won't get built if that is set. Change-Id: Ideced675064e74ccb78b9ac8c8fff2536150810c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move QQmlDebugServer into a pluginUlf Hermann2015-08-044-0/+881
Change-Id: I8dc95f64c6df7303e8f580f191ee35da2284718b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>