Commit Graph

170 Commits

Author SHA1 Message Date
hjk
375791ec58 Debugger: Re-organize registration of sub-perspective switcher
Change-Id: Ia3559e5c4793bb297c9bdfbdf32a56d285ee0700
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-11 11:18:09 +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
f76c5dc8e3 Debugger: Left-align status line contents
Change-Id: Idd6e32aa113b8eccc828b519fa0946e5051fc55d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-05 08:39:24 +00:00
hjk
7777df42cf Debugger: Only hide, not destroy toolbars when switching perspectives
May save a few cycles for re-creation and re-layouting flicker
when switching back.

Change-Id: Ifc29adb008d2fa0966f68fe45b3258e6dd199d08
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-30 10:16:38 +00:00
Christian Stenger
04c39520e9 Debugger: Respect the last perspective
Switching to Debug mode did no more fully respect the last
active perspective, but instead restored it and afterwards
initialized the debugger engine and restored the
respective Debugger perspective.

Change-Id: I5ba34298f463c396b7f73e431efa76be3bcbe6eb
Reviewed-by: hjk <hjk@qt.io>
2018-08-27 09:14:33 +00:00
hjk
3b5d74c6c4 Debugger: Handle 'raise' operations in dock destruction properly
Change-Id: I19e8eb2ae1d247964ee2a46a35e1990c01e4d6c2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-24 10:16:46 +00:00
hjk
2dc14e9eca Debugger: Fix persisting/creation of debugger toolbar
Change-Id: I212f23ef365a2e12aa78dcf26d097dec95f3189e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-24 08:48:41 +00:00
hjk
0303b84fff Debugger: Fix switch from and to sub-perspectives
Change-Id: I17d3b7eb6416843b7a330da14528f0670cd88452
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-23 12:17:39 +00:00
hjk
763a1cfc06 Debugger: Simplify keeping track of perspective dock widgets
It's essentially a property of the dock widget, and we fully control it.
So store the information there.

Also, using QString as id saves a few conversions.

Change-Id: I9e1add60c8451127363aba67eec295001cc3425b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-23 12:17:14 +00:00
hjk
e6e38df436 Debugger: Shift some perspective related API to the perspective class
Also, use QString uniformly for the (now rarely used) perspective ids.

Change-Id: I682062e7d179d0fcfd309e7714713bd1218bd8bb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-08-23 08:57:10 +00:00
hjk
32d2a4c985 Shift perspective ownership to plugins
Change-Id: Id146ca771b4dc92f35cf156efbabae154f2d940f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-08-21 15:38:22 +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
hjk
1567679b81 Debugger: Tighten Perspective interface
Pass id in constructor, so it can be const.

Change-Id: Id33fe19c4416109af8aa05a3ed0a09918eeb5cdf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-13 08:42:52 +00:00
Eike Ziller
1d68e08359 Fix color of labels and combo boxes in debugger toolbar
ManhattanStyle adapts the palette of widgets in its polish(...) method.
But creating widgets directly schedules a polish event, and after a
widget was polished it will never be polished again (except if the style
changes).

Before f45f1a8cef, toolbar widgets were
directly added to the widget hierarchy of the toolbar, but now that is
no longer the case. That means that the widgets are polished before they
are added to the toolbar hierarchy, so ManhattanStyle does not change
their palette.

To fix this we explicitly make tool bar widgets "panelwidget"s when they
are added to a perspective.

Task-number: QTCREATORBUG-20916
Change-Id: I659798c7c314a481d1ec467b1877f2e6ddd6da70
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-13 07:49:10 +00:00
hjk
f45f1a8cef Debugger: Make perspective toolbar items part of the perspective
This simplifies the toolbar setup and removes the need for the
stack of toolbar widgets.

The actions themselves have been owned by the plugin already,
so nothing changed in this respect.

Change-Id: I44754e16c8fc2acc53633dd9d560b1e732eece27
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-06 11:12:44 +00:00
hjk
01f2b982a2 Debugger: Move ownership of perspective dock widgets to plugins
Similar to the previous patch, but affecting more plugins: with dynamic
perspectives lifetime is better managed close to the code that knows how
to (re-)construct the items.

Change-Id: I0e7bfcf769d198ec2afa88b972be900baa1b6a46
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-01 11:27:21 +00:00
hjk
0c2bc9c2da Debugger: Move ownership of perspective central widget to plugin
It's only used in GammaRay currently, and with dynamic perspectives
lifetime is better managed close to the code that knows how to
(re-)construct the beasts.

Change-Id: I9e8ebe2e93d749a62fb008f773f1702a4c0bab3c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-07-31 13:41:18 +00:00
hjk
be89452602 Debugger: Start introducing dynamic perspectives
Make perspectives and tool bars destroyable. This is a
step forward to multiply debugger engines whose perspective's
life time is connected to the engine, not the debug mode.

