Commit Graph

848 Commits

Author SHA1 Message Date
Ulf Hermann
ba94e9eb01 QML Debugger: Do fetch engine properties
The properties of the engines themselves are interesting. However, in
order to properly display the engines, we need to always update the root
context for an engine after we update its properties. This is a good
idea anyway because there might be a reference to the engine somewhere
else in the object tree, and accidentally updating the engine would
clear its root context.

Change-Id: If905f4c32ba37106b5620b5af0e157e19ef8b295
Reviewed-by: hjk <hjk@qt.io>
2018-11-22 14:02:11 +00:00
Ulf Hermann
0eca4bce72 QML Debugger: Fix object hierarchy
Make sure to always find the correct parent and engine IDs for objects
to be inserted, and that root objects are always added as children of
their engines. As the root objects don't show up in the engine's
children(), but we adjust the root objects' parent IDs to point to the
engines, the root objects were sometimes shown as children of the
engines, and sometimes as top level root objects.

Furthermore, make sure not to fetch any parents of engines. Otherwise we
get a much more complicated object hierarchy than what we actually want
to see, and the invariant that each engine is at the root of the tree
breaks.

Change-Id: I6967f0b369149a8d6db3ab89f1479c942f6fcbf7
Reviewed-by: hjk <hjk@qt.io>
2018-11-22 14:01:46 +00:00
Marco Benelli
4646acad0d qmljs: update parser
Update the qtcreator qmljs parser to the
one of Qt 5.12. It supports EcmaScript 7.

Task-number: QTCREATORBUG-20341
Change-Id: I0d1cff71402ba17e22cde6b46c65614e162280de
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2018-11-22 11:21:32 +00:00
Ulf Hermann
eac0ab4974 Debugger: Add multi-engine support for QML inspector
The engines are listed as virtual root items for their contents. This
way, when we need an engineID we can walk up the tree of watch items and
the last valid one will be the engine.

Fixes: QTCREATORBUG-21486
Change-Id: Ib110457dc65523c1e2b75aa073f6cd399bbc9532
Reviewed-by: hjk <hjk@qt.io>
2018-11-21 10:48:02 +00:00
Ulf Hermann
2e6aa7a0ed QML Inspector: Use lists of int as selections
The inspector service natively supports multi-selection. Instead of
converting between multi and single selection all the time, just use the
multi selections and only collapse to one row when interacting with the
view.

Change-Id: Ie969225f955c61b306cfbec4973ffc724ef1e224
Reviewed-by: hjk <hjk@qt.io>
2018-11-20 14:05:08 +00:00
Ulf Hermann
d29e7a0371 QML Inspector: Simplify
Since we don't need to support the Qt Quick 1 clients anymore, we can
drop some code.

Change-Id: I7afcad8024392f058a35b3ed0d28d2172587552a
Reviewed-by: hjk <hjk@qt.io>
2018-11-20 14:05:02 +00:00
Ulf Hermann
40ad7ec995 QmlDebug: Remove outdated clients
The declarative* clients are only used with Qt Quick 1. We don't need
them anymore.

Change-Id: I102fe93b3acd4b23cc01aff5eb9f12540625fe5e
Reviewed-by: hjk <hjk@qt.io>
2018-11-19 08:27:25 +00:00
Eike Ziller
95db30bd3a Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/debugger/debuggeritem.cpp
	tests/unit/unittest/unittest.pro

Change-Id: Id2e4e9c2bc87b2556d7c2845aea3fe2fa11b630b
2018-10-22 09:53:54 +02:00
hjk
fa96f73192 Debugger: Rework step{In,Out,Over} handling
Main menu action pass operation to current engine, everything else
is handled there.

Combine execute{Step,Next} and execute{Step,Next}I functions.
Implementation were mostly similar, in some cases unneeded
(the instruction-wise version e.g. for Python)

Drop GDB-isms 'step', 'next' in favor of 'step in' and 'step over'.

Change-Id: I232232bc7a67d9d297a74f1c81dc43be96787d34
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-16 10:34:31 +00:00
Eike Ziller
511bd64f3f Merge remote-tracking branch 'origin/4.8'
Change-Id: I0ff6f659b7ccd4ff5a79e422a1d54488508fe05f
2018-10-16 07:11:57 +02:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +00:00
Orgad Shaneh
147a3c27c4 Debugger: Strip QLatin1* where possible
Change-Id: Idcab23875b5dc2ecf55e3303f417b995e2252720
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:32:31 +00:00
Ulf Hermann
6a19eebfc2 QML Debugger: Make sure to claim break points before CONNECT
Otherwise we have a race condition. The breakpoints may be hit before
they are set.

