aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
Commit message (Collapse)AuthorAgeFilesLines
* V4 Debugger: use engineAdded() instead of engineAboutToBeAdded()Ulf Hermann2016-08-042-3/+3
| | | | | | | | | | | | | | | It does not make a difference in functionality, but after engineAdded() the server won't wait on a mutex anymore. Before this change, if you managed to send a message to the V4 debugger after the server had called aboutToBeAdded(), but before it had stopped waiting, you could produce a deadlock by scheduling an event for the GUI thread that was never delivered. This is a cherry-pick of 18c4295e25503ae637a715858de5c94a3d105a92 from 5.7 as apparently the problem also occurs in 5.6. Change-Id: Ie2343e6da4bd0b8956d41ff8ebd4d7594616ebd1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* V4: Always set the tag when boxing a pointer in QV4::Value.Erik Verbruggen2016-06-161-1/+1
| | | | | | | | | All setters now store tags, so no-one can play loosy-goosy with the boxed values (and accidentally forget to "tag" a value, resulting in random garbage). Change-Id: Ia0b78aa038d3ff46d5292b14bd593de310da16a0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QmlProfiler: When flushing data, send it in the right orderUlf Hermann2016-05-251-2/+6
| | | | | | | | | | | Some of the adapters immediately return dataReady() when reportData() is invoked. This means that there is only one adapter in the start times list then, which in turn causes all the data from that adapter to be sent at once, without caring for the other adapters' timestamps. Change-Id: Ic1e12fdcefb0a691067518fba100368f13c927f7 Task-number: QTBUG-53590 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* 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>
* Fix build with -no-guiTasuku Suzuki2016-03-241-1/+1
| | | | | | Change-Id: I677ab9fce527b5220317d4d30f48d55b7f081e6a Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* consistently put {qt,qml}_{module,plugin} at the end of project filesOswald Buddenhagen2016-02-257-28/+26
| | | | | | | | 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>
* Clean up QV4DataCollectorUlf Hermann2016-01-222-122/+71
| | | | | | | | | | We don't need to pass debuggers and engines around as the data collector already has all the necessary information. Also, the exception collect job is only used in the test case, so we don't need to define it in the collector. Change-Id: I3197dd5c2d99e95465aa787097c6f8bf8aee794e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* V4 Debugger: Avoid looking up values in debugger threadUlf Hermann2016-01-224-349/+361
| | | | | | | | | | | | To avoid interaction with the engine from the debugger thread we move the value lookup functionality into the data collector, and drop the RefHolder. Also, we define some more debugger jobs to move the work the request handlers do into the GUI thread. Task-number: QTBUG-50481 Change-Id: Ia73ebd01e715f13110ef010a766e9b0a1e202df9 Reviewed-by: Nils Jeisecke <jeisecke@saltation.de> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix inconsistent use of override keywordThiago Macieira2016-01-081-3/+3
| | | | | Change-Id: I408dcb81ba654c929f25ffff1427560b6e7962ad Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Fix inconsistent use of 'override'.Erik Verbruggen2015-12-231-2/+2
| | | | | Change-Id: Id3295937bdbd2372a77f273ce5c048807d43f51e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* qDelete(hash/map.values()) -> qDelete(hash/map)Albert Astals Cid2015-12-151-1/+1
| | | | | | | Saves iterating the whole container and unneeded allocation of a list Change-Id: Iae1f8e0cf3a17b163cf930c43a27b2ebb4315e5c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QQmlNativeDebugConnector: Do not translate warning.Friedemann Kleint2015-10-221-2/+2
| | | | | | | qWarnings() usually are not translated. Change-Id: I0375e0e21054d33349d3f56ee9ac6f580e366736 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* QmlDebug: Add a debug service for use with native debuggershjk2015-10-165-1/+903
| | | | | | | | | | | | | | | | 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: Add a debug connector for use with native debuggershjk2015-10-164-0/+399
| | | | | | | | | | 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>
* Only set V4 debugger when service is enabledUlf Hermann2015-10-152-9/+31
| | | | | | | Otherwise different debug services could steal each other's debugers. Change-Id: Ic0a50333d21c7d20a7124240ea598f8446400ae3 Reviewed-by: hjk <hjk@theqtcompany.com>
* QmlDebug: Split QV4::Debugging::Debuggerhjk2015-10-146-65/+68
| | | | | | | | | | ... into a pure interface and a QV4::Debugging::V4Debugger implementation. This is in preparation of a second implementation of this interface to be used with 'native mixed' debugging. Change-Id: I3078dcfe4bdee392a2d13ef43a55ca993e7b88d8 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* QmlTooling: Rearrange qmltooling.prohjk2015-10-141-4/+8
| | | | | | | Make the distinction between connectors and services a bit clearer. Change-Id: I5a8de587beaaed4b4b2138d9d50c5b92fea38df9 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Libraries: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
| | | | | | | Use character literals where applicable. Change-Id: I294fc4cb5cbbd23df9735ba2b398118f37cbe08a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* 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>
* Further cleanupsLars Knoll2015-09-152-12/+10
| | | | | | | Reduce usage of ScopedContext. Change-Id: I84a6a7478065de3398fd0b21596ca1308e78ceb3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Rename currentExecutionContext to currentContextLars Knoll2015-09-151-1/+1
| | | | | | | | Now that the other method is gone, let's use the shorter currentContext Change-Id: I2a6fb3b77f83a1ffdf314ad29081e303d17030ed Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Store the stack of executioncontext's on the JS stackLars Knoll2015-09-152-13/+8
| | | | | | | | | | | | | | | | This saves one pointer per allocated execution context. Now every execution context that is pushed, allocates two Values on the js stack. One contains the context itself, the other one the offset to the parent context. Things are a bit tricky for with and catch scopes, as those are called from the generated code, and can't open a Scope anymore. In addition, all methods iterating over the js stack frames need to work with ExecutionContext pointers, not ScopedContext's. Change-Id: I6f3013749d4e73d2fac37973b976ba6029686b82 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix profiling of QML/JS compilationUlf Hermann2015-08-241-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* 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>
* Clean up data format for V4 debug connectionUlf Hermann2015-08-192-44/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the type announced for functions to the actual JavaScript type "function". The type for null is also wrong: it should be "object". However, older QtCreators cannot distinguish between null and {} if null gets the correct type, unless you explicitly compare x === null in an expression evaluator. For this reason the fake "null" type is kept for now. Also, the value field of undefined is now set as QJsonValue::Undefined which causes it to be omitted when sent over the wire. This is the logical thing to do. In addition we add type and value fields for all data members mentioned in a response, not only the ones specifically asked for. The value field is the actual value for any primitives (including strings), or the number of properties for composite types: objects, arrays, functions. In turn, the "ref" members are omitted for primitive types, so that we don't have to hold references to them in the debug service anymore. Even old QtCreators can deal with verbatim data members without "ref". Task-number: QTBUG-47746 Task-number: QTBUG-47747 Change-Id: I773e6418c39cd9814aadb5fb5ef7e109f9a4e618 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* V4 debugger: Fix expression evaluationUlf Hermann2015-08-194-24/+37
| | | | | | | | | | | | We need to collect the refs in the debugService's list in order for them to show up on addRefs() and we need to generate proper error responses if either the debugger is not stopped or the evaluation throws an exception. Task-number: QTBUG-47797 Task-number: QTBUG-47816 Change-Id: I98f17c1f3976859ee50b9bfac41091276ff60982 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* V4 Debugger: Avoid special refs when looking up normal onesUlf Hermann2015-08-191-1/+1
| | | | | | | | | | | | | | | | The "values" of "special" refs are always JavaScript "undefined"s. Thus, when trying to deduplicate an actual "undefined" we'd accidentally hit the special refs. Avoid this by checking if a found ref is special. In an ideal world we'd get rid of the special refs altogether and save QV4::FunctionObject in the values array, but that is not quite trivial as long as the QV4::ExecutionEngine::stackTrace() doesn't give us FunctionObjects. Task-number: QTBUG-47788 Change-Id: Idf358c285f40930220fad2207c6ab5c9101573b2 Reviewed-by: Simon Hausmann <simon.hausmann@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>
* Move DataCollector into debugger pluginUlf Hermann2015-08-106-38/+686
| | | | | | | | The data collector and all the jobs it uses to interact with the engine are only used from the debugger plugin. We can as well move them there. Change-Id: Ia48251f08b48c7e1e607b8ae2a3d1de29f80f742 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Move V4 debugger agent into the debugger pluginUlf Hermann2015-08-105-104/+353
| | | | | | | | | | The debugger is the only thing that actually needs it. Note that for this to work we need to make QV4::Debugging::Debugger a QObject and add some signals. The net effect is still a reduction in binary size of about 1kb. Change-Id: Ibecb8cfa140fc26fc13c8cbefb3d027ebdcd28a4 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Change data collection for debugging to use QV4::Value.Ulf Hermann2015-08-102-270/+50
| | | | | | | | | | | | | | | | This patch changes the variable collection to store QV4::Value values into a JS array, which is retained by the collector. This prevents any GC issues, and gives a nice mapping from handle (used in the debugging protocol) to JS value. It also allows for easy "shallow" object serialization: any lookup can start with the QV4::Value, and add any values it encounters to the array. Testing is changed to use this collector directly, thereby testing the class that is actually used to generate protocol data. Task-number: QTBUG-47061 Change-Id: Iec75c4f74c08495e2a8af0fedf304f76f8385fd7 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Move QQmlConfigurableDebugService into qmltooling/sharedUlf Hermann2015-08-045-2/+110
| | | | | | | 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-0413-0/+2876
| | | | | Change-Id: Icd4e6a6c57bc3ac65cb43d2329d236012b988678 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move profiler and engine control services into a pluginUlf Hermann2015-08-0413-0/+1339
| | | | | Change-Id: I12627a07ceedea4aceafa6f0e630c0cab69d156d Reviewed-by: Simon Hausmann <simon.hausmann@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>
* Hide QQmlInspectorServiceImpl in .cpp fileUlf Hermann2015-08-043-29/+29
| | | | | | | Nobody needs to access it anymore. Change-Id: Ib782037ac0a8721997f6d36995d03f42c060602b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove extra layer of indirection from inspector serviceUlf Hermann2015-08-046-272/+16
| | | | | | | | We are not loading any secondary inspector plugins anymore, so the logic to select them is unnecessary now. Change-Id: Ic44c49e41c6bff4b19ce527df4657c6d73c0c82b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Pass QQmlDebugService to AbstractViewInspectorUlf Hermann2015-08-049-14/+14
| | | | | | | | This way we don't have to look up the implementation in order to send messages. Change-Id: I70cb122785875cf8b4ba6f7f2afd62cca77c8abb Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move inspector service and QtQuick2 inspector into a common pluginUlf Hermann2015-08-0419-32/+334
| | | | | | | | | 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>
* Remove pimpl from debug server connectionsUlf Hermann2015-08-047-180/+132
| | | | | | | | Now that they are self-contained plugins there is no reason for the indirection anymore. Change-Id: Ic2e2fe2075796c758057235e12981c8d40ce97c2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use QQmlDebugPluginManager for loading connection pluginsUlf Hermann2015-08-0410-77/+58
| | | | | | | | 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-0410-152/+92
| | | | | | | | | | | | | 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-0413-9/+1033
| | | | | Change-Id: I8dc95f64c6df7303e8f580f191ee35da2284718b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Retrieve services from debug connector, not via static instance()Ulf Hermann2015-08-042-3/+2
| | | | | | | | | 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-042-3/+3
| | | | | | | | 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>
* Fix namespaces in inspector pluginUlf Hermann2015-08-0412-23/+42
| | | | | | | | | Defining things outside the Qt namespace and then accessing Qt internals is just asking for trouble. The redundant QtQuick2 namespace can be dropped, though. Change-Id: Ifa83733a3f98704b7b51697dbca9486d0f504f65 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use signal/slot for passing messages through QQmlDebugServerUlf Hermann2015-07-311-4/+4
| | | | | | | | | | | | | | 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>