Commit Graph

100 Commits

Author SHA1 Message Date
hjk
03de3bc602 Debugger: Remove some unused declarations
Change-Id: I38f92b674b97f542e1e50dabe48f3054f7c48518
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-10 09:08:05 +00:00
hjk
53a4c6eda0 Debugger: Remember sizes and order of the columns in the debugger views
Task-number: QTCREATORBUG-23341
Change-Id: I405be5361e732eccadebd1f51d90c7a3229a2e5e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-10 08:53:19 +00:00
hjk
e9c0ba9997 Debugger: Do not forget perspective layouts on unused perspectives
Amends 5273ef2a8a

Use cases mentioned there should still work.

Fixes: QTCREATORBUG-22938
Fixes: QTCREATORBUG-22286
Change-Id: Ie7bb6b7ea6d05a94cbeeb5b8021dc638548778d9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-20 10:09:44 +00: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
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
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
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
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
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
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
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
0a0e56fe3b Debugger: Compile fix
Change-Id: I1b7c4de471d79ec4ea712cbfdb61fe6f5c43a743
Reviewed-by: hjk <hjk@qt.io>
2018-07-24 11:31:16 +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
cb572773c0 Debugger: Robustify MainWindow state saving
Save the state before child widgets are affected.

Task-number: QTCREATORBUG-20721
Change-Id: I1d0d1ca610b0a8e8904585953ecbb42dddee4827
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-06 13:42:05 +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
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
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
Tobias Hunger
85115d486a Debugger: Initialize members
m_toolbarDock was only initialized in finalizeSetup, which is triggered
by the plugin's initialize() method. This is not safe since Creator might
shut down before that method ever gets called.

Change-Id: Idadb6ac943ed6799d1bd9db1ecb884cb39038389
Reviewed-by: hjk <hjk@qt.io>
2016-12-05 13:19:40 +00:00
Tobias Hunger
e2986af343 Debugger: Initialize variables in debugger main window
Change-Id: I705e02d177b2d8cd41f87791441dcc9fa093e60a
Reviewed-by: hjk <hjk@qt.io>
2016-11-29 16:32:00 +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
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
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
hjk
04acb9d643 Debugger: Export Debugger::createModeWindow()
For re-use in the GammaRay integration plugin.

Change-Id: I3fa1ad10645628a05bcd1248a50f23ac3d47a243
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-11 13:37:02 +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
Oswald Buddenhagen
e426d08e54 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/debugger/debuggerruncontrol.cpp

Change-Id: I81b43480a1369e3d7be60ae26e812dda6b962b0b
2016-04-01 17:31:39 +02:00
hjk
39a38d5679 Wholesale conversion to #pragma once
Kudos to cgmb and https://github.com/cgmb/guardonce

Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-30 15:20:19 +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
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
hjk
f09f39f7e2 FancyMainWindow: Move toolbarDockWidget "property" to subclass
This was only used to accommodate the debugger main window
and is not needed in the base class.

Change-Id: Ifbe9937cd4c21f5bed2fab35b23d874f4f2dd0e4
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-03-09 15:35:12 +00:00
hjk
92e301a054 Debugger: Merge debug mode and analyze mode
On the user-visible side, only the 'Analyze' mode button disappears,
and instead a combobox to switch between different tools in appears
in the Debug mode toolbar.

Internally, that's quite some re-organzition: The centralized
'Analyze mode is busy' flag is gone, allowing us to run e.g.
ClangStaticAnalyzer and MemCheck in parallel.

Analyzer tools and debugger now share the same mechanism to
generate/load/save dock widgets.

Analyzer tools now create and handle their own start/stop button
when appropriate. In general, Analyzer tools can create/handle more
than one run control at a time.

Further consolidation is possible, e.g. RunControl state handling
could be merged into the base ProjectExplorer::RunControl to
avoid the still existing duplication in ~15 instances.

Change-Id: I91e5940ebc4211f98056d507cf2f7b5f8efe7f07
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-07 15:06:10 +00:00
hjk
65d7aedd27 Debugger: Rename Perspective::Split to Perspective::Operation
We have 'raise' in there now, that's not a split anymore.

Change-Id: Id45c606056dfab1317fad37b2fe37216b0eacf85
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-03 12:53:45 +00:00
hjk
9ff81d5c68 Debugger: Make Perspective status label global
After some discussion we agreed that the contents is ephemeral
and does not need to survive perspective switching.

Change-Id: I41de6a8f9478e4bd229c8b204ef7a3fa0a344b75
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-02 13:14:14 +00:00
Orgad Shaneh
c5f60bcc7c Debugger: Fix compilation without tests
* Some functions were inside WITH_TESTS section.
* MSVC requires Perspective::Split to be explicitly exported.

Change-Id: I272cefc5c4f446415b2714595f8b398f8ce010a4
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-02 08:52:30 +00:00
hjk
f3bd7412ef Debugger: Remove return value from AnalyzerManager::createDockWidget()
Change-Id: If6cd2a68f2f99a1977ded0f05a12790194143274
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-02 08:08:15 +00:00
hjk
6492d16408 Debugger: Split out re-usable parts of ex-AnalyzerMainWindow
Next steps is to re-use it for ex-DebuggerMainWindow.

Change-Id: Ic272d062f6db2e54ed62082c2a7d3a289b810a03
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-02 08:06:55 +00:00
hjk
397e6546e1 Debugger: Split debugger main window implementation
... into a plain Utils::FancyMainWindow object and the debugger
specific functionality in Debugger::MainWindow.

A step forward to share the Utils::FancyMainWindow with the
(Ex-)Analyzer MainWindow and towards merging Analyzer and
Debugger mode.

Change-Id: I50e89d9d615226cb9b9af1a653c7383468e40a93
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-02 08:05:23 +00:00