Commit Graph

533 Commits

Author SHA1 Message Date
hjk
9f3e104e37 Debugger: Simplify QmlEngine construction
Change-Id: Id237998cf2d9a03f9c2929043fdb45ac49d4addb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-04 08:54:10 +00:00
hjk
7eec0f63ac Debugger: Merge DebuggerStartParameter into *RunParameters
The users (typically target specific DebuggerRunTool derived classes)
are meant to use the individual setter functions nowadays, not the set
up the full structure, so the members are a true implementation
detail now.

Change-Id: Ida04801e3230a2fe8bbadde8845e58c3077c87a5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-13 14:00:59 +00:00
Ulf Hermann
11b8b6591c Qml Debugger: Add missing override
Change-Id: Icc704ee9539030f747b29e6285ab4f37b3b1763a
Reviewed-by: hjk <hjk@qt.io>
2017-09-07 13:28:59 +00:00
Ulf Hermann
1634987cae QmlDebug: Don't use QmlDebugConnection unconditionally
It might be null. We wrap the retrieval of the data stream version in
QmlDebugClient and return the minimum if connection is null. The extra
copy of the connection QmlEngine is dropped as QmlDebugClient already
has one and we don't want to hit a dangling pointer.

Change-Id: Ida8c45d357d46b4942eea99b77065d3c51c7edb9
Reviewed-by: hjk <hjk@qt.io>
2017-09-07 13:28:52 +00:00
Tobias Hunger
4ef01c961e app_version.h: Make IDE name configurable
Change-Id: I993f452c8d09cf89e9a2958fc8e36b7d2c17ee6f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-05 10:19:48 +00:00
hjk
c128731ff2 Debugger: Use a QUrl for Qml server port and host
Host and port reasonably belong together, using a QUrl makes that more
explicit and follows the lead of the Qml profiler in that area.

Change-Id: I754cb17d165ce6b2f25c655eeebfd8ac8f5a93c7
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-08-23 09:13:40 +00:00
hjk
c6ff65fd65 Debugger: Don't wait for app output for Qml debugger port retrieval
We know the port in advance nowadays.

Change-Id: Iacd6f2c8ef04665606a77625be77744a358bb560
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-08-18 09:38:58 +00:00
Vikas Pachdha
cdffb378fd Android: Fix QML debugging
Specify the qml server address and use correct default loop back
address in qmlengine

Change-Id: I9b77cb3385041bbe79900e7f7a188ca26124bacc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-08-15 14:40:25 +00:00
hjk
528b0918bf ProjectExplorer: Remove RunControl::bringApplicationToForeground
... and replace it by direct uses of ProcessHandle::activate().

Change-Id: I7beffba7bfbeff72a81b8699ff54a311a74ce1a3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-17 14:00:49 +00:00
Christian Kandeler
be2b3c91ae Add Q_FALLTHROUGH for Qt < 5.8
... and make use of it.
With gcc 7, the new option -Wimplicit-fallthrough is introduced and
added to the -Wextra set, triggering dozens of warnings in our sources.
Therefore, we annotate all obviously intended fall-throughs. The ones
that are still left are unclear and need to be checked by the respective
maintainer.

Change-Id: I44ead33cd42a4b41c28ee5fcb5a31db272710bbc
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-07-17 07:51:23 +00:00
hjk
ffc97df7a6 Debugger: Remove remote setup sub-statemachinery
Not needed anymore in the world of RunWorkers.

Change-Id: Id7fb24fece6acb03de12f2677dd99a05c513e7a4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-06-22 12:28:08 +00:00
hjk
a37c8add58 Debugger: Fix QmlInspector state update connection
Change-Id: I1693d593ec08c14c48b2c2800ce2f240f9e5f438
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-19 13:07:01 +00:00
hjk
1f6764a54e Debugger: Move run parameters from engine to tool runner
The parameters belong to the run control, they should not
be triplicated in case of a combined engine.

Change-Id: I4dd84220edbd7a44b902cc52627fe01d0568db75
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-18 07:05:09 +00:00
hjk
5d8d3fbdc7 ProjectExplorer: Extend centralized state handling
Add some customization hooks to make tools aware of target errors
and vice versa.

Change-Id: I4d815087297a3fa1d1d6d52daeed7c4ae0f624bf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-03 11:48:23 +00:00
hjk
e213585910 Debugger: Move part of engine startup to preparation phase
Change-Id: I414c356cd615096ee68588b839aaf975657fb7f9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-05-02 08:49:58 +00:00
hjk
6e990f96c6 Debugger: Remove DebuggerRunControl
Use plain RunControl + DebuggerRunTool combo instead.

