Commit Graph

393 Commits

Author SHA1 Message Date
Ulf Hermann
428f3f4c22 Debugger: Do a hard shutdown when QML debugger is stopped
There is no point in trying to "gracefully" shutdown by waiting for the
application to hit the next line of JavaScript. The application might
never execute any more JavaScript.

Change-Id: Id531a2b23ce9aa12462e308f29106f8cefa67092
Task-number: QTCREATORBUG-16709
Reviewed-by: hjk <hjk@qt.io>
2016-08-03 15:39:52 +00:00
Ulf Hermann
421a66b101 Debugger: Only clear the locals view when updating the QML locals
There is no reason to clear all the other views, too. The inspector
view stays valid across interruptions and the C++ views have nothing
to do with this at all.

Change-Id: I7a0bfe160a6b3c0134d592abef9c10f95fcfcd3f
Task-number: QTCREATORBUG-16692
Reviewed-by: hjk <hjk@qt.io>
2016-08-02 13:51:55 +00:00
Ulf Hermann
a5b0525b79 QML Debugger: Don't pretend the engine is interrupted when it isn't
After sending the interrupt request the application will continue to
the next line of JavaScript and only interrupt then. There is no way
to interrupt the application via the JS debugger as long as no JS
engine is active.

The downside of this is that the pause/continue/stop icons are disabled
until the application actually interrupts. The user might not
understand this.

Change-Id: I355de52f65898d6bdcd437675adba368662f3c13
Task-number: QTCREATORBUG-16646
Reviewed-by: hjk <hjk@qt.io>
2016-07-27 08:08:12 +00:00
hjk
78a800cb34 Debugger: Use dedicated structure for Qml server parameters
The main idea is to start using ProjectExplorer::Connection later.

Change-Id: Ie91eacdfb0e93ae142fec7ce32bcf554a5282122
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-14 06:25:34 +00:00
hjk
e2ba0aca9b Utils: Introduce a class template TypedTreeItem
For better typesafety on the user side (and optional) for items with uniformly
typed children.  Use it for UniformTreeModels, and consequently WatchModel
to get rid of some of the static_casts there.

Change-Id: Ic20e507036e180c24997b236230f0f71b285202c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-06-10 06:56:55 +00:00
hjk
726b907cc3 Debugger: Remove debuggerstringutils.h
With QT_RESTRICTED_CAST_FROM_ASCII making GdbMi etc operate on
QString is feasible again. Take this as opportunity to move
debugger encoding handling closer to a 'conversion on input and
output if needed, storage in QString only' scheme.

Change-Id: I2f10c9fa8a6c62c44f4e6682efe3769e9fba30f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-09 08:09:46 +00:00
Eike Ziller
0c5bae640b Merge remote-tracking branch 'origin/4.0'
Change-Id: I80bc3371c6d7cf9f2d46cbcf8e79e4761213d8aa
2016-05-27 12:01:36 +02:00
Ulf Hermann
e6e2c1771b Debugger: Restore expression evaluation through QML inspector
You can now interact with QML objects selected with the "select" tool
again, when unpausedEvaluate is off.

Change-Id: If6b4a55193a8949b2e3048fe78443c5df6710885
Task-number: QTCREATORBUG-16300
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-05-23 14:40:20 +00:00
Jonathan Liu
52b34611dd Debugger: Remove unreferenced QString arg
Change-Id: I6c7fd01d6bc8cee526fe1f566f9fae551246af80
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-05-19 08:15:19 +00:00
hjk
60f092f6bb Debugger: Cosmetics
Qt 5 connects, unused declaration, QLatin1Strings, ...

Change-Id: If09929993d750907ee3f4e2fa9f18acfcc28d9c1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-12 15:08:16 +00:00
Ulf Hermann
385237dbbd Use Utils::Port where possible
This solves the ambiguity between 0 and -1 being the "invalid" port.

Change-Id: I3bac11dd4117bb1820fbd58186699925b73df1c5
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-20 11:06:34 +00:00
hjk
12788ffb2d Debugger: Avoid looking up references too often
Multiple copies of lookup requests may accumulate when stepping
too quickly, outsmarting the 'all updates done' logic, keeping
Locals&Expressions in the grey 'update ongoing' state.

