aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/debugger
Commit message (Collapse)AuthorAgeFilesLines
* QmlDebug: Add a debug service for use with native debuggershjk2015-10-162-0/+14
| | | | | | | | | | | | | | | | This service provides information about the state of the most recently used QmlEngine in a way that can be integrated with "native" debuggers (GDB, LLDB, potentially CDB). Unlike the existing QV4 debugger service, the data extraction is triggered by direct calls from the native debuggers, i.e. has the examined QmlEngine stopped at the time of inspection. Since roundtrips through the native debuggers are expensive, an additional goal is to minimize roundtrips. Change-Id: Ic420129bbc15162197e35b52d92e882c027c9f6d Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* QmlDebug: Don't duplicate Qt namespace when importing debug pluginsUlf Hermann2015-10-161-1/+3
| | | | | | | | | | Q_IMPORT_PLUGIN already adds the Qt namespace to the symbols. Task-number: QTBUG-48415 Change-Id: I25b4ffdcddd0bdd52bfd390964b9c1a333a79b30 Reviewed-by: hjk <hjk@theqtcompany.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QmlDebug: Add a debug connector for use with native debuggershjk2015-10-161-3/+12
| | | | | | | | | | This debug connector offers a few simple C functions a native debugger can hook into to communicate with QML debug services. It is the base of the 'native mixed' debugging mode in Qt Creator. Change-Id: I32ce1f21be8e3522dccf1210d4de3b131b819bc5 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Fix compile error.Milian Wolff2015-10-151-1/+1
| | | | | | Change-Id: I563b4df01b6d57c4a5a015be34c7a7616f4894de Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Add a \sinceLars Knoll2015-09-231-0/+2
| | | | | Change-Id: Ib7fbbab5760e1f0c9727f8767ff79f64075fd358 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Remove quotes from debug connector error messagesUlf Hermann2015-09-151-3/+3
| | | | | | | | | The client expects them without quotes and other error messages don't have quotes (except for some in QQmlDebugServer which have to be replaced anyway). Change-Id: I75716f9223b268697801a91ea506817647e1e594 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix profiling of QML/JS compilationUlf Hermann2015-08-241-5/+6
| | | | | | | | | | | | | | | | | | | The compilation of .js resources was missed and the compile times were underestimated because the dependency resolution and error checking wasn't factored in. In particular we only profiled the done() step for QQmlTypeData. However, JavaScript compilation also occurs in the dataReceived() step of QQmlScriptBlob and QQmlTypeData will already parse the program into an AST at that step. Compile steps can be nested now, but considering the fact that significant time may be spent before and after compiling dependencies for a parent module, this seems to be the best way to model them. Furthermore, in order to not needlessly convert QUrl to QString at runtime, the compilation profiler saves the files now as QUrl. Change-Id: I215a87787f9117c069ecd77b2d913cc0b0ff3c89 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Allow specification of loadable debug services via command lineUlf Hermann2015-08-132-1/+12
| | | | | | | | | 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>
* Move QQmlConfigurableDebugService into qmltooling/sharedUlf Hermann2015-08-042-107/+0
| | | | | | | It's only used by plugins now. Change-Id: Ia73a2a22ba6bccbd85bbca6eda2fb9f5a8d6dd3b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move debugger-specific services into a common pluginUlf Hermann2015-08-048-2506/+1
| | | | | Change-Id: Icd4e6a6c57bc3ac65cb43d2329d236012b988678 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move profiler and engine control services into a pluginUlf Hermann2015-08-0410-1130/+4
| | | | | Change-Id: I12627a07ceedea4aceafa6f0e630c0cab69d156d Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Clean up QQmlDebugConnector's addService() and removeService()Ulf Hermann2015-08-042-4/+4
| | | | | | | | | | | 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>
* Move inspector service and QtQuick2 inspector into a common pluginUlf Hermann2015-08-045-344/+2
| | | | | | | | | The inspector service doesn't do anything useful without the QtQuick2 plugin and vice versa. This way we can also use the QQmlDebugPluginManager. Change-Id: I78f154dcc9103ec9ec3d2eda216bfb293231583e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Add a factory for QQmlDebugService and use it to load pluginsUlf Hermann2015-08-043-0/+74
| | | | | | | | | Debug services can now be added as plugins in qmltooling/ . QQmlDebugConnector will load any service plugins matching the factory's iid before open()'ing the connector. Change-Id: I2e4cabd714018f62cf4d60b0ebd2827a85431964 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move QQmlDebugServer into a pluginUlf Hermann2015-08-046-937/+23
| | | | | Change-Id: I8dc95f64c6df7303e8f580f191ee35da2284718b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Simplify QQmlDebugServer::enableFromArgumentsUlf Hermann2015-08-043-47/+58
| | | | | | | | | | 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>
* Retrieve services from debug connector, not via static instance()Ulf Hermann2015-08-044-2/+24
| | | | | | | | | This will allow us to remove the instance() methods and create the services from factories in plugins. Also, it allows us to remove the isDebugging member from QQmlEnginePrivate. Change-Id: Id9d9820a910902ecfdb1e8175e215093ce3d0965 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Extract minimal abstract interfaces from debug services.Ulf Hermann2015-08-0413-127/+300
| | | | | | | | We will access the services' functionality through those interfaces once they live in their own plugins. Change-Id: I0a0d7e73c07cb874b3b507cc4a9d304588c87bca Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Periodically flush profiling data to client.Ulf Hermann2015-08-046-37/+129
| | | | | | | | | | | | | | | | | | | | This reduces memory usage as the data can be deleted once it is sent. It also reduces the time it takes to transmit the data when profiling is stopped. It does incur a runtime cost as the sending now takes place while the application is running. The decision to periodically flush or not is left to the client, who can specify a flush interval when starting profiling. Usage of the flushing feature also relaxes the guarantees regarding the sorting of events before they are sent. Events with higher timestamps are now allowed to arrive before events with lower timestamps. Any clients implementing the flushing need to take this into account. This will eventually allow us to do away with the server-side ordering altogether. Task-number: QTBUG-39756 Change-Id: Idaf4931dc17f224c2bd492078b99e88b1405234e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Avoid QVector::pop_front()Ulf Hermann2015-08-042-5/+10
| | | | | Change-Id: Id2de4ab8c17f7e0412b44a1d30c6238861464989 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Make QQmlConfigurableDebugService a templateUlf Hermann2015-07-317-98/+51
| | | | | | | | | We will need to derive from service-specific interfaces once we move the services into plugins and QQmlConfigurableDebugService doesn't need to live in QtQml. Change-Id: I151f32ea0f8be9719b245fc19164269c6e62a84a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove pimpl from all classes derived from QQmlDebugServiceUlf Hermann2015-07-3113-528/+343
| | | | | | | | 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-3111-60/+53
| | | | | | | | | | | | | | 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-308-23/+22
| | | | | | | | | | | | | | | | 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-307-140/+347
| | | | | | | | | | | | | | | | | | | 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-308-256/+302
| | | | | | | | | | 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>
* Improve QV4DebugService debug outputUlf Hermann2015-07-291-3/+3
| | | | | | | JSON Payloads look better without the quotes. Change-Id: I5a7954ab58449cccabc29b0d3b499838dafe9338 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use QVector rather than QList for storing QQmlProfilerDataUlf Hermann2015-07-292-9/+9
| | | | | Change-Id: I94519181e915c5e2df9614ad4e1180fb159252e3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix includes for QQmlDebugServerConnectionUlf Hermann2015-07-291-2/+2
| | | | | | | We don't want to require core-private for no reason. Change-Id: Iff92e52d1894dde9b2155b4e42c21eec2b852f97 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove QQmlDebugService::objectToString()Ulf Hermann2015-07-292-17/+0
| | | | | | | It isn't used anywhere. Change-Id: I73e2f448be30c04dca4d7122d173782e302478bd Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Don't exposes QQmlDebugServer's list of services.Ulf Hermann2015-07-293-12/+4
| | | | | | | 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-293-16/+19
| | | | | | | | | 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-292-25/+2
| | | | | | | They were only used internally or for redundant checks in the tests. Change-Id: Iaa7d52be030adaa52a07b28fba53bdef9fada879 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove static proxy methods from QQmlDebugServiceUlf Hermann2015-07-293-22/+3
| | | | | | | | | They all internally map to one-liners and just add to binary size and complexity. Especially, the most used one, isDebuggingEnabled(), simply checks if there is a QQmlDebugServer::instance(). Change-Id: Ib269928e08506894d933f6696e34ff0d3acb048b 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>
* Avoid QVector::pop_front()Ulf Hermann2015-07-282-12/+16
| | | | | | | It's very inefficient. Change-Id: Icde138c015379679c4d5a8c2c8e30cb39a1bb245 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Don't remove inspector service if no plugins are availableUlf Hermann2015-07-231-2/+0
| | | | | | | | | | The client most likely won't be able to deal with a previously announced service suddenly disappearing anyway. All other services only deregister themselves once the server shuts down and this behavior will become mandatory in order to reduce thread synchronization problems. Change-Id: I76e812f3dbcb2cd48eccf9b5a8829751ef7463f0 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove some unused friend declarationsUlf Hermann2015-07-231-2/+0
| | | | | Change-Id: If45e084cc080c03b486fdfea33fadb4bb16e8cef 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>
* Add debug plugin managerUlf Hermann2015-07-222-0/+94
| | | | | | | | When splitting the QML tooling into several plugins we need a unified way to load them. Change-Id: I3e17dc5e9427cc45db962f7fa0a695514544d64c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move data stream version into QQmlDebugStreamUlf Hermann2015-07-224-12/+12
| | | | | | | | 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>
* Simplify object/id lookup in QQmlDebugServiceUlf Hermann2015-07-214-113/+52
| | | | | | | | | | By tracking object destruction we can avoid looping over all cached objects to find out which ones are still OK and we don't have to manually clear the cache anymore. Looking up objects by source location is specific to the engine debug service and should be done there. Change-Id: I7dab73a7bf9c17087784f1bd9c5aef513b31e2c1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use QVector instead of QList in V4 profilerUlf Hermann2015-07-202-10/+11
| | | | | | | For complex types QVector results in better performance. Change-Id: I8ac3dccfa4272a755d36964b0373dc115f520223 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Make name and version of QQmlDebugService constUlf Hermann2015-07-208-34/+21
| | | | | | | They aren't supposed to change after construction. Change-Id: I4aee0c04f5bb77b0e75c016ecbc72ea34639d587 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Unify #include syntaxUlf Hermann2015-07-201-1/+1
| | | | | Change-Id: I4e0e79ebae3d42664bcf617193ca347890cf922e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Make QQmlDebugService::name() a const referenceUlf Hermann2015-07-202-2/+2
| | | | | Change-Id: I7e75be206a1821018efc435337963f131b2996a8 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>