In the present setup there are two kind of perspective:
1 - static: with a lifetime associated to the application
(or, rather, plugin that defines them). These are listed
in the perspective chooser, later e.g. Debugger for
pre-set breakpoints
2 - dynamic: with a shorted lifetime, e.g. running GDB engine.

Presently, and possibly also in future so, a dynamic
perspective is related to exactly one of the static
perspectives, i.e. are kind of "child".

Change-Id: Ic11572e7121e14f8da2927a0c0ac3441c99073a3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-07-31 07:38:38 +00:00
hjk
d41e690c84 Debugger: Add a way to add perspective windows one-by-one
More convenient in some circumstances.

Change-Id: I413be4bebe9f5a2bbdfa9617ada6242d867eb1a0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-26 08:44:50 +00:00
hjk
02a759d4f5 Debugger: Make Perspective persistence more robust
Always save on exit, but do not expect a valid perspective name
on restart. The settings could get corrupted in the mean time etc.

Change-Id: Ic0181607f46c3350a4193240d795d4c0d7c6815b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-26 08:07:39 +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
hjk
33e5c3672d Debugger: Make perspective saving more flexible
This essentially replaces saveCurrentPerspective by some
savePerspectiveHelper(m_currentPerspectiveId)

This is in preparation of the change introducing multiple running
engines, and per-engine perspectives.

Change-Id: Ibdbdac019bb5d47936ba4ab5de08711f2c16ea99
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-25 07:35:59 +00:00
hjk
c1ea6f518c Debugger: Return created tool button from Perspective::addAction
It will be needed later to show/hide the buttons depending on
engine-specific abilities or other circumstances.

Change-Id: I029012e01929e5e96e2af87da2cf3580a8d82b3f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-07-24 11:20:45 +00:00
hjk
89371d9c17 Debugger: Add a "Leave Debug Mode" button to the toolbar
Arguably wrong as a concept, but the issue keeps coming back.

Change-Id: Id0b084999884c1f018e3de60bb04c5288f7031ad
Task-number: QTCREATORBUG-1214
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-14 08:04:36 +00:00
Ulf Hermann
8515fd13e3 Debugger: Remove unused lambda capture
Change-Id: I7e0b87003f320e35dd28aa8ebd83766929ef1565
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-11-07 11:52:15 +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
Eike Ziller
5a1a20f2ee Merge remote-tracking branch 'origin/4.3' into 4.4
Change-Id: Ifb1dcc847ba4b32a79b349955fad5207e402cb7b
2017-07-12 10:50:49 +02:00
Hannah von Reth
ada1429594 Introduce setPerspectiveEnabled
This enables us to mark perspectives as disabled.

Change-Id: I52b2434f33f8550b6d2459f915dfd8cdb1389140
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-07-11 15:38:49 +00:00
hjk
acd50cea8b Debugger: Provide Alt-V + some letter short cuts to enable views
This kind of conflicts with the Alt-V + [0-9V] FakeVim short cuts,
but since those are rarely used and still operational in edit mode
I think that's acceptable.

Change-Id: If232cc6574690e0219eddcaa89d844f498687b64
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-06-27 13:10:52 +00:00
Serhii Moroz
69da534f99 TextEditor: add right sidebar
Task-number: QTCREATORBUG-9436
Change-Id: Ic0406758a30d52c22c58433f5f35305b798cb462
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-09 08:19:54 +00:00
hjk
e7d6f8e514 Debugger: Compile fix after previous change
Change-Id: Ie9b871a7dee7bf886474ff87306ed934c1a67b6d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-21 13:40:46 +00:00
hjk
6de88f7fae Debugger: Add a way to notify perspective about their activation
Change-Id: I5a6189e835aa293341f357c08f1d4b8ca4dd8326
Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com>
Reviewed-by: hjk <hjk@qt.io>
2016-11-21 13:10:26 +00:00
Ulf Hermann
b604b8fc2b FancyMainWindow: Add an option to hide the central widget
This way the debugger views can take up the whole window, which is
useful for the QML and perf profilers.

Change-Id: Ia4d236e8738a666d2316c05edaf4cf48ac46ffdb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-10-04 08:29:05 +00:00
Ulf Hermann
d5cdbf8baf Debugger: Avoid duplicate dock actions in Window->Views menu
The dock actions are already in the M_WINDOW_VIEWS container.

Change-Id: Ib71430818252711d7a97d6890b85ad6dd38c7134
Reviewed-by: hjk <hjk@qt.io>
2016-09-15 07:48:08 +00:00
Ulf Hermann
72cca4855d Debugger: Have main window handle mode change separately
On shutdown the DebuggerMainWindow might not be alive anymore. By
connecting the signal handler to the window, rather than the plugin we
avoid dereferencing null pointers in that case.