Change-Id: Icec24ce1af8d273c3439ee91800ed1f4381ee19a
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
(cherry picked from commit c1de315d6c)
2016-04-15 14:24:35 +00:00
Eike Ziller
8a77eacf8d Merge remote-tracking branch 'origin/4.0'
Change-Id: Ied609608f6b12aa923c67777bc5a273c4d8fbcbb
2016-04-15 10:07:55 +02:00
hjk
7080645d20 Debugger: Clean pending lookup requests when preparing a step
This avoids accumulating lookup requests when stepping quickly.
They won't produce usable output anymore.

Change-Id: I9e29ca1778019e3eab37d122386d3faf0e07edbf
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-15 06:45:05 +00:00
hjk
a28f73971a Debugger: Keep 'this' expanded while stepping
Change-Id: Ib72a10e5dbf54c7586254ed513718631e5289b37
Task-number: QTCREATORBUG-15747
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-14 14:13:06 +00:00
hjk
8679a7caa6 Debugger: Remove 'Context' label in debugger console
This was display only, with no impact on the console operation.

Change-Id: I1c6cab13a86b574d3912ea7fca2e0f14147b828c
Task-number: QTCREATORBUG-15831
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-04-13 14:33:37 +00:00
hjk
c1de315d6c Debugger: Avoid looking up references too often
Change-Id: Icec24ce1af8d273c3439ee91800ed1f4381ee19a
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-04-13 13:54:00 +00:00
hjk
6a10db9a43 Debugger: Initialize QmlV8ObjectData::id
Change-Id: I73ce601e4d74ef662f7789080ed1579802a668f7
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-04-13 13:10:06 +00:00
Ulf Hermann
075a8dc831 Qml Debugger: Eliminate client state callback
The sender()/qobject_cast construct is ugly, unnecessary and it doesn't
work if the method is called directly, rather than through a signal.

Change-Id: I0ac09ad04b956fb4cac38a89162a9dc0055d1831
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-13 10:31:40 +00:00
hjk
13ea128102 Debugger: Adjust error message for Qml Debugger Console
Displaying live contents uses nowadays a feature of Qt 5.7. The previous
display was not using the correct context. For Qt < 5.7, access is now
only possible when the context is clear (e.g. because a breakpoint
was hit). This patch adjusts the error message in the other case.

Task-number: QTCREATORBUG-15831
Change-Id: Ic25a3f6bca05523b16063f3e7daed6817c0002e7
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
2016-03-16 09:10:42 +00:00
hjk
2cf0060596 Debugger: Use StandardRunnable in DebuggerStartParameters
This is a mechanical replacement for the former executable, processArgs,
inferiorEnvironment and workingDirectory members.

Change-Id: I4160e01427ed801df9b729f1f31d0a2ca48159b5
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-28 14:15:54 +00:00
hjk
d5ecd4cf8b ProjectExplorer: Use StandardRunnable in ApplicationLauncher
Change-Id: I7092d748207762d3dbd6c69c01cc06c88cbf63d8
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-28 11:35:51 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Ulf Hermann
1d7243e724 Qml Debugger: Support "evaluate" while engine is running
Newer versions of Qt can evaluate expressions without pausing the
QML engine. We can take advantage of that. At the same time we can
remove the crutch of using QQmlEngineDebugService for this. The
latter produces inconsistent and generally worse results than the V4
debug service.

Task-number: QTCREATORBUG-14931
Change-Id: Ic78d08a0b00cf7de3911b7b672ce229c6d779363
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-01-08 09:29:41 +00:00
hjk
b769156c19 Debugger: Mark pending C++ breakpoints with hour glass icon
Change-Id: If012953f8fb1e2705244ffe9f02c6bbbbc9d93c1
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-06 14:06:43 +00:00
hjk
7de7eb6bca Debugger: Work on WatchModel performance
Don't instantiate repeating boilerplate item data in some
cases (such as large arrays).

This makes it necessary to access parent WatchItems in
a lot more cases than before and needs another separation of
WatchItem/WatchModel code to keep the dumper autotests
in a functional state.