Change-Id: Ib71b5eab50da667b9d71dcc6689d2643ad8ecdee
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-28 12:42:29 +00:00
hjk
d049a5be19 Debugger: Base magic Qml connection discover on base run control signal
Less debugger specific code and less convoluted paths in debugger
message handling.

Change-Id: Ib298889c386d65f17acbdfc585188097bb20ed74
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-20 14:57:57 +00:00
Ulf Hermann
f51d554bd1 Qml Debugger: Properly handle JavaScript null
The QML engine might (in the future) actually send the right message
to indicate a JavaScript null, that is:

{ type: "object", value: null }

This piece of JSON is then transformed into a QVariantMap. The QVariant
that signifies the null is unfortunately different across various Qt
versions. We can, however, detect it.

Change-Id: I3db42bb35a936bc02c749ab3a136b1d297aefdfe
Reviewed-by: hjk <hjk@qt.io>
2017-03-21 13:35:03 +00:00
Ulf Hermann
388086211a Qml Debugger: Show fewer messages in the status bar
The QmlDebugConnection can be quite spammy as it repeatedly tries to
connect to the application. Show error messages from this process in the
debugger log and only output a line in the status bar if the connection
is considered to have permanently failed.

Change-Id: I4a5715d9acdac47f690cb8aa67adb5cccff76e11
Task-number: QTCREATORBUG-17492
Reviewed-by: hjk <hjk@qt.io>
2017-03-16 16:03:46 +00:00
Ulf Hermann
7236f2124a Qml Debugger: Set detailed options rather than "sanity"
The v4 debug service doesn't understand "sanity" after all, but wants
to know the features we support. So state that we don't need redundant
references and that we understand names when sent as strings.

Change-Id: Ie973dd8002935a113a367d098337983d61663265
Reviewed-by: hjk <hjk@qt.io>
2017-03-15 13:10:32 +00:00
Ulf Hermann
f087f36269 Qml Debugger: Raise sanity level to 1
This signals that we understand packages without extra "handles",
that we can deal with only one level of nesting on replies to lookups
and expression evaluations, and that we can understand script and
function names transmitted as plain strings rather than refs.

Change-Id: Iffdd50179b8f9374e2fc8ad3a03cf44fbc627bf1
Task-number: QTBUG-42435
Reviewed-by: hjk <hjk@qt.io>
2017-03-13 13:58:32 +00:00
Ulf Hermann
fed805d568 QmlDebugger: Limit recursive property lookups
The QML engine will send the number of children in an object as the
"value" property together with the ref. We can use that to determine
if an object has children without actually fetching it.

Also, always save the type of a ref, even if we don't know the value
yet. This avoids redundant lookups.

Task-number: QTBUG-42435
Change-Id: Ia423b661187dc054fb5782349d1256711ee11265
Reviewed-by: hjk <hjk@qt.io>
2017-03-13 13:53:53 +00:00
Ulf Hermann
cb63af70bc QmlDebugger: Allow functions and scripts to be specified as strings
For some of those it doesn't make much sense to assign a ref and the
refs are not stable anyway.

Change-Id: I7b6855225f883b93930b8d501495ef9dd62be7a2
Reviewed-by: hjk <hjk@qt.io>
2017-03-13 08:46:55 +00:00
Eike Ziller
69276d81c5 Merge remote-tracking branch 'origin/4.3'
Change-Id: I55bec11cc6638a7d71020ced7f686e1610e4d9d5
2017-03-09 12:43:23 +01:00
Eike Ziller
cec29f34ea Merge remote-tracking branch 'origin/4.2' into 4.3
Conflicts:
	doc/src/qtcreator.qdoc
	tests/system/suite_general/suite.conf

Change-Id: Ia298b177d6920a1d853e342b62cf98f7c48a278a
2017-03-09 12:14:55 +01:00
hjk
b7412814ab ProjectExplorer: Switch responsibilities for raising applications
Instead of letting the launcher decide to raise something when
started (and only then) leave it to the RunControl to trigger
(and for now also to implement) as response to the application
launcher start (or possibly now, in other circumstances).

Change-Id: I0ac8f1e633981f7bf316c88e83c208765886d9a1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-08 16:12:13 +00:00
Vikas Pachdha
13492fea66 Android: Fix app waiting for qml engine connection
android app in mixed mode debugging sometimes keeps waiting for the
qml engine connection.