Change-Id: Iccdd64758b150acdfadc18cba88abdf841feb6c7
Fixes: QTCREATORBUG-21253
Reviewed-by: hjk <hjk@qt.io>
2018-10-11 14:42:34 +00:00
Christian Stenger
1b751c2d47 Debugger: Allow watching complex expression for QML
Latest restructuring made the 'Add Expression Evaluator'
action to a no-op when not debugging.
Reflect this by disabling the action as long the user is
not debugging and allow complex expressions to be evaluated
for QML as well.

Fixes: QTCREATORBUG-19050
Change-Id: I2d6421a121e2169981b992a617f4d2b7264a8091
Reviewed-by: hjk <hjk@qt.io>
2018-09-24 13:37:12 +00:00
hjk
bdc1ea1d74 Debugger: Do not remember persistent layout settings per engine
Fixes: QTCREATORBUG-21006
Change-Id: Id3c2062eb5b42808d666f0fc3620a82666fe14a2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-11 08:48:31 +00:00
hjk
9f9c72302f Debugger: Streamline ThreadHandler
- Use the TreeItem/data pattern recently introduced with Breakpoints
  to remove the need of keeping track of id/object mapping. Opens
  possibility to have thread groups as intermediate level.
- Use the ThreadHandler directly as model for the thread combobox
  to remove the need of manual combo box updates.
- Move setting current thread from individual engines to central code.

Change-Id: I030e21a4aa5ab30b0efbc84528d9cecf29cbbe30
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-21 07:25:57 +00:00
hjk
3b5ecac238 Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.

The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.

Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.

Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.

The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.

There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.

The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.

There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.

Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-08-17 12:35:15 +00:00
Ulf Hermann
59175ac423 Merge "Merge remote-tracking branch 'origin/4.7'" 2018-07-25 13:36:52 +00:00
Alessandro Portale
0558db7b54 Debugger: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default

Change-Id: I91a6874f0d7b94e9079ab4ef07c23c60c80be9c0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-25 12:52:43 +00:00
Ulf Hermann
5b8989d017 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/debugger/qml/qmlengine.cpp

Change-Id: I31edd50b2301f4d9b64e1c7980c4ed371e00c2dc
2018-07-25 14:19:14 +02:00
hjk
00c926b6b4 Debugger: Remove unused DebuggerEngine::isSynchronous
Change-Id: Ia1eb3a65fabbf966a1766d68456144fd9e093ae8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-07-24 12:10:20 +00:00
Ulf Hermann
522ba30897 V4 Debugger: Use changebreakpoint command if available
Newer versions of QML will support proper changing of break points, we
won't need to work around it anymore.

Task-number: QTCREATORBUG-20795
Change-Id: Idb5aaeb8ea59c7d2fd7c924e336ea259d3573d3d
Reviewed-by: hjk <hjk@qt.io>
2018-07-24 10:38:47 +00:00
Ulf Hermann
957d7d83ff Debugger: Fix breakpoint disabling and enabling in for QML
As QML currently does not expose a command to atomically enable or
disable a breakpoint, we need to remove and re-insert it. The previous
code scheduled the removal through a timer, and depending on if the
timer hit before the insertion or after, the operation was successful or
not.

As the QML engine doesn't have to be in a specific state to insert and
remove breakpoints, we can just directly send the messages instead and
therefore be certain that they arrive in the right order.

Task-number: QTCREATORBUG-20795
Change-Id: If69797b2c75e1107ad552f88e709e1580b4164db
Reviewed-by: hjk <hjk@qt.io>
2018-07-19 13:49:51 +00:00
Eike Ziller
d09b71d260 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/android/androiddebugsupport.cpp

Change-Id: I01c4880850ad25432a65bb32849365d2aeb0756f
2018-07-10 07:44:53 +02:00
Ulf Hermann
8eef50e576 Qml Debugger: Disallow editing of items with children
The debugger will treat any value you put in there as string, and then
fail to update the item because it doesn't expect the type to change.
Proper editing of JavaScript objects requires quite a bit more UI than
this, so disallow it for now.

Task-number: QTCREATORBUG-20736
Change-Id: I7bf6e7a3747cde3c6682b66aaa810291f753e85d
Reviewed-by: hjk <hjk@qt.io>
2018-07-09 13:44:36 +00:00
Ulf Hermann
126030d079 QML Debugger: Make sure to re-fetch expanded properties on update
If an expanded object is updated we typically just get the ref for it.
If we leave the tree item at "wantsChildren", the debugger will think
that the update fails and "adjust" the "child expectation" to none.
Fetching the children right away takes care of this.

Task-number: QTCREATORBUG-20736
Change-Id: I1b3725e7106a563198962915cbcab8f68ef741a6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-09 12:31:51 +00:00
Eike Ziller
3bbe535b95 Merge remote-tracking branch 'origin/4.7'
Change-Id: I3c5d7e9e8c589ad4425cd89d61e1f572f5cb7997
2018-06-19 10:03:28 +02:00
Ulf Hermann
451e437afd Debugger: Use FileInProjectFinder for the console view
All the functionality to guess local files from remote paths is already
there.

