Commit Graph

202 Commits

Author SHA1 Message Date
hjk
c978afb42e Debugger: Use the new hint to determine why settings should be saved
Change-Id: I5f8e2caceaa9769fc99e91bf1e29470fa17320bb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-11 15:56:20 +00:00
hjk
34341ffc30 Debugger: Improve perspective geometry persistence
Setting sizes on dock widgets one-by-one to restore previous
layouts does not work, as each triggers a delayed update taking
other (at that time "wrong" sizes) into account.

So store the layout as a whole, per-perspective.

Task-number: QTCREATORBUG-21669
Change-Id: I854cd175297b4ba1e53b404fcaa20092d216cec0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-04 12:05:10 +00:00
Eike Ziller
75696f9639 Merge remote-tracking branch 'origin/4.9'
Change-Id: I95c56cc9371959f96afde3677fc82481f36f66c8
2019-04-12 14:31:01 +02:00
hjk
810a39c706 Debugger: Prevent crash on destroyed perspective
Change-Id: Id000f1c74c2e614f24df1f50f710e51041fa9c38
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-09 11:16:52 +00:00
Orgad Shaneh
39ba01da71 Merge remote-tracking branch 'origin/4.9'
Change-Id: I7d1912cd5c4d824fd40d3454c5f1bb796f2c21d8
2019-04-07 23:13:17 +03:00
hjk
5273ef2a8a Debugger: Re-organize dock widget persisting
Looks like the mainwindow cannot be convinced to handle multiple
sets of dockwidgets.

So switch back to a single set containing everything and keep
track of non-default visibility in the perspectives, and persist
these sets.

The following pass:

1.

 Start Creator with new settings
 Goto Debug Mode
 Move Break dock widget to right, switch on Global log widget
 Leave Creator
 Start Creator
 Goto Debug Mode
 Check: Debugger Selected, Break on right, Global log visible

2.

 Start Creator with new settings
 Goto Debug Mode
 Move Break dock widget to right, switch on Global log widget
 Switch to QmlProfiler sub-perspective
 Leave Creator
 Start Creator
 Goto Debug Mode
 Check QmlProfiler selected
 Switch to Debugger sub-perspective
 Check: Debugger Selected, Break on right, Global log visible

3.

 Start Creator with new settings
 Use any C++ test project
 Start debugging / stop at main()  (F10)
 Wait for stop
 Switch to Edit mode
 Switch back to Debug mode
 Check: Only "running" debugger dock widget layout present
  (not the normal + preset at the same time)
 Quit Qt Creator while this debugger is running
 Check: Shuts down without crash

4.
 Use any C++ test project
 Start debugging
 Switch to Debugger Preset perspective
 Start a second debugger
 Kill either instance
 Check: Application dies, Debugger Preset perspective gets displayed
 Switch to perspective of second instance
 Check: Perspective looks ok (docks visible as before)

Task-number: QTCREATORBUG-21083
Task-number: QTCREATORBUG-21669
Task-number: QTCREATORBUG-21668
Task-number: QTCREATORBUG-21813
Task-number: QTCREATORBUG-21851
Task-number: QTCREATORBUG-22110
Task-number: QTCREATORBUG-22169
Task-number: QTCREATORBUG-22189
Change-Id: Ic9eb41ff7699ac0f48a85e68376daa80b2b6847e
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-04-05 15:53:51 +00:00
Eike Ziller
b3baed58c6 Merge remote-tracking branch 'origin/4.9'
Change-Id: If36258b8e572b5c7875433a31a836e4f06e27286
2019-03-21 11:28:21 +01:00
hjk
4d5da2938a Debugger: Move perspective saving to a time where mode is active
It should not make and I do not observe a difference, but it seems
the better thing to do.

Change-Id: I1f1f9fba72c2b20f24ebde04cf4ec3711d77d476
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-03-18 09:56:11 +00:00
Eike Ziller
c53ccceff1 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/debugger/debuggerkitinformation.cpp
	src/plugins/languageclient/languageclientmanager.cpp
	src/plugins/plugins.pro
	src/plugins/projectexplorer/kit.cpp
	src/plugins/projectexplorer/kitmanager.cpp

Change-Id: I66fb941202991f35f7d7761430b21e42dfc678a8
2019-03-14 15:51:15 +01:00
hjk
bc35583099 Debugger: Fix resizing of main perspective switcher combo
In case of debugger sub-perspectives this was effectively operating
on the names of the subperspective, not the "Debugger" string.

Change-Id: Ia5c3ea564b2b1a3ed3291d3cb6bae18e1fb5533f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-03-07 09:02:08 +00:00
Eike Ziller
0619de8681 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/tools/clangpchmanagerbackend/source/taskscheduler.h

Change-Id: I518adaf647df412887c2a372416634359f09ad2a
2019-03-05 10:22:45 +01:00
hjk
2cad90a559 Debugger: Fix toolbar-oversizing on perspective switch
The true reason for the overshooting is still unknown.

This here works around the issue by wrapping the toolbar
into an additional QScrollArea.

Task-number: QTCREATORBUG-21903
Task-number: QTCREATORBUG-21889
Change-Id: If6e89d138cd3e617e4eaa44227b078f31df1a627
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-03-01 15:03:11 +00:00
Orgad Shaneh
cbfc6e522d Merge remote-tracking branch 'origin/4.9'
Change-Id: I801042a53ae4d02d1891ea582ca9ea89b00d3181
2019-03-01 13:06:57 +02:00
Eike Ziller
eeaa02bc27 Merge remote-tracking branch 'origin/4.8' into 4.9
Conflicts:
	src/plugins/android/androidbuildapkstep.cpp

