aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-021-0/+27
|\ | | | | | | Change-Id: I5d2c3da38df35922b2147c3c0bc55c6c3bae2fe5
| * Skip block context within call contexts when searching for parametersUlf Hermann2019-04-291-0/+27
| | | | | | | | | | | | | | | | | | | | | | Only the call context contains the signal parameters. However, there can be any number of nested block contexts in a function. This manifests itself when the function needs an execution context. The simplest way to trigger this is attaching a debugger. Fixes: QTBUG-75393 Change-Id: Iabdc06a9fe7bf88204525d6940b626575fee1579 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Remove unused includes of qv8engine_p.hUlf Hermann2019-04-091-1/+0
|/ | | | | Change-Id: Ic135a863581d29a3afb9c6c7f070d2630b3913b4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* V4 debugger: Drop redundantRefs optionUlf Hermann2018-07-181-45/+5
| | | | | | | | No client is using this anymore and we can eliminate a lot of code this way. Change-Id: I454581928fe88e59cd28738c4f7fddd060999181 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devSimon Hausmann2018-06-191-0/+22
|\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/plugins/qmltooling/packetprotocol/qpacketprotocol.cpp src/qml/compiler/qv4codegen.cpp tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp Change-Id: I010505326d76ee728ffe5fbd4c7879f28adadb12
| * V4: Set argumentsCanEscape when debuggingUlf Hermann2018-05-301-0/+22
| | | | | | | | | | | | | | | | | | This causes the updated arguments to be reported to the debugger when they are overwritten in the function body. Task-number: QTBUG-68534 Change-Id: I30c22d31aa97da0d58a4bbaaa032180a919669a8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Cleanup creation code for builtin functionsLars Knoll2018-05-021-2/+1
| | | | | | | | | | | | | | | | Centralize the code in FunctionObject::createBuiltinFunction and setup function names and length properties there. Change-Id: I21f1d42b475070ee091d96d97387149af1dc47f2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add support for proper lexical scopingLars Knoll2018-05-021-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | This is still to some extend work in progress as lexically scoped for loops won't yet do the right thing. let and const variables are still accessible before they are declared, and the global scope doesn't yet have a proper context for lexically declared variables. Change-Id: Ie39f74a8fccdaead437fbf07f9fc228a444c26ed Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Bring JS grammar in line with ES7 specLars Knoll2018-04-251-5/+5
|/ | | | | | | | | | | | | | | | | | | | | | | This basically updates all grammar rules in the qqmljs.g file to be in line with the ES7 specification. Some special handling for the lookahead rules appearing in the spec was needed and is implemented through empty lookahead rules in the grammar, that might push an additional token into the token stream. Renamed some classes in the AST to be in line with the names used in ES7, and removed some other ones (SourceElements) that are no longer used. The ES7 grammar rules contain lots of variations of the base rules (with In/Return/Yield/Default suffixes). With the exception of the In and Default rules, these are implemented through state tracking in the parser and lexer. Change-Id: I4017d97cd050ed816c1dad11833e882cba30801a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Pass "this" object when evaluating debug jobsUlf Hermann2018-03-171-0/+32
| | | | | | | | | We have to explicitly specify the "this" object on QV4::Function::call, otherwise it will assume undefined or the QML global object. Task-number: QTBUG-66942 Change-Id: I1af7742b4fee1b49e9760a413834daf3edb15d74 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-4/+4
| | | | | | | | | | | | | 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>
* Remove double indirection between QJSEngine and QV4::ExecutionEngineUlf Hermann2018-02-021-2/+2
| | | | | | | | As QJSEngine's handle() method is internal, we can redefine it to return a pointer to an ExecutionEngine. That makes many things easier. Change-Id: Ie3df99e0bad5f00ad4fe73182896cd135fa82994 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of BuiltinFunctionLars Knoll2018-01-151-3/+3
| | | | | | | It's now unused. Change-Id: Id2941c212d488c9b0933fa06aac9922b9db13a05 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Set Jump locations for loopsUlf Hermann2017-11-081-6/+5
| | | | | | | | We don't need them for if/else anymore as there are not block terminators anymore. Change-Id: I1ac384e7176cc35faf28028cd274c63dfaa96146 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* V4 debugger: re-enable some more testsUlf Hermann2017-11-081-2/+0
| | | | | | | They were fixed by a combination of previous changes. Change-Id: I9551715ff6f149e69b31204f374263c9f4498ed8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* V4 debugger: Fix tests for function expressionsUlf Hermann2017-11-071-10/+5
| | | | | | | | | On "function f() {...}", "f" ends up inside the function scope now, so if we want to keep it out, we need to phrase that: "var f = function() {...}" Change-Id: I0c7eba96be5c088c341e0455ff8dbca8dd9c52bc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Re-enable Debug instructions and locations for QML functionsUlf Hermann2017-11-061-8/+1
| | | | | | | | | | | | | | | | | | | | | | Debug instructions are used to trigger break points and are added for every source line. We also need to insert Debug instructions before Ret, so that we can step out. We also need to assign line numbers to the entry and return points of "abbreviated" QML functions (by simulating lbrace and rbrace) so that we can set break points on them. The line numbers on Ret need to be negative, so that you cannot (accidentally) set break points on them. A typical signal handler or binding in QML consists of only one line and if you set a break point on that line, you want it to hit only once, when entering the function. If the line numbers on Ret were positive, it would be hit again on exit. Some of the tests in tst_qqmldebugjs implicitly check for that. Also the new interpreter does something on the left brace, so a function actually starts there, not on the first statement. Change-Id: Id9dfb20e35696b420d0950deab988f7cc5197bfc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Re-enable tests/auto/qml/debuggerUlf Hermann2017-10-241-3/+18
| | | | | | | | Enable the tests, make them compile, and QSKIP the ones that don't work for now. Change-Id: Iaa175a8160b219be4054e8b9f7a3edff90f56505 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/new-backendLars Knoll2017-08-221-1/+1
|\ | | | | | | Change-Id: Iff06429f948ac6cdec77a9e5bb8c5375c56fe705
| * Remove hack to make QtC understand that typeof null is "object"Ulf Hermann2017-08-151-1/+1
| | | | | | | | | | | | | | Newer Qt Creators know that. Change-Id: If4d3da5a46b49864a77854fff79e54cef2ea26d6 Reviewed-by: hjk <hjk@qt.io>
* | Remove now unused filesLars Knoll2017-06-301-1/+0
| | | | | | | | | | | | | | | | | | Remove all files from the old compiler pipeline that are now unused. This includes the whole IR, JIT code generation, and the old Moth Isel. Change-Id: I50d06abfbcf0e9755a54ed94638f8bb74f9512b1 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | Various compile fixesLars Knoll2017-06-221-2/+0
|/ | | | | | | | Make sure all libs and tests compile again after the latest changes. Change-Id: I749d3d2d0109cc97df2ecec93809ea8a1b3014a9 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Get rid of the old way of defining builtin functionsLars Knoll2017-05-191-4/+4
| | | | | | | | | | The old calling convention used for builtin functions is very inefficient. It was still being used in a few places. Clean those up and convert them to the new and much more effiecient calling convention. Change-Id: I6b769c6185df7e9be1e80709330fc1ca868576c1 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* V4: Set correct source locations for jumps out of conditionalsv5.9.0-beta1Ulf Hermann2017-03-311-20/+48
| | | | | | | | | | | | | | | | | | | | | We always want to place the jump on the last line of the conditionally executed statement, unless we might never execute the last line. In the latter case, that is if the inner statement is again a conditional, we use some token of the outer condition. This works fine with loops, as the loop condition is actually checked after each iteration, and it's plausible to the user that we jump there. With "if" statements, it's not so great. We cannot really explain why we jump back to the "if" token after executing the conditional statement. However, we have to add some source location to the jump instruction as otherwise it uses the source location of the last statement that had one, which is rather random. Task-number: QTBUG-59204 Task-number: QTBUG-59774 Change-Id: I48e331ce1c1830f236e16b75c9201a2f490d2092 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QV4DebugService: Reduce unnecessary recursion and redundancyUlf Hermann2017-03-141-31/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | Large parts of the protocol are unnecessary. There is no reason to send a separate chunk of "handles" with almost every reply. The refs are given as part of the regular data and if the client wants to find out more, it can do further lookups. Also, it makes no sense to encode the function and script names as objects, as they are in fact not JavaScript objects. Unfortunately these cleanups require some cooperation from the client. Older clients will misbehave if we just drop the redundancy. Therefore, we introduce parameters which the client can explicitly set with the "connect" message. redundantRefs tells the service if redundant references are required, namesAsObjects tells it if script and function names have to be sent as objects/ Once we can require clients that support these options, we can drop the code that generates redundant data. Also, fix tst_qv4debugger::evaluateExpression() to actually check all the expressions evaluated, not only the first and second one. Task-number: QTBUG-42435 Change-Id: If93d2a2b9d0b8035f85dbef871bc1b03f199171d Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Set source location for all loop body-to-front jumpsUlf Hermann2017-03-071-4/+19
| | | | | | | Task-number: QTBUG-59204 Change-Id: Id1a73b228cd3386c7fcc7712c2485f387238b65e Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Add a source location to the final Jump in a for loopUlf Hermann2017-02-281-0/+26
| | | | | | | | | | Otherwise it will assume the last statement as the location of the jump, and that might be a statement that is never hit. Task-number: QTBUG-59204 Change-Id: I66019a284b061358939b23e649ca0832b5442388 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* V4 Debugger: Don't crash when stepping to the end of a scriptUlf Hermann2017-02-281-1/+29
| | | | | | | | The last instruction is a return, which leads to an invalid context. Don't try to save that context, but rather clear the current one. Change-Id: I468b7420c4ca0842209c9b00478f99cc4dc69726 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* V4 Debugger: Add an option to pass additional context for evaluateUlf Hermann2016-12-091-7/+19
| | | | | | | | | | | Interpret the "context" option as an ID for a QObject whose QML context is then injected when evaluating the expression. The QObject needs to be tracked by some other debug service for this to work, e.g. the QML debugger or the inspector. Task-number: QTCREATORBUG-17177 Change-Id: I6a9e8b9ae23e8bb67ed1905a2ef73f7c4faeb990 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* V4: Make ExecutionEngine's debugger and profiler privateUlf Hermann2016-07-281-2/+2
| | | | | | | | This will allow us to #define them away on -no-qml-debug, saving two pointers per engine. Change-Id: I400cffd32cd7f55ff0e68565734b6002b9f901d5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* V4: allow inlining of ExecutionEngine::{qml,js}Engine()Erik Verbruggen2016-05-201-0/+2
| | | | | | | | All other changes are just to be able to include qv8engine_p.h in qv4engine_p.h Change-Id: I71ba2ec42cdc20d5c7d97a74b99b4d1ada1a5ed8 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Clean up QV4DataCollectorUlf Hermann2016-01-211-1/+18
| | | | | | | | | We don't need to pass 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: I9e9f092a10295e3dc970f7b5f440e8f242ea1d54 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* V4 Debugger: Avoid looking up values in debugger threadUlf Hermann2016-01-211-46/+61
| | | | | | | | | | | 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: Id93548dc65133246deac71f73188c715e9dc01e4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-201-17/+12
| | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* V4 Debugger: Move all the jobs into one placeUlf Hermann2016-01-111-0/+1
| | | | | | | | This makes the code more readable and allows us to keep the data collector as value, rather than pointer, in QV4Debugger. Change-Id: I2939c2b2f551111139f1dc34704a6029e87a66bf Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* V4 Debugger: Allow expression evaluation without pausingUlf Hermann2016-01-071-27/+19
| | | | | | | | | | | | | | We can schedule jobs into the GUI thread just fine, even if the debugger is running. They will run in global scope then. The only restriction is that we need exactly one engine to be running in order to do that, as otherwise we cannot decide which engine to use. To avoid interaction with the engine from the debugger thread we move the value lookup functionality into the data collector, and drop the RefHolder. Change-Id: Ifae124d70f42e488ed9a1b6794baef638992ddb1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move V4 debugger and its test into better placesUlf Hermann2015-10-301-0/+729
Now that we have an abstract base class we don't need to carry the V4 debugger in QtQml anymore. The test clearly belongs into the debugger category. Change-Id: I0f71bdb331da8a568e43600363a0468299aa1a87 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>