Change-Id: I5bffeb0f126efef99edbaf152e1a5e9e1d244699
Task-number: QTCREATORBUG-12008
Reviewed-by: hjk <hjk@qt.io>
2018-06-14 08:18:56 +00:00
Eike Ziller
c585e7091b Merge remote-tracking branch 'origin/4.7'
Change-Id: Ib288796892faf5345d2a150a5ce0dadf91552924
2018-06-04 16:33:03 +02:00
hjk
4feb2259d9 Debugger: Code cosmetics
Sprinkling in const and ranged for.

Change-Id: I5d11d57f64140021397c23734c7373544ebebb6f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-31 07:10:47 +00:00
Ulf Hermann
a5ec1097a0 Debugger: Support nested properties in QML inspector
There are various ways to generate nested arrays and objects in the QML
engine debug service. We can easily show them.

Task-number: QTBUG-68474
Change-Id: I3511a3f6f7631de4ab6a9d4b13ba9392ba4173dc
Reviewed-by: hjk <hjk@qt.io>
2018-05-29 12:55:51 +00:00
hjk
8b8237b11b Debugger: Fix combined debugger interrupt state machine
This fixes the case where the mixed engine was used, and called one
of the slave engine's interruptInferior() without setting the
InterruptStopRequested state in the slave.

Change-Id: I45adbdcebc02940d6fcfb4299ef9f4bef1341b32
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-23 15:24:16 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
Eike Ziller
ccefc5cf47 Merge remote-tracking branch 'origin/4.6' into 4.7
Conflicts:
	src/plugins/qnx/qnxplugin.cpp

Change-Id: I8ede5fa9c8daf3001e41fcba7cbee68edb9db3a6
2018-05-16 10:09:15 +02:00
Ulf Hermann
f7895e272b QML Debugger: Don't hang if there are no scopes to be retrieved
Qt 5.11.0 contains an optimization that does away with call contexts for
simple inline bindings. Also, it doesn't report QML contexts as scopes
in the "frame" and "backtrace" commands. Therefore, in those cases
"this" is the only thing to be retrieved.

Check if we are done when "this" has been retrieved and no scopes have
been found.

Change-Id: I9e0f545777bc38333938b65a934d42701ec4f807
Task-number: QTBUG-68218
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-05-15 13:31:01 +00:00
Eike Ziller
428fcb476b Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/libs/utils/settingsaccessor.cpp
	src/plugins/autotest/autotestplugin.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.h

Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
2018-04-13 10:54:42 +02:00
Orgad Shaneh
eea6a7c3b3 Utils: Purge qtcfallthrough.h
No longer needed.

Change-Id: I9b0bee014df89d4c567f1d2431b5ff9404f5f925
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:13 +00:00
Ulf Hermann
89d32d1efd QML Debugger: Handle QtInfoMsg messages in console
Before those were ignored. Also add a soft assert that will trigger if
we forget to add some other category here.

Change-Id: Iff3b33ab6c8defe935b681dd80bf185cd95e54f7
Task-number: QTCREATORBUG-20117
Reviewed-by: hjk <hjk@qt.io>
2018-04-03 08:48:31 +00:00
Eike Ziller
c7fdb93865 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp

Change-Id: I2445882a270731b866b04f28ff87d161224c539a
2018-02-13 13:37:37 +01:00
Ulf Hermann
2132ed8c96 Debugger: Accept transition from InferiorStopOk to InferiorRunOk
This can happen if we continue after an automatic break point at
application start. Set the state to InferiorRunRequested first, and then
to InferiorRunOk.

Change-Id: I0c4094ef0b335f31099cceb49b23aa3bc1a9a7af
Task-number: QTCREATORBUG-19712
Reviewed-by: hjk <hjk@qt.io>
2018-02-12 15:28:14 +00:00
hjk
1b87d19a64 Debugger: Modernize
Mostly nullptr instead of 0, but also a few bits of collateral damage.

Change-Id: I921991272aca921dcdecf302dfff3716e79dfc24
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-01 10:28:54 +00:00
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
dfbdc1e543 Debugger: Remove public access to QmlCppEngine::m_qmlEngine
Not used anymore.

Change-Id: I30605916bcdb4e5231d86ddc371f2d41e3d9d526
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-08 12:59:14 +00:00
Eike Ziller
a9e4e3608e Merge remote-tracking branch 'origin/4.5'
Change-Id: I0194bdeda71e33fd5bc9cb3eb7a9198ae72815ed
2017-11-07 15:10:36 +01:00
hjk
83ff62aa13 Debugger: Synchronize slave engine inferior setup phases again
This reverts most of 4977c915 and applies the same pattern for
setupEngine. Turns out that the removal was premature due
to the special needs of Android setup.

Task-number: QTCREATORBUG-19199
Change-Id: I4e2ff4f34a842f3296999a0651e7e8fd6470198c
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-07 13:42:59 +00:00