For a plain std::vector<int> with 1 mio items this reduces
 extraction time from more than 2 minutes to about 3 seconds.

Change-Id: I175c5f6ee90434a6e85342d8bb71bd10a04dd271
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-01-06 09:59:11 +00:00
hjk
8e702387e5 Debugger: Start separating different process environments
Debugger and stub run locally, the debugged process not necessarily.

Change-Id: Ibf6aec3dcaec60069866ec0765ec2178ca0a26d6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-04 12:33:47 +00:00
hjk
33651877d8 Move QmlConsole to Debugger
Now it is closer to its only user and possibly reusable for no-QML uses
there.  We also drop the QML/JS syntax checker. The application being
debugged can already tell us about syntax errors. There is no need to
duplicate that functionality.

Change-Id: I2ba151f9f4c854c6119ba5462c21be40bddcebf9
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-12-09 12:06:26 +00:00
Ulf Hermann
e4594eec13 Debugger: Log connection failures to QML/JS console
The debugger log is not very accessible and people may want to see this
message.

Change-Id: Id5e5a6d84f3576df3756d1fabc9f5801dcebac6e
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-12-09 10:32:59 +00:00
Ulf Hermann
a8aa527500 Debugger: Don't manually break the connection error message
The message window can do that by itself and in other places we may
want to print the whole message in one line.

Change-Id: I5f0891c7b81717182d17b83f5a62ab06ad168801
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-12-07 14:55:50 +00:00
Oswald Buddenhagen
100ea30a1a Merge remote-tracking branch 'origin/3.6'
Conflicts:
	src/plugins/projectexplorer/toolchainmanager.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp

Change-Id: Id736c6922670c921c689219cb817b1541eaaf304
2015-12-02 18:42:05 +01:00
Ulf Hermann
b9adbffe6f Debugger: Proactively try to connect to QML port in mixed engine
Just like with the QML-only engine we might not get the output for a
variety of reasons. As we've specified the port on the command line,
it's likely that the application will start listening at some point,
though.

Change-Id: Ifda69ba15c659cf95e708d35bed34cfb9b3c40ec
Task-number: QTCREATORBUG-15409
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-30 08:58:02 +00:00
Ulf Hermann
81eea72d44 QmlDebug: Simplify error and state signaling
There is no point in sending two signals for every state change and
error. Also, the signals only reflect events in the socket, not in the
logical connection.

Change-Id: I617a925c69164aa1a02a7781b9da7dca55daa304
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-19 11:32:46 +00:00
Ulf Hermann
47317eff60 QmlDebug: Rename some members of QmlDebugConnection
This is to adopt the naming to the code in src/qmldebug in
qtdeclarative. Once we can require a version of Qt that has qmldebug
for building QtCreator we can then remove our own version of this code.

Change-Id: I573f0703871b5812789c5c7a6287567d5c2875e6
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-19 11:32:42 +00:00
Ulf Hermann
a3e4a28bee QmlDebug: Unify QPacket and QmlDebugStream and remove unused code
There is no point in having both as they serve the same purpose. Also,
most of the packet protocol API was never used or tested, and wrapping
each byte to be sent into a QPacket is wasteful and unnecessary.

Change-Id: Ia421eae33b644fe86a53bcd04092a84ea3000f0d
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-19 11:32:39 +00:00
hjk
2b16b97f19 Debugger: Make DebuggerEngine::runCommand() virtual.
Allows default implementation of e.g. stack retrieval in the base
class.

Change-Id: I96460b19aa31347b2c863736b4ce2b5046eb4de6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-11-04 11:48:05 +00:00
hjk
525c33f999 Debugger: Infrastructure for reworked native mixed debugging
- Remove old experimental native mixed approach.
- Move some common stack parsing to Stackhandler.
- Mark gdbbridge.py debug output explicitly to remove it
  from actual reponse handling

New native mixed needs QtDeclarative changes and
QTC_DEBUGGER_NATIVE_MIXED=1 for now.

