Commit Graph

1432 Commits

Author SHA1 Message Date
Thomas Hartmann
b0589fb8fe Add options to hide and configure main window
These options allow to hide certain main menus
and move options to edit.

This allows hiding those menus in the Qt Design Studio context.
The options are separated so that power users can enable
Debug, Analyze and Tools.

HideBuild=true
HideDebug=true
HideAnalyze=true

Change-Id: I26758aaa965bb7b61a476d197d82db34e62003b7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-15 14:37:29 +00:00
Aaron Barany
03a0ed0786 Debugger: Use queued connection for menu actions
Pass the parent calling object to the addAction() functions and use a
queued connection. This prevents the following sequence of events:

1. The menu is dismissed when selecting a menu item.
2. The deletion gets queued via deleteLater().
2. The onTriggered action gets invoked and opens a dialog box.
3. The dialog box triggers the events to be processed.
4. The menu is deleted when processing the events, while still in the
   event function to handle the dismissal.

This only affected the watch menu since the others were leaked. Added
cleanup handlers for the other debugger menus to avoid leaking them.

Task-number: QTCREATORBUG-26989
Change-Id: Ifa2c52d7bea884c55d43fa545e3e2870301e4052
Reviewed-by: hjk <hjk@qt.io>
2022-02-07 20:20:58 +00:00
Jarek Kobus
d6f56254d1 Get rid of QtcProcess::workingDirectory() overload
Adapt all callers' code so that it passes the FilePath
instead of QString. As a consequence introduce
TemporaryDirectory::masterDirectoryFilePath() and use
it where easily possible.

Change-Id: I14564949b3b916921e32a2957c84c03d1da43af2
Reviewed-by: hjk <hjk@qt.io>
2022-01-18 17:18:34 +00:00
hjk
f2dea561ba Debugger: Introduce a Ctrl-F9 shortcut to enable/disable breakpoints
Since "toggle" now becomes ambiguous, change "Toggle Breakpoint"
to "Set or Remove Breakpoint" and add a new "Enable or Disable
Breakpoint"

Fixes: QTCREATORBUG-26788
Change-Id: I7902308298570360af202fced90bf44fc1a59adb
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-01-04 06:14:16 +00:00
hjk
09e4e7ff28 Debugger: Use Book case for start action
Re-using the tooltip gets capitalization wrong...

