Commit Graph

453 Commits

Author SHA1 Message Date
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
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