aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/debugger/qqmldebugserver.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use SPDX license identifiersLucie Gérard2022-06-111-38/+2
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add a TU for QQmlDebugServerMarc Mutz2022-05-041-0/+49
| | | | | | | | | | | | | | | | This allows includemoc'ing, as well as de-inlining the destructor of this polymorphic class. Requires to rename the original qdebugserver.cpp, which turned out to be the implementation file for QQmlDebugServer_Factory_. I chose, surprise, qqmldebugserverfactory.cpp. The whole plugin could even be implemented in a single .cpp file, I guess. Task-number: QTBUG-45582 Task-number: QTBUG-102948 Pick-to: 6.3 6.2 5.15 Change-Id: I81aa4c60fa30ba5ced546afc72c5a4a3ba0e619f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Move QQmlDebugServer into a pluginUlf Hermann2015-08-041-794/+0
| | | | | Change-Id: I8dc95f64c6df7303e8f580f191ee35da2284718b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Simplify QQmlDebugServer::enableFromArgumentsUlf Hermann2015-08-041-47/+47
| | | | | | | | | | We can use the command line arguments already retrieved by QQmlDebugConnector and we can return early in error conditions. Also, make sure we don't pass QStringLiterals to QRegExp. Change-Id: I06ce6eec9ea3adeabb9f4d35de8024eab8729d35 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Eliminate QQmlDebugServerInstanceWrapperUlf Hermann2015-08-041-38/+27
| | | | | | | | As QQmlDebugServer is not accessible from outside we can just make the constructor public now. Change-Id: I06633330db861fcc78f9c1c0362755987c4ffed2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove pimpl from all classes derived from QQmlDebugServiceUlf Hermann2015-07-311-1/+0
| | | | | | | | There is no point in using pimpl for purely internal classes, especially when we move them to their own plugins. Change-Id: I2ee8bf2ded2242d91bab89f589a131dc3bcc9a55 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use signal/slot for passing messages through QQmlDebugServerUlf Hermann2015-07-311-22/+40
| | | | | | | | | | | | | | This results in much cleaner code than the previous implementation using QMetaObject::invokeMethod(). We have to use read locks now for adding and removing engines, as we should have done already before. If a condition is waiting on a write lock you cannot acquire a read lock from another thread. So, if we kept the write locks we wouldn't be able to receive messages while the engines are waiting. Change-Id: Icfe641601dec2f8d7181ae579146ed603d57a4c2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Simplify thread synchronization in QQmlDebugServerUlf Hermann2015-07-311-35/+13
| | | | | | | | | | | | | | | m_clientPlugins will only be accessed from the server thread, so it doesn't need to be protected by a mutex. m_plugins will only be modified before the server thread starts and after it ends. During the runtime of the thread it is constant and thus doesn't need to be protected, either. Engines are supposed to be added and removed after any waiting for connections and hello messages is done, so we can reuse the hello mutex for synchronization there. Change-Id: I09037430804c264a5f784c4b5a85668d87851b12 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove QQmlDebugServer::advertisePlugins()Ulf Hermann2015-07-311-30/+1
| | | | | | | | | As all services have to register before the server starts and cannot unregister until after the thread is stopped, we don't need any additional service advertisement anymore. Change-Id: I20977560b4f7a3acb08a6cc703916bebf61d0220 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Make QQmlDebugService::registerService() private and part of ctorUlf Hermann2015-07-301-7/+10
| | | | | | | | | | | | | | | | By forcing all debug services to register before the thread starts we can get rid of the complicated thread synchronization and have a more natural API for the services. We can also better enforce the thread situation when registering services in QQmlDebugServer now. QQmlProfilerService should not moveToThread() in its constructor as the thread has not been started, yet. The thread affinity of QQmlProfilerService doesn't make any difference anyway, as all relevant methods are protected by mutexes and it doesn't have any slots. Change-Id: I57db9e2bf94ec6884ede694715dadf5bfd687334 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Make sure QQmlDebugServer does not deadlock in blocking modeUlf Hermann2015-07-301-8/+9
| | | | | | | | | Previously, the server could wake the helloCondition before the main thread was waiting on it. This would lead to the main thread then waiting forever once it hit the wait() statement. Change-Id: I694d65f72cf6be6e4c5a0c65ea4aea8a5878bf5b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move debugger initialization out of QQmlDebugServer and QQmlEngineUlf Hermann2015-07-301-133/+81
| | | | | | | | | | | | | | | | | | | QQmlDebugConnector has to check the parameters before deciding if (and what kind of) instance to create. It also has to add the services itself as we don't want to tie a specific implementation of QQmlDebugConnector to a specific set of services. Logic to load the services from plugins will be added in a separate change. Integrating the service initialization with the connector initialization enables us to load the services before the server thread startsi, which will simplify the thread synchronization. QQmlConfigurableDebugService has to recheck for blockingMode once it gets enabled as it cannot rely on being enabled right away anymore. It should have done that already before as it's possible to disable and re-enable services. Change-Id: I9d161d78836bae10d688a90b4c2a32efed320412 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Extract minimal interface from QQmlDebugServer and use it.Ulf Hermann2015-07-301-205/+205
| | | | | | | | | | This will allow us to move QQmlDebugServer into a plugin. The new QQmlDebugServer is the interface exposed to connection plugins. The interface exposed to services is renamed to QQmlDebugConnector, as technically it doesn't have to be a "server". Change-Id: Id508b8c0a6960228e889f45a437b73060392db39 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Don't exposes QQmlDebugServer's list of services.Ulf Hermann2015-07-291-9/+2
| | | | | | | The only thing we ever want to do is look up a service by name. Change-Id: I45007d3c742201ccc0871379a91b37381f6d1760 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Make QQmlDebugService's state and engine callbacks publicUlf Hermann2015-07-291-3/+3
| | | | | | | | | It's clear that the public API of QQmlDebugService is meant to be used by QQmlDebugServer or future replacements. Restricting access with "friend" requires listing all those possible replacements. Change-Id: I197f1fa53cf985f52cfe5e077a95eda1ed5214b4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove some methods from QQmlDebugServerUlf Hermann2015-07-291-22/+2
| | | | | | | They were only used internally or for redundant checks in the tests. Change-Id: Iaa7d52be030adaa52a07b28fba53bdef9fada879 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Don't wait for debug services if none are activeUlf Hermann2015-07-291-1/+1
| | | | | Change-Id: I30f0ea1d34c9cb8d66f9dfd1e381ecc6ae8ccc61 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix broken Q_UNUSED declarations in QQmlDebugServerUlf Hermann2015-07-231-4/+1
| | | | | Change-Id: I0f2cf0a09dfbfb1c2db79b3b5e0c35da546e5c31 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move data stream version into QQmlDebugStreamUlf Hermann2015-07-221-5/+4
| | | | | | | | When moving the server into a plugin we won't be able to directly access it anymore. Change-Id: Iea0bac187cfa5cda69a0852b36d61f535e12d6c6 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use QQmlDebuggingEnabler::StartMode in connectToLocalDebuggerUlf Hermann2015-07-021-6/+7
| | | | | | | This unifies the API and gets rid of an ambiguous bool parameter. Change-Id: If9d8906f9cd366cf37bd1bdded7fbd6c62146e32 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-301-7/+18
|\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/qml/qqmlengine.cpp src/quick/items/qquickitemsmodule.cpp tools/qml/main.cpp Change-Id: Ida8daf6b4d7e675385f2f5514c446e52dedaf136
* | Add option to use a local socket for QML debuggingUlf Hermann2015-06-261-12/+116
| | | | | | | | | | | | | | | | | | | | Using a TCP debug server comes with a number of drawbacks. It has a larger overhead than other connection types, the application has to be able to access the network and there has to be an open port we can find somehow. Change-Id: Ia7fb24006b89419988c6504797303d84c3aa1bbc Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Disable plugin loading in QQmlDebugServer if QT_NO_LIBRARYUlf Hermann2015-06-261-2/+8
| | | | | | | | | | Change-Id: I29682fc069cb457abeca90a1e1f7f7c964ed1607 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Add 28 QList::reserve() callsSérgio Martins2015-06-081-2/+11
| | | | | | | | | | Change-Id: Id4820ac458f48b10f2bf457144767efdef9e2c07 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Fix build with QT_STRICT_ITERATORSSérgio Martins2015-05-151-2/+2
|/ | | | | Change-Id: I3df6ac107cb46b3a1b15b80f39d7c6015adcd9ac Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QtQml: Micro-optimize iterator loops.Friedemann Kleint2015-02-261-4/+4
| | | | | | | Avoid repeated instantiation of end() in loops, use variable instead. Change-Id: I3bb1c6918cfd16a5dcefbcc03c442e99fe9bf76b Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Rename QML debug macro to Qt naming stylePasi Petäjäjärvi2015-01-121-4/+4
| | | | | | | | | | With this change the macro is in line with QT_NO_<feature> style of naming macros. This way it will also be automatically added to the file mkspecs/qmodule.pri in QT_NO_DEFINES value. Change-Id: I96041438ef68bbcbc4e66301b0f5fe1212129c1a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Disallow QQmlDebugServer::enable for QT_QML_NO_DEBUGGERUlf Hermann2015-01-121-0/+8
| | | | | | | | | | | This mirrors the behavior of the QQmlDebugServer constructor. Unfortunately we have two #defines to disable the debug server, QT_QML_NO_DEBUGGER and QQML_NO_DEBUG_PROTOCOL. We should honor both of them as people might rely on either of them to effectively prevent the debug server from working. Change-Id: I0bc0d48632eaa05c471d0afed6fc48436116746a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* fix the build with -no-qml-debugShawn Rutledge2014-12-131-1/+0
| | | | | | | The "cleanup" variable doesn't exist in this case. Change-Id: Ia7ed654d5c9ae57bc3f7cff39acbd72214ff4188 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-091-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4globalobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/quick/items/qquicktext_p.h src/quick/items/qquicktextedit_p.h src/quick/items/qquicktextinput_p.h Change-Id: If07e483e03197cb997ef47a9c647a479cdb09f4c
| * Mark cleanup function as unused if compiled with QT_QML_NO_DEBUGGERUlf Hermann2014-11-051-0/+1
| | | | | | | | | | | | | | | | | | | | The static cleanup function in qqmldebugserver.cpp is only used if the debug server is actually created. If not we can mark it as unused to avoid compile warnings. Enclosing it in #ifdef would be uglier. Task-number: QTBUG-42394 Change-Id: Ieb7fa38ecb346e80ce815ced85eb3a168bad9d99 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | QmlDebug: Provide public method for starting a debug serverUlf Hermann2014-12-051-35/+102
|/ | | | | | | | | With QQmlDebuggingEnabler::startTcpDebugServer you can create a debug server for debugging or profiling also without the qmljsdebugger command line argument. Change-Id: I642f73680585f9c7578762bcc0b247c736fe1338 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Remove V8 profiler serviceUlf Hermann2014-05-091-1/+0
| | | | | | | | | It's broken and useless and it sends confusing data to the profiler client. Task-number: QTCREATORBUG-12188 Change-Id: I944cf19a78ee4378d5773e7aa80876f199a0f03b Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Give the QML and the debug server thread an objectname.Thomas McGuire2014-04-011-0/+1
| | | | | | | | | Now it is easier to identify the threads in e.g. the debugger in QtCreator. Change-Id: I032822e869df09cf43dc1d6e01d14610005ce217 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
* qmldebugger: handle static builds correctlyFawzi Mohamed2014-03-111-0/+10
| | | | | | | | | | | | The loading of the qml debugger was hardcoded to dynamically load its plugins. Now directly build and instantiate the QQmlDebugServerConnection in static builds. Done-with: Kai Koehne <kai.koehne@digia.com> Change-Id: I38bf0e310caaa6aaa743e3814b0108c6fe7001df Reviewed-by: Ulf Hermann <ulf.hermann@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Unify initial waiting of debug servicesUlf Hermann2014-02-101-4/+53
| | | | | | | | | | | | The debug services generally behave in one of two ways when initializing: Either they block the initializing thread until some configuration is passed over the network or they just go on. By introducing a generalized configurable debug service the various ways of waiting on initialization are cleaned up. The API defined for it also allows for engine-specific initialization. Change-Id: Id5685ef17d2a7eb1222629f7caa5ec53076d47b2 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Protect list of client plugins from concurrent accessUlf Hermann2014-02-071-41/+35
| | | | | | | | | | Previously the list of client plugins in the QQmlDebugServer could be accessed concurrently from receiveMessage() and addService() either when in non-blocking mode, or if the client uses service discovery or sends additional hello messages after the first one. Change-Id: I946243957184210d40ebca728143714c341b1226 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Unify the interface for QQmlDebugServicesUlf Hermann2014-02-051-0/+34
| | | | | | | | Let the debug server handle adding and removing of engines through defined interfaces to prepare for multi-engine profiling and debugging. Change-Id: I7b277e54bdcce1d3e95e723f041a7db6b08b29fc Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Make the QML debug server thread safeUlf Hermann2014-01-301-115/+135
| | | | | | | | | | | | Previously, if instance() was accessed concurrently we could run into various problems as the initialization wasn't synchronized. By putting most of the initialization into the constructor, wrapping it into a Q_GLOBAL_STATIC and discerning between accesses that need to wait for the initial "hello" packet and ones that don't the situation is improved. Change-Id: I182e8e6abf054b851ef7ea5f897d4a197a9da4bf Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Allow debug plugin registrations from other threads than main GUIUlf Hermann2014-01-291-4/+4
| | | | | | | | | | There's no real reason to disallow that. The only thing we want to check there is that the registration doesn't take place in the debugger thread. Disallowing registrations from anywhere but the main GUI thread creates unnecessary problems with threaded QML profiling and debugging. Change-Id: Ic72d19237e2ddba02cc88f7f5a0743f6640fed4d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Debugging with V4Erik Verbruggen2013-11-101-2/+0
| | | | | | | | | Currently missing, but coming in subsequent patches: - evaluating expressions - evaluating breakpoint conditions Change-Id: Ib43f2a3aaa252741ea7ce857a274480feb8741aa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix deadlocks in debugger infrastructure on MacKai Koehne2013-10-161-0/+1
| | | | | | | | | Set QReadWriteLocker to recursive. This is needed e.g. to allow _q_changeServiceState to get a read lock when called from inside receiveMessage. Change-Id: I287a7c7f44e94005c0458825f8f6d1877ee914dd Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
* Debugger: Make sure client list is protected by mutexKai Koehne2013-05-241-0/+3
| | | | | | | So far we didn't protect this access. Change-Id: Id738453db5e655371fa2fbf88f81cab6c0af466f Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
* Debugger: fix race condition in block modeKai Koehne2013-04-231-9/+6
| | | | | | | | | | | Make sure that the GUI thread & debugger thread actually sync on startup. So far the GUI thread would block forever in waitCondition.wait() if the debugger thread spawns & receives the HELLO before. Also remove unused code and rename variables to make their use more obvious. Change-Id: I8285e8860667496d491807e696535353d9f14dea Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
* QmlDebugServer: Ensure plugin is setAurindam Jana2013-04-161-1/+1
| | | | | Change-Id: Ibc0e5ed626edc076e96c4848994ba0cafba0f5c6 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Debugger: Accepts port range as argumentsAurindam Jana2013-04-021-11/+26
| | | | | | | | | | Allow a port range to pass on command line, and try to listen on any of the ports in the range. (Re)using the ',' separator allows for backwards compatibility, that is, also Qt 4 will accept a -qmljsdebugger=port:1000,1010 argument, but will only try to listen on port 1000. Change-Id: Ic03fe20e4aee9ecdea86651f46f1df5cb19bd75c Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>