Change-Id: Id9a5147a5be8e7c20a8b82d108dbec092799a48c
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-03 11:29:49 +00:00
hjk
16c25d99c8 Docker: Provide a means to select search paths for auto-detection
A combobox in the device dialog to select between the (docker image's)
system path and a semicolon-separated set of user defined paths.

Use it for cmake and gdb detection; qmake and toolchains currently missing.

Change-Id: I3c478ca914a1bf02dcb69ebcb9ea6e358d24aaf9
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-12-14 11:15:21 +00:00
hjk
b237db519b Debugger: Use FilePath for core files and surroundings
Change-Id: Icd648147ee907a2c5ba75042f003229bbd9226fe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-29 07:35:06 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +00:00
hjk
584217a52f Use more FileUtils based file dialogs
Change-Id: I1e7ec0493c26afe58e17afb8923a2b1023f6dcd4
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-19 08:33:22 +00:00
Christian Kandeler
33108795d6 CppTools: Turn some classes into pure value types
ProjectInfo, ProjectPart and ProjectUpdateInfo used to carry pointers
to Project and/or Toolchain, even though they were used in contexts
where these pointers were either unsafe to access or not guaranteed to
be valid anymore, which made their use difficult and error-prone.
We turn these classes into pure value types by copying in all relevant
information before the first async operation takes place.

Fixes: QTCREATORBUG-25678
Change-Id: I1914b0dbda6c7dfba6c95e5e92f2d69977755590
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-13 12:35:49 +00:00
hjk
cb23530798 Docker: Add a button to list auto-detected kit items
Helps to understand what's going on.

Change-Id: I5b8c591cbd60227cf250932c8654063236eec05f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-21 06:44:21 +00:00
hjk
f8c7d2e848 Docker: Rework auto-detection and removal of kit items
- Use more uniform messages for the different kinds of items
- Remove all auto-detected items

Change-Id: I0b0df0bca484337039432b163bd8e19593b1cd22
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 12:55:53 +00:00
hjk
076d1bf10a Docker: Fix debugger auto-detection
Mark detected debuggers as such and give them some bonus to match,
overriding other hacks.

Change-Id: Iaf4d88fa22dd50e68124b61087d4c742f7a56d0f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 08:28:56 +00:00
hjk
1955c82d5c Debugger: Register "Reload Debugging Helper" action
This allows assigning shortcuts via Tools->Options, Environment,
Keyboard Shortcuts

Fixes: QTCREATORBUG-25900
Change-Id: I6dfa6b0f3ff12ad971444b2d3adb427c8acf783c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 11:48:03 +00:00
hjk
aca55dce58 Docker: Auto-detect debugger binaries in docker devices
Change-Id: Iec7c2b16277ea626520372603ae769418e9efd12
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-21 12:14:29 +00:00
hjk
0e0cfcdcf2 Debugger: Claim usability also for docker devices
Doesn't work correctly yet, it effectively runs in a host environment.

Change-Id: I2aaf7d1b04ca38f9a0825edf78e264ceaed0434b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-18 09:17:35 +00:00
David Schulz
a13aef759e Utils: filepathify fileutils
Change-Id: Ic9048369f64d793f5f567cdb0c715488fb5a4ff6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-18 14:30:53 +00:00
hjk
641604429a Debugger: Use an aspect for the source path mapping
More in line with the other settings.

Change-Id: I86494f1955120cddda7d2f2eec8ba0fdbfd99585
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-09 12:40:12 +00:00
hjk
93a5803956 Debugger: Aspectify settings
Change-Id: I527be79965250b82a0928171b17aa93bac9fa2a0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-03 07:39:17 +00:00
Alessandro Portale
b3686d410d Debugger: Use qAsConst with non-const Qt containers in range-loops
Change-Id: I7bd27f8317b62fe448e037d5a25e78b4c88c648d
Reviewed-by: hjk <hjk@qt.io>
2021-02-17 08:03:09 +00:00
hjk
da147880e8 Debugger: Rename 'AttachExternal' to 'AttachToLocalProcess'
And AttachCrashedExternal to AttachToCrashedProcess
And AttachCore to AttachToCore.

Clearer.

Change-Id: I47c2eca5cbdbbc0eb38b9f62b2504c96558ff112
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-07 12:11:42 +00:00
hjk
14c3f5ba51 Debugger: Drop the EngineSetupOk state
Directly proceed to EngineRunRequested.

Change-Id: I8419086f554bae298624cab3b33e852e92ea54bd
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-05 07:40:12 +00:00
Eike Ziller
eaefcbd8f0 Use new, more evocative MessageManager API
At various places where semantics doesn't change.

Change-Id: Ib4d4a5c9f067e109126c6de88257f9e198a71447
Reviewed-by: hjk <hjk@qt.io>
2020-12-16 09:30:44 +00:00
Alessandro Portale
b2a766a79a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-19 08:42:14 +00:00
hjk
2bfd515b03 Utils: Allow BaseTreeView users to hide columns manually
... using a context menu on the header views.

Use the feature in the debugger views where it was previously
un-intuitively available as part of the main context menu of
the view, but not in the header.

Task-number: QTCREATORBUG-24384
Change-Id: I3f030c3dd8ce35dc91bad921e37d2273bfe548b5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-10 14:28:39 +00:00
hjk
fcaa6801cf Utils: Start replacing SavedActions by QAction or Utils::Aspect
First mechanical step here is to derive SavedActions from BaseAspect
instead of QAction.

Change-Id: I2ec95883b825462c1d867f83cc2b3bd2c2732055
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-05 08:46:27 +00:00
Eike Ziller
2a70bc1d09 Debugger: Fix build with Qt6
QStringRef gone.
ViewOptions changed.
MetaType register stream operators automatically.

Task-number: QTCREATORBUG-24098
Change-Id: Ibf98561af951aa5fc4ec483d18dafeaad02e07c3
Reviewed-by: hjk <hjk@qt.io>
2020-09-18 14:41:20 +00:00
Orgad Shaneh
8951ddfd62 Debugger: Support sysroot override
Sometimes the same toolchain can be used with different versions of
sysroots. Support this in command-line and dialogs.

Change-Id: Id49f8e8c50f4856e979eecbbdebc680b57dc69b2
Reviewed-by: hjk <hjk@qt.io>
2020-07-06 16:04:49 +00:00
Eike Ziller
0eefc5b70d Add a menu to Debug mode that switches perspectives
Set a menu for switching perspectives on the debug mode icon. When icons
& text are shown for the modes, there is an additional arrow to the
right of the mode that can be clicked to open the menu. This
functionality was added in 4.1 for that purpose, finally use it.
Do not show and arrow in "Icons Only" mode, so it stays small, but make
it available on right-click as well.

Change-Id: If19877b5231b7f01f0b3fd98cf65e8eaf9da1a5f
Reviewed-by: hjk <hjk@qt.io>
2020-06-17 06:48:17 +00:00
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
Eike Ziller
f8ec649c99 Merge remote-tracking branch 'origin/4.11' into 4.12
Change-Id: I3edd6457620e6c2686e13d1030805294d7d3958f
2020-04-03 15:56:36 +02:00
hjk
699407b4ba Debugger: Create central widget earlier
This ensures the showCentralWidget() call in  restorePersistentSettings()
has something to operate on.

Change-Id: I52e676517cad4e7c3c0e7ca80b8756f937c805a0
Fixes: QTCREATORBUG-23755
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-03-25 08:51:36 +00:00
hjk
df7400b686 ProjectExplorer: Disentangle ProjectExplorer::updateRunActions
This enforces a linear pass through

  [static] ProjectExplorerPlugin::updateRunActions
  ProjectExplorerPluginPrivate::doUpdateRunAction
  [emit] ProjectExplorerPluginPrivate::runActionsUpdated

instead of the previous direct emission of the signal from
user code and connecting also the internal update to it.

This is meant to simplify reasoning about execution order and
maybe to help elimimating double executation.

Change-Id: Id8cc41a46d9dec06afb5514855f2ae80560f3695
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-26 14:32:58 +00:00
hjk
06b2023420 Debugger: Remove "IdentifyDebugInfoPackages" feature
This was only ever working with SuSE and GDB, and nobody
ever tests it, nor asks for extension to other setups.

Change-Id: I7b1e3cc8c9f71df4c86b957a79d5afe02eec0758
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-25 14:13:01 +00:00
Kai Koehne
fda9955df0 Globally disable WindowContextHelpButtonHint
Do set the global application flag AA_DisableWindowContextHelpButton
to avoid having to unset the default WindowContextHelpButtonHint
in every single dialog.

AA_DisableWindowContextHelpButton was added in Qt 5.10.

Change-Id: I21fe8bc5ddfa4c01ec7a799b04bfb6ff1c9d6d86
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-25 13:26:44 +00:00
hjk
299d34d547 Remove apparently unneeded QtPlugin includes
Change-Id: I511c0318a72dbf2a92e4749dee02eabfc9826139
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-12 16:03:37 +00:00
Eike Ziller
d43f1662d0 Make TextEditor setup more flexible
So far it was only possible to combine TextEditorFactory, BaseTextEditor
and TextEditorWidget directly.
That TextEditorWidget is also directly a QPlainTextEdit made it
impossible to "decorate" the text editor widget with something else
without a lot of effort.

Make it possible to create a text editor factory that returns an
arbitrary widget, as long as it can be "cast" to a TextEditorWidget with
either qobject_cast or Aggregation::query. That way the TextEditorWidget
instance can be attached to the editor widget via Aggregation.

Adapt other code that accesses TextEditorWidget from editors
accordingly. Introduce a common method how to do that.

Change-Id: I72b8721f3a8a8d8281c39af75253e9c80cbe1250
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-02-12 10:28:31 +00:00
hjk
c570d6469d Debugger: Move PerspectiveState registration
... to DebuggerPlugin ctor. This fixes a "Variant::load: unknown users
type with name Utils::PerspectiveState" message when the TextEditor
plugin restore the FontSettings.

Change-Id: I8e1ebe562233ff6e9b7bdbfa85680e5acf6c4715
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-11 14:27:19 +00:00
hjk
5496d7cbde Debugger: Use new IOptionPage convenience for global options
Change-Id: I42391a01027f25be638b2d1b839d3038bced5f33
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-09 12:45:48 +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
Christian Kandeler
5cebf2a79a ProjectExplorer: Move some build-related code to BuildManager
The projectexplorer.cpp file is a huge mixed bag, which could use some
cleaning up. The queue() function is very much related to the
BuildManager, so move it there.

Change-Id: Ibc6425cc27d44514803a5e7c6139f83ddd760382
Reviewed-by: hjk <hjk@qt.io>
2019-12-19 17:35:46 +00:00
hjk
466764146c Debugger: Rename some GdbServer* to DebugServer*
This is mimicking a bit what has been done on the baremetal side,
and is formally more correct when the gdbserver is not a real
gdbserver, but e.g. a probe speaking the gdb remote protocol.

Change-Id: I1b42624b94071b34c009bd0650095792a5b2fcb7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-17 08:23:06 +00:00
hjk
4bd26c3e4b Debugger: Add ability to hide view columns
Not perfect, e.g. one would probably expect the items to
appear in the context menu of the header views, too, not
just on the main background of the view, but better than
nothing.

Task-number: QTCREATORBUG-23342
Change-Id: Ifdc44dcfd390112faa7b15bb8a51d809e42d7b29
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-13 08:07:31 +00:00
hjk
0e49f11ca3 Debugger: Avoid a few clang warnings
Change of signedness and/or size.

Change-Id: I126d36d406afbba4b7383bf8326d845db79cdde7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-10 11:43:50 +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
c8137bdcf9 ProjectExplorer: Consolidate some Session::active* accesses
Change-Id: I47b0f6c2c60b2f7c86b6ffd1ad3df393d1321c8b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-11-29 08:39:07 +00:00
Nikolai Kosjar
202aa06d7c ClangTools/Debugger: Fix resource name clash
The two plugins plugins added resource files which were referenced with
the same name, namely

    :/unit-tests

Make the names unique.

Change-Id: If63e762663f3f61b15f826d76ffcd2eb66873db7
Reviewed-by: hjk <hjk@qt.io>
2019-11-28 16:05:18 +00:00
Christian Stenger
89dbb44fcb Debugger: Prohibit multi selection on debugger presets
To avoid confusion regarding context menu items limit the
selection mode to single selection.

Change-Id: I220d97fee65180a497f21e5921f832076235acb5
Reviewed-by: hjk <hjk@qt.io>
2019-10-18 11:29:27 +00:00
Laurent Montel
f467badc2f Port setMargins to setContentsMargins
Change-Id: Ie6b3f3e4dddbbf4bcc7ea7561ec348ff2c666907
Reviewed-by: hjk <hjk@qt.io>
2019-10-16 05:02:57 +00:00
Orgad Shaneh
0b1e6599c9 Debugger: Fix MSVC warning
Using QObject::connect without capturing 'this'.

Change-Id: I64e61e897760002888d7a11771bd2dc36e640c72
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-07 13:17:34 +00:00