Commit Graph

194 Commits

Author SHA1 Message Date
Christian Kandeler
659771f09b Debugger: Provide keyboard shortcuts for "next" and "previous"
... to applicable analyzers.
Rather than inventing separate shortcut categories for all the
analyzers, we make use of the fact that only one analyzer view is active
at any given time, and make them use the same shortcuts for consistency.

Fixes: QTCREATORBUG-20659
Change-Id: Ifa60080def0e6b32395854cff588ab3af9ea33b9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-30 12:20:58 +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
Lars Knoll
47e576528e Port QtCreator over to use filterRegularExpression
QSortFilterProxyModel::filterRegExp is going to go away in Qt6,
so port over to use QRegularExpression instead.

This required some changes where setFilterWildcard/FixedString()
was being used, as those would instantiate QRegExp based filters
in Qt 5, and will use QRegularExpression in Qt 6. Use the generic
setFilterRegularExpression here, to keep things portable between
5 and 6.

Change-Id: I6379be781aa3821b10ba783c088f82c1a0970911
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-01 20:36:49 +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
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
Alessandro Portale
2234c517c0 Utils: Add a non-toolbar variant of the "RELOAD" icon
New icon is: Utils::Icons::RELOAD. And the toolbar variant is now
Utils::Icons::RELOAD_TOOLBAR.

Change-Id: I811d83c7340a717968430ac1ce4a5c708c8ddcf9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-07 09:22:07 +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
hjk
758986ea0e ProjectExplorer: Store some aspect data by value in the RunControl
Change-Id: Idb7e119b5b0b483ce91efeb21fb415b654cfed4f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-05 13:45:25 +00:00
hjk
f9c221eb54 ProjectExplorer: Re-work setup runworker factories
This combines two of the previous three paths to create run workers,
and refers to RunConfigurations by id, not by type where possible
to decrease coupling between the classes.

Only allow "type of run configuration" and "type of device"
as the only possible kind of restriction and require a uniform
RunWorker constructor signature.

Adapt user code to fit that pattern.

Change-Id: I5a6d49c9a144785fd0235d7586f244b56f67b366
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-09 12:34:42 +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
Alessandro Portale
0933c20de8 connect() to ambiguous signals/slots: Replace static_cast with QOverload
Change-Id: I473d7a2a16509cee944a2a21b022a3f6f02cfd8d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 14:07:03 +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
hjk
741950a3aa Valgrind: Restructure plugin setup
Bring it more in line with the standard pattern.

Plus some cosmetics.

Change-Id: I2297c4e72892db386c50ece7dc64bdc89f0d9010
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-25 15:00:01 +00:00
hjk
68a10d71e7 ProjectExplorer: Replace RunControl::producer
... by two more specialized canRun() / createMainWorker() functions
resulting in somewhat leaner code on the user side and paving the
way for introducing a RunWorkerFactory class intended to follow the
now-canonical way of having factories as members in the plugin pimpl.

Change-Id: Id6fc2043a340203f14ab0b896a8dfa1e298f58a6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-20 09:16:08 +00:00
hjk
f20a924167 ProjectExplorer: Add RunControl accessor to configuration settings
Change-Id: I30e8f27d4090576d38fe8a778d7fa508ac26cbfa
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-13 12:49:13 +00:00
hjk
efb7d8deb7 ProjectExplorer: Split RunControl constructor
Into a trivial bit and two setters. Plan is to use it only with information
that is truly there (e.g. kit/device only) at the user side without having
to invent a RunConfiguration "handle".

Also remove some dead code in the test runner.

Change-Id: I987881e41722178b14b91f973b84cbdb67a9f85e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-12 16:38:45 +00:00
hjk
8e6ac695a8 Squash more deprecation warnings
What a pain.

Change-Id: I257e06c647933cc0b752c3c7a83a925b8b627e59
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-27 10:00:52 +00: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
Alessandro Portale
f5974ad993 Fix warning: "Don't call QVector::first() on temporary QList/QVector"
[-Wclazy-detaching-temporary]

Change-Id: I23f5cbd80bb92d3f9f1bfb5ae07493818958c5b0
Reviewed-by: hjk <hjk@qt.io>
2019-01-28 11:03:39 +00:00
Alessandro Portale
616e19ff9e Fix warning: "Missing emit keyword on signal call"
[-Wclazy-incorrect-emit]

Change-Id: I93bdc6e23cdaccf35c9899ae16870ccc65a54f80
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-01-17 15:54:56 +00:00
Orgad Shaneh
7162c7162a Callgrind: Fix enabling of KCachegrind action
Change-Id: I355730ff4bcf6579028066a6f1080cfb790b523e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-03 13:12:59 +00:00
Alessandro Portale
00ec6dfb5d Valgrind: Modernize
modernize-*

Change-Id: I6db60dce78cf2575e36caa597b1f095adba34fd9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-12-10 18:54:02 +00:00
Orgad Shaneh
7c56b2c310 Callgrind: Support opening last results in KCachegrind
Change-Id: Idb3b08ca6a1837f2456b73bcaf19aced5b83179f
Reviewed-by: hjk <hjk@qt.io>
2018-12-03 09:46:14 +00:00
Orgad Shaneh
2c212d48a5 Valgrind: Strip QLatin1*
Change-Id: If93ca890ab6d023ab786a5153f50a1dfa03764de
Reviewed-by: hjk <hjk@qt.io>
2018-12-03 09:45:47 +00:00
hjk
d421bc2fe3 ProjectExplorer: Split IRunConfigurationAspect
... into items that can be used generically in project configurations
(ProjectConfigurationAspect) and items that have a choice between
global and project settings (GlobalOrProjectAspect)