Task-number: QTCREATORBUG-17718
Change-Id: Iee87cd0a6d67babaf08e62a6e106ec22fda430cd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-03-02 15:52:15 +00:00
hjk
d74afaa0ed Debugger: Fix Locals windows column width adjustment
Task-number: QTCREATORBUG-17756
Change-Id: I44f97386ab5018b60832f76f5856425bc55096d9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-21 07:50:25 +00:00
Ulf Hermann
7a432a68c1 QmlDebugger: Always show a sensible context for the console
If the engine is running and no specific context is selected, then it's
the global QML context. The same holds if the engine is running, but
the server doesn't support contextual evaluation. If the engine is
stopped, then it's a frame in the stack trace. Otherwise we don't have
a context and clear the label.

Change-Id: I5a322098f3297895e07bcc96ee4a5f351423c206
Reviewed-by: hjk <hjk@qt.io>
2017-01-19 15:30:23 +00:00
Ulf Hermann
43dbed9919 Revert "Debugger: Remove 'Context' label in debugger console"
As we can have a context again now, we should be able to show it.

This reverts commit 8679a7caa6.

Task-number: QTCREATORBUG-17177
Change-Id: I221628dc91af839be867cc1bf8dfe5d5163fd321
Reviewed-by: hjk <hjk@qt.io>
2016-12-13 13:15:18 +00:00
Ulf Hermann
b9a8bed037 QmlDebugger: Pass selected watch item as context to V4 debugger
Newer V4 debug servers will accept a "context" parameter which
specifies the ID of an object which is then used to look up a QML
context to inject when evaluating expressions.

Change-Id: I9d2a2226559380550308cacfe559e079291c14b5
Task-number: QTCREATORBUG-17177
Reviewed-by: hjk <hjk@qt.io>
2016-12-09 11:55:54 +00:00
Tobias Hunger
63b80ee080 QmlEngine: Do not leak items
Change-Id: Ib06b4fbd44c9c0fd87ae9f719563d1533334af77
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-11-29 15:40:55 +00:00
Ulf Hermann
d771ba8921 Debugger: Don't clear unrelated views when updating locals
If the list of partial expressions is empty we need to tell the watch
handler that we are only updating the locals view, not e.g. the
inspector view.

Change-Id: Iedc74ffc66a8435faa272d053849b831f6b8cbbe
Task-number: QTCREATORBUG-16692
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-11-04 09:35:10 +00:00
Ulf Hermann
fc80a5afb4 Debugger: Implement QmlEngine::doUpdateLocals
This allows us to sort the locals by name immediately when the action
is triggered.

Task-number: QTCREATORBUG-16645
Change-Id: Ifd24f49e66523af5e988065c9a33aae00e7fb290
Reviewed-by: hjk <hjk@qt.io>
2016-11-03 15:38:07 +00:00
Eike Ziller
5b47c653c1 Merge remote-tracking branch 'origin/4.1' into 4.2
Change-Id: Ibe4cd5522e1d87d56d2aae7a429282b41bf18647
2016-10-12 16:02:47 +02:00
hjk
1d8b900720 Debugger: Avoid one round of lookups in QmlEngine
Will be triggered in handleScope()/insertSubItems() anyway.

Change-Id: Id5e236c231558c819398b38a13fb06def9ae39a6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-10-11 13:57:23 +00:00
hjk
3b8087a85c Debugger: Keep expansion state when stepping in QML
Change-Id: I88c87c040fe276a4436d398ba777b98b6732f37a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-10-10 13:53:33 +00:00
Orgad Shaneh
1853f01a5b Merge remote-tracking branch 'origin/4.1'
Change-Id: Ia442f30f387fe9292217582260bbe79e54608810
2016-08-05 11:40:07 +02:00
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
Orgad Shaneh
35d7352b3e Merge remote-tracking branch 'origin/4.1'
Change-Id: Ie96fa53a88bcd06fa688a579c1d84aaf6f5e905f
2016-07-29 16:13:18 +03: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
Ulf Hermann
ba9825625d QmlDebug: Decouple log messages from connection failures
A socket error is not the only possible reason for a connection failure
and exposing socket error codes to the upper layers is unnecessary.

Change-Id: I27e9f21160ecea5b0d811b83b7ab0ab9071cacff
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-07-18 12:01: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