Change-Id: I09eed1da51cea878636d36756015b7bfaed34203
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-09 05:19:45 +00:00
Jean Gressmann
378cd56d75 Permit the use of the QML debugger on non JS/QML files
Change-Id: I1574f553c937bd4759b20ca5f0d22582087800cb
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-09-23 11:54:20 +00:00
hjk
e298500379 Debugger: Remove remains of QmlEngine live update feature
Change-Id: Iaa77f9d9af103046841637862b8aacdc6b0342c7
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-09-18 13:04:52 +00:00
hjk
eb4d98e178 Debugger: Remove virtual layer of sendMessage() calls in QmlEngine
Change-Id: I7a5f335e8401d01bb3085b9512a878b67109feae
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-09-17 11:26:15 +00:00
Ulf Hermann
d5707e0e32 Debugger: Use Qt's JSON encoder for debugger protocol
The V4 debug service expects correct JSON as input and gdb, lldb, and
pdb expect Python object literals. There is a subset of JSON that is
also valid as Python object literals and we use that for the protocol
spoken with gdb, lldb, and pdb. The strings passed to CDB are tunneled
through JSON strings and converted to byte arrays before sending them.

Change-Id: I87319b5450e5c3c3b29c565b75cddaa612767611
Task-number: QTCREATORBUG-14931
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-09-15 08:28:14 +00:00
hjk
7d3bb6fdee Debugger: Remove some unneeded calls to resetLocation()
Since resetLocation() is called when the repective actions are
triggered immediately before the engine's executeFoo() are called
there is no need to call them in executeFoo() again.

Also, remove the unused autoContinueInferior(); function.

Change-Id: I8d2ec419c0da6efa388ce1ed317f31d24654897f
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-09-15 06:00:25 +00:00
hjk
156320ff6c Debugger: Merge QmlInspectorAdapter into QmlInspectorAgent
There's a 1:1 relation, and the abstraction is not needed anymore.

Also remove some unused code.

Change-Id: I09a2522deb5d522f46ec7518d19978a038032fbb
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-08-28 07:37:19 +00:00
Ulf Hermann
b5717a5315 QmlJS: Lazy-load console items to allow for recursion
Using Utils:TreeView automatically gives us the capability for loading
item as they are expanded. This way we can show recursive structure in
the console as well as load data from the debug server on demand.

Also, properly print error messages received from unsuccessful
command evaluations.

Task-number: QTCREATORBUG-14931
Change-Id: I66d440eedd9723b04670169b27db1ee18f3f2891
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-08-25 14:42:22 +00:00
Eike Ziller
8eaaef96aa Merge remote-tracking branch 'origin/3.5'
Change-Id: I65968dd02ea6bdd15f304ae567dd0c02238e6949
2015-08-20 13:23:13 +02:00
Ulf Hermann
3fbf54df83 Debugger: Properly handle JavaScript null
null is an object in JavaScript. This is slightly insane, but hiding
it in the debugger view doesn't help.

Change-Id: I69fe317f28a515785720104f92306f69a2e56266
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-08-20 10:23:53 +00:00
hjk
63d182f052 Debugger: Fix retrieval of Locals Views subitems in QML debugger
Previously, only the first level of properties was expanded,
properties of object type could not be expanded further.

This can be reproduced by opening the SameGame example,
putting and triggering a breakpoint at startNewGame(),
expanding the 'this' entry in the Locals view and checking
the 'component' subentry.

Change-Id: I6cf714af697ab4eebd7eb0ae0ea37e516b3ea635
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-08-14 10:30:08 +00:00
Sergey Belyashov
007daabff5 Fix i18n problems
In the QmlEngine, a few tr() have been replaced by
QCoreApplication::translate().
In other files, Q_OBJECT has been added to the class definitions.

Change-Id: Ia0505c19934dc691cd3d67f4946293290c2fec68
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-07-23 19:19:06 +00:00
hjk
ff63fd113a Debugger: Quote strings in QmlEngine
Task-number: QTCREATORBUG-5670
Change-Id: I1cfad65042369d9e34c19dc4a7f00a37dbe6fed4
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-21 06:41:28 +00:00
hjk
38d2baa2dd Debugger: Ask JS debug server to evaluate(something) only when stopped
The server on the Qt side Q_ASSERTs otherwise, killing the application.

Change-Id: I273f12c4bc89bd3488fa6409fdbebc6a6ac2b606
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-07-17 12:41:57 +00:00