Change-Id: I94831237bdbb18c339eb76eba131bf7f928933d6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-09-18 06:13:21 +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
e9eb1a6437 Debugger/Perspectives: Go back to QPointer<QObject>
Lifetime of the pointed-to object may end before that of
the plugin, so unique_ptr is the wrong choice.

This amends 01f2b982a2.

Change-Id: I76b9ac78348d2ae1e7eff0693b091dbe8475ab93
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-02 08:56:20 +00:00
hjk
83024557d6 Valgrind: Proactively shut up sanity bot
It complains about alledgedly wrong spelling of "Visualisation"
in unrelated patches.

Change-Id: I047f2be4b534a7d01d8c0bc39ff22b615d2c0467
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-01 12:49:45 +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
07079a1613 Valgrind: Use the majority way to register run workers
Change-Id: I6423620a9a1917ab09b93038b020c36e9208b728
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-06-04 11:51:43 +00:00
Christian Stenger
e3fb057397 Valgrind: Add clear button to callgrind tool
Callgrind runs can spread TextMarks across files. Only way to
get rid of them would be to start a new analyze and stop it
before it can add new TextMarks.
Be user-friendly and allow clearing the data including the
TextMarks explicitly.

Change-Id: If8d5c5f789414709a110249377ce907466c0fdf1
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-05-15 12:03:57 +00:00
Eike Ziller
45f8d221bf Use FileName in TextMark
Change-Id: I3666d95dc8ef3b7da099d6d30f5cb4678a349493
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-03 06:51:47 +00:00
Orgad Shaneh
a23615e41c Callgrind: Use nullptr
Change-Id: I07c23d8bc48815e44ad340a6e37ee3b229866dbf
Reviewed-by: hjk <hjk@qt.io>
2018-03-16 10:11:24 +00:00
Alessandro Portale
cebb667023 Valgrind: Use OPENFILE_TOOLBAR in toolbars
Change-Id: Ib154f6352006b827b771d033eddc939ac4dc6dfe
Reviewed-by: hjk <hjk@qt.io>
2018-02-13 10:55:04 +00:00
hjk
0a2032e434 ProjectExplorer: Rename RunControl::finished to stopped
That's what it is.

Change-Id: I8cf9af23bb7cafe1cde8f165fdbf85cdeb79f7e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-12 10:06:34 +00:00
Eike Ziller
526e40cba3 Merge remote-tracking branch 'origin/master' into 4.4
Change-Id: I00fe351ee5f2689366c63ba94b042609c47da777
2017-07-04 13:55:35 +02:00
hjk
6e7a31c4fe Debugger: Move startupRunConfiguration to RunConfiguration
It's not really debugger-specific.

Change-Id: I2246e08d896df1d625ecce9b8b5428e7ea398851
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-04 06:48:13 +00:00
hjk
3408b1ed30 Valgrind: Simplify RunControlFactory setup
Change-Id: Ibef142e84ce1d4aca299dd8fa53b1eabcf517100
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-07-03 15:19:13 +00:00
hjk
629c137ef2 ProjectExplorer: Remove virtual RunControl start/stop trampolin
Not needed anymore, effectively replaced by RunWorker start/stop.

Change-Id: I7483c841cdd4e05c9e1f7636a27b20ece37947c2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-30 13:32:34 +00:00
hjk
04b03f79d9 Valgrind: Use Runnable to pass device information
... in case of "External Application" starts.

Change-Id: I6a5c215831f16c51e3cf98c35dbb792f53128d42
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-06-30 10:34:07 +00:00
hjk
682cd36b15 Valgrind: Remove starting() signal
It's only used internally as one-time communication between
worker and the *Tool singleton that handles toolbar button
states.

We basically start immediately after creation of the worker, so
any pre-start tool bar specific operations can be done at
RunWorker creation time.

Medium term, the runworker should proably steer "their" buttons
more directly.

Change-Id: Id6df703746ece5eebc23507739cd2a92ec55d11d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-06-28 09:05:43 +00:00
hjk
25a75d3fa3 Debugger, QmlProfiler et al: Replace AnalyzerStartParameter
... and QmlProfilerRunner::Configuaration by PE::UrlConnection,
and call it 'serverUrl' on the user side.

That's the only variant we ever had and avoids "translations"
between three structures that are essential the same.

Change-Id: I33386b2b8d2a7985ff934f6f8f840de0831bf9c1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-16 12:19:16 +00:00
hjk
4dac9c40bb Valgrind: Announce 'started', not 'stopped' on startup
Also provide a name for the workers.

Change-Id: I323c498db1eeb8225170aae080fdf084aa53e14a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-16 06:03:05 +00:00
hjk
89f02cba2c ProjectExplorer: Split Target and ToolRunners into smaller tasks
This increases re-usability of activities like 'port gathering',
and makes their use less dependent on actual device implementations.

Change-Id: I017cb74874f2b38c487ba2d03906a675d5618647
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-15 14:35:03 +00:00
hjk
d8bacfe9af Valgrind: Move to new target/tool split for local setups
Change-Id: I1167fdc147600c36149c13731d0680b858acf4fb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-02 07:46:29 +00:00
hjk
e063ca68d0 Debugger: Dissolve Debugger::ActionDescription
ActionDescription was a horizontal layer of convenience functionality
covering (only) ex-AnalyzerBase based RunControl start scenarios
and gets in the way of target/tool orthogonalization.

So continue the path chosen with the removal of AnalyzerRunControl:
Remove ActionDescription by inlining into user code, then orthogonalize
tool-by-tool, then generalize again.

Change-Id: Ib597df3f4ad7b06bef06644458fa13ddca53afdb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-04-24 09:52:48 +00:00