Commit Graph

491 Commits

Author SHA1 Message Date
Eike Ziller
5b364de168 Use dialogParent() instead of mainWindow()
There are very few reasons to use mainWindow() directly.
Especially for modal dialogs, using dialogParent() is important, since
that guarantees the stacking order in case of other dialogs currently
being open.

Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6
Reviewed-by: hjk <hjk@qt.io>
2020-06-02 11:44:53 +00:00
Christian Stenger
798b2674af Debugger: Fix go to location on interrupt
Avoid checking an invalid QUrl - instead restore
old code of always creating one an verifying this
instead.
Remove the now unused FilePath::isLocal().

Change-Id: I037c43e6fbdb7dc1f8901fc70b581f3c94ab503a
Reviewed-by: hjk <hjk@qt.io>
2020-01-31 13:18:50 +00:00
Alessandro Portale
24a25eed14 Use isEmpty() instead of count() or size()
Change-Id: I0a89d2808c6d041da0dc41ea5aea58e6e8759bb4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-20 20:56:57 +00:00
David Schulz
b23d80d537 Debugger: make Location::fileName a Utils::FilePath
Change-Id: I637d39246ff576db1023f08c432a7f7b6aadbbaa
Reviewed-by: hjk <hjk@qt.io>
2020-01-06 13:29:54 +00:00
David Schulz
a7dd0e50a2 Debugger: make BreakpointParameters::fileName a Utils::FilePath
Task-number: QTCREATORBUG-23339
Change-Id: Ifc497c14589cd6df10d8219533e100f1919213b3
Reviewed-by: hjk <hjk@qt.io>
2020-01-06 13:29:44 +00:00
hjk
ee23dcba23 Debugger: Move toFileInProject to QmlEngine
The only user.

Change-Id: I443cbfab20739fb43a45848355110f879b0f3041
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-02 11:09:17 +00:00
hjk
4307758e4b Debugger: Remove unused QmlEngine::startupMessageFilterConnection
Change-Id: Ifeda7c4956d6abdfc06f602d4e3011a6056e3186
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-19 09:51:03 +00:00
hjk
ecc698a416 Debugger: Remove unused QmlEngine::sourceEditors
It look like it has been always empty for a while.

Change-Id: I4d169294a93f22ffa6a49203e2cd34a9e0bf924c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-19 09:50:50 +00:00
hjk
cd1338cc30 Debugger: Work around a Qt deprecation warning
Change-Id: Ia396ec2a4b50b39692d659d107ef5bb7e5e5e5bd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-02 12:31:08 +00:00
hjk
e3b1106afa Compile fix with recent Qt dev
The reasoning in 1b4766e26c did not take into account that the scope
of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with
f70905448f6 in Qt base.

Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-29 08:54:18 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
Tim Jenssen
333b33edbe Merge remote-tracking branch 'origin/4.10'
Change-Id: Iaf27911e4e9fb762c1a24c84c458462bafe95728
2019-07-12 15:53:56 +02:00
hjk
c77cef5706 Avoid more deprecation warnings
Change-Id: Icc7bb7a4ccf7fc9f89f6f668c194ccd440e5231c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-05 07:49:48 +00:00
hjk
32bbf2a3b3 Debugger: Introduce a tree level above stack frames
This level is meant to take the role of current thread handler
in the long run, allowing per-thread stackviews in each engine.

For now, the additional level holds just a single, invisible
dummy item playing the role of a "current thread".

Change-Id: Ief6131500fc1aa8902f2313038a65840b80b495b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-26 06:58:03 +00:00
hjk
0d49c2cd2c Debugger: Use Utils::TreeModel as base for StackHandler
Change-Id: I3fcc1b3a149f15cf414a1560d91145b623e40c63
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-24 12:54:23 +00:00
hjk
1396c6e8e9 ProjectExplorer: Use Utils::FileName for Runnable::executable
Change-Id: I584bc18aa19a4c9886af7b13e95052dfd4350b34
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-21 10:32:31 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
Eike Ziller
0345bcb7cc Help: Rename handleHelpRequest to showHelpUrl
Since that is what it does.

Change-Id: I13ffe21cdb625a0df1313f2ff09bf84196f08768
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-01-25 08:23:18 +00:00
Alessandro Portale
d9c05d3d20 Fix warning: "Unused non-trivial variable"
[-Wclazy-unused-non-trivial-variable]

Change-Id: Ia99c3de31fd92205f25624ab60e60370c1aa4538
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2019-01-17 10:55:33 +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
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
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
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
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
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
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
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