Commit Graph

447 Commits

Author SHA1 Message Date
hjk
d47fdb934d Debugger: Change semantics of DebuggerEngine::masterEngine()
Make it return 'this' if 'this' is the master engine itself.
Adapt users.

Also do not let the QmlEngine try to beginConnection() when
the combined engine was isDying() already.

Change-Id: I308deae14a3c4966be381f321c0d9dfaf82c40d6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-12-15 11:50:01 +00:00
hjk
83c13ff191 Debugger: Combine the InferiorShutdown{Ok,Failed} states
... into a InferiorShutdownFinished.

Change-Id: Icb5394f38f52f7cf300dc83f4eb8f2f0777bbcba
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-14 11:26:52 +00:00
hjk
585b2c62d5 Debugger: Combine the EngineShutdown{Ok,Failed} states
... into a EngineShutdownFinished. They were never handled differently,
and the only option is to proceed to DebuggerFinished anyway. So
simplify the state machine a bit.

Change-Id: Ied3be86fff6750abca578dc6788e4be1d895692b
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-14 09:42:44 +00:00
hjk
8f1a161c64 Debugger: Merge EngineSetup and InferiorSetup start phases
It was needed in the past to trigger e.g. gdbserver setup in
remote cases which is nowadays handled by separate RunWorkers.

Change-Id: I30bce071dab0779cce2e7abef7b31550d8539461
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-06 13:30:04 +00:00
Eike Ziller
b05637131c Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp

Change-Id: I726babe61e28db14d06a6a1a5c570e148745b458
2017-11-09 14:32:00 +01:00
hjk
45f73d8729 Debugger: Squash some (wrong) transition warnings on QmlEngine shutdown
Change-Id: I70d735d45012944b55476214c88a27abfd97612a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-08 13:00:54 +00:00
hjk
78513ecd8f Debugger: Split Expressions view into dock of its own
Change-Id: Ie86a5bd72c3140219f925835a065d9f6a3ae0ea4
Task-number: QTCREATORBUG-19167
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-06 11:53:57 +00:00
Orgad Shaneh
371b2bbbab Merge remote-tracking branch 'origin/4.5' into master
Change-Id: Ibcdd1230b40d1ca7a414843ee0f9ae4cddb29f6f
2017-10-17 20:00:44 +03:00
hjk
f3b886c4c1 Debugger: Make some error message translatable
Change-Id: I4573c26df5d41d6fdab4ddeb1d70ee5d2bc10c11
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-10-17 12:28:32 +00:00
Ulf Hermann
eeb0358d65 Debugger: Re-add quotes to JS strings after editing
The quotes are stripped when the string is presented for editing, so
they have to be added back when we're done editing.

This is what we already did if we were talking to the inspector rather
than the V4 debugger.

In order for this to work, JS numbers need to be identified as numbers,
rather than strings. So, we have to add "number" to the types recognized
as float.

Change-Id: I2054f4ad36ec1d14fb2dfee3705a80c8ec84d5ac
Task-number: QTCREATORBUG-19032
Reviewed-by: hjk <hjk@qt.io>
2017-10-17 09:47:51 +00:00
Orgad Shaneh
7a04014f9f Merge remote-tracking branch 'origin/4.5'
Change-Id: I2d78020f10aa66fdded63883030313e0c411ce02
2017-10-15 00:23:08 +03:00
hjk
cc7754920c Debugger: Simplify use of DebuggerEnginePrivate members
Each engine has now the RunTool pointer, not just the master.

Change-Id: I6bab026998d5da5da82224bfaf4a93d3cfb3a898
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-13 12:35:43 +00:00
Eike Ziller
07bec99e8f Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/gcctoolchain.cpp

Change-Id: Iaad0659293681cce4266fc3e4ba2a4f2068de911
2017-10-09 12:09:27 +02:00
Ulf Hermann
2f9d82791e QmlDebug: Move QmlDebugConnection into own file
Change-Id: I761658de7c19754cfaadf8cbbad7596a9bcdfbf3
Reviewed-by: hjk <hjk@qt.io>
2017-10-04 16:17:48 +00:00
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