Change-Id: I6421eebc6b1b76f176b31eafeb039d91edd3f0b3
Reviewed-by: hjk <hjk@qt.io>
2016-08-26 11:52:23 +00:00
hjk
add9e627b8 Debugger: Don't access unloaded perspectives
This can happen if a previous session marked a plugin for not
loading and ended the session in a perspective provided by that
plugin.

Change-Id: I83a5dda421a1bb8ed2f8942f03e629e9c5d4d4ed
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-26 06:27:27 +00:00
hjk
ae19d452b6 Debugger: Move remaining Analyzer overlay icon to ProjectExplorer
It's the only remaining item and loosens the dependencies of
ex-AnalyzerBase based plugins on the the Debugger.

Change-Id: I943ac44401c440dd6d3d5c1f54f8f996accd2b4a
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-05-30 15:07:26 +00:00
hjk
df8e3b5925 Debugger: Let perspectives specify their central widget
The default 0 value will be interpreted as 'use the editor stack'.

Also, drop the idea of value semantics for Perspective objects
to get a simpler approach to the destruction of owned widgets
(tools docks + central widget)

Change-Id: Ic6470411ee5d387c43447f95b5a12c81c6658ff8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-05-13 11:34:00 +00:00
Alessandro Portale
97cd094009 Debugger: Display separate icons for toolbar and menu
Overriding the ProxyAction icons accordingly.

Change-Id: I52b6414fe6a0b1128394452f599b2b6c67d37e53
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-05-04 10:37:26 +00:00
Eike Ziller
4eab11262c EditorManagerPlaceHolder: Don't restrict to one per mode
Make visibility the deciding factor which placeholder takes the main
editor area. A mode can have multiple placeholders as long as only a
single one is visible at a time.

Change-Id: I80b86dcb9e31b29f87fe42a465a3d3ad49eeef17
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-04-28 07:26:12 +00:00
Eike Ziller
ee8bf341c6 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/projectexplorer/session.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp

Change-Id: I6946139f5e5fa3a9cdbb322fd50be248e2c0133f
2016-04-20 14:58:48 +02:00
Alessandro Portale
4c9a5d5088 Debugger: Fix "jumping" status label
There are two layout stretches with equal stretch factors fighting
against each other. That makes the status label which is positioned
between the stretches jump around with changing content length.

This change increases the factor of the last stretch, which causes the
label position to stay constant.

Change-Id: I4e98d8b1fd6876f707911d1e90fa90165c8c2ff1
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-18 13:47:42 +00:00
Ulf Hermann
334017be56 Debugger: Properly clean up dock widgets
We call setParent(0) on the dock widgets, not on the actual operation
widgets. In order to find out which ones we need to delete we need to
check both the operations and the dock widgets.

Change-Id: Ia6fde9bc1737aab6b6ad5497b27e805bcd67d0ab
Task-number: QTCREATORBUG-16074
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-18 10:46:53 +00:00
Eike Ziller
5c87432260 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp

Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
2016-04-12 11:34:46 +02:00
Ulf Hermann
01f4e4a8c6 Debugger: Do setParent(0) on disabled dock widgets
When disabling a dock widget, we don't want it to show up in the Views
menu anymore and we don't want it to interfere with other views.
setParent(0) accomplishes this. However, when showing a different
perspective we need to properly parent all the widgets that belong to
it.

Task-number: QTCREATORBUG-16027
Change-Id: I68e8cd4e6ade1dd8b23fb789f03edc39671aee91
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-04-11 12:17:29 +00:00
hjk
5e47d35fcd Use Core::Id in ModeManager interface
Makes it more uniform to use and allows placeholder widget
creation to be independent of mode creations.

Change-Id: I4021bc9db7f8c78f0374c0cc3b3331506959afe4
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-04-08 10:38:49 +00:00
Ulf Hermann
fdfd5f2351 Debugger: Avoid setParent(0) on QDockWidgets
This spells trouble as dock widgets which have a native window will
assume they should be positioned relative to the outermost native
window then.

Change-Id: I5a8ce5870afacaabe26d4a2d7ac53ffee09328ed
Task-number: QTCREATORBUG-15844
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-03-31 08:33:30 +00:00
hjk
259c3cb4d4 Debugger: Fix object leakage on shutdown and heap-use-after-free.
Task-number: QTCREATORBUG-15938
Change-Id: I437756705c33730398a129651fabe34c92334656
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-03-24 15:02:56 +00:00
hjk
958b3178df Debugger: Move last separator in toolbar next to the views menu
Looks more natural there.

Change-Id: Id1c717869fbc903e55e4e4a2bc27dfe7db843423
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-03-15 13:36:03 +00:00
hjk
48fb9e1855 Debugger: Move main splitter creation to DebugMainWindow setup
To allow other mode main windows to re-use the perspective
concept.

Change-Id: Icf00b4f0e4bd73a09ebec131ef9c578154f25eec
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-11 08:08:11 +00:00