Change-Id: Id6dfda480c23706089ab38aa6277cd37599b5167
2019-02-28 12:39:09 +01:00
hjk
6f37348b4c Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning.

Also adjust coding style in the surrounding connects when needed.

Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 15:18:14 +00:00
Friedemann Kleint
ec6b38dea0 Fix Qt 5.13 deprecation warning about QFontMetrics::width()
Replace by QFontMetrics::horizontalAdvance(), fixing:
warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated:
 Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]

Change-Id: I9991ffefe6e87e872dc35ba291d562e06b28ca64
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-02-15 15:12:02 +00:00
hjk
e8a511f313 Debugger: Change workaround for scrambled dock widget layouts
The workaround from 3d92a79a introduces a bug by itself: When a user moves
all docks off the bottom area, the workaround will trigger as the
condition "nothing below the tool bar" is met.

This here changes the condition to toolbar.width() != mainwindow.width(),
which will trigger in the known scrambled situations (there was always
something to the right of the toolbar), but not in the situation
described above.

Task-number: QTCREATORBUG-21669
Task-number: QTCREATORBUG-21455
Change-Id: Ic2eabbe2ed07352680add4fc5e3b5f6673600479
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-13 12:39:04 +00:00
Eike Ziller
9084ca73df Merge remote-tracking branch 'origin/4.8'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: I87f47cecbb924064296a002fd9446a0627acad8e
2018-12-12 09:44:13 +01:00
Aaron Barany
867befc5ae Debugger: Fix switching to previous mode on exit
This behavior was broken with refactoring done in commit
3b5ecac238. This has two main components:
1. Perspective::select() needs to call EngineManager::activateDebugMode()
   in order to save the previous mode.
2. The contents of the previous function
   DebuggerPluginPrivate::activatePreviousMode() was placed in
   EngineManager::deactivateDebugMode() and is called in
   doFinishDebugger().

Task-number: QTCREATORBUG-21415
Change-Id: Ibca188ba740027769c497e25ea695af8e218ea4e
Reviewed-by: hjk <hjk@qt.io>
2018-12-10 18:42:14 +00:00
Orgad Shaneh
7096649fc2 Merge remote-tracking branch 'origin/4.8'
Change-Id: I5b18233936e3b2cd674df92a694ba73b5a3ed752
2018-12-03 09:56:07 +02:00
hjk
3d92a79a09 Debugger: Work around scrambled dock widget layouts
In some so far unknown situation the saveLayout/restoreLayout process leads
to a situation where some docks does not end up below the perspective toolbar
even though they were there initially, leading to an awkward dock layout.

Try to detect the situation (no other dock directly below the toolbar)
and correct that by restoring the default layout.

Task-number: QTCREATORBUG-21455
Change-Id: Ie5eaf2717a750823d96b103f9fd7ac194ba3914c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-30 08:26:26 +00:00
Eike Ziller
29c9f8080d Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/android/androidrunnerworker.cpp

Change-Id: Ibd8b99435365fb7e7d488313fd1d2b3a75adad1b
2018-11-29 13:36:14 +01:00
hjk
b364282228 Debugger: Fix perspective combobox activation
Fixes: QTCREATORBUG-21567
Change-Id: Ia309887fdc4752eb7ef82993608c83d0e2a757a8
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-28 10:57:48 +00:00
Eike Ziller
1473bc5891 Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/debugger/debuggermainwindow.cpp
	src/plugins/qbsprojectmanager/qbsbuildstep.cpp
	src/plugins/winrt/winrtdevicefactory.cpp
	tests/unit/unittest/gtest-creator-printing.cpp
	tests/unit/unittest/gtest-creator-printing.h
	tests/unit/unittest/unittest.pro

Change-Id: Ie9b80b87a8a4fa81baf72a2daa7919b21371c15e
2018-11-06 09:20:00 +01:00
Eike Ziller
7d3686359a Fix missing translation contexts
Change-Id: I4402157e7991ad0050333a34394b87ff3d6f4a1b
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-10-25 11:46:57 +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
hjk
2e4e18161b Debugger: Guard against some impossible situations
Change-Id: Ia1fd356b4f8ef71dd3b456a3b28598ff680b9344
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-04 12:13:37 +00:00
hjk
1e8ae60dce Utils: Return a const list for FancyMainWindow::dockWidgets
Makes s/foreach/for straight forward on the user code side.

Change-Id: I78aa0d06f538ebda491cd238ce81cc155b8d0beb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-26 07:53:14 +00:00
Orgad Shaneh
539b10727e Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/debugger/debuggermainwindow.cpp

Change-Id: I07496916dd37b842d57ce5c49f99c079a9095a5f
2018-09-21 10:49:44 +03:00
hjk
6635f85d47 Debugger: Move some debugger specific bits out of debuggermainwindow.*
A step towards making the perspective handling independent of the
debugger plugin.

Change-Id: Ic07f4b34d44c48f16a494ba7f470e0a34d3d56a3
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-09-21 06:14:05 +00:00
hjk
bcb2df7b30 Debugger: Add Perspective::name() accessor
Will be needed again by GammaRay.

Change-Id: I9afe61dd1db4a1ba4ec95a6abd089e12c6cbcd9a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-20 10:43:39 +00:00
hjk
982a019bfb Debugger: Rename MainWindow::{set,add}SubPerspectiveSwitcher
We'll need another one for GammaRay, and it's practically already
working as 'add', not 'set'. So fix the mis-nomer.

Change-Id: I1713ced6c39082dae0121b8d670c4676807c1602
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-19 06:50:05 +00:00
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