Commit Graph

379 Commits

Author SHA1 Message Date
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
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
524a1f431c QmlProfiler: Use standard setup for runner setup
Code-wise no immediate advantage, but removes the need for the
unusual 'started' signal.

Change-Id: Ie1d99127e8fe1561c35e035894ee5dd4639d3f12
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-09-03 07:09:05 +00:00
hjk
2399e4476b QmlProfiler: Reduce code size for feature menu setup
Change-Id: Ied31be4c880f2e38935830e35afb20435d7f74b2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-09-02 10:10:33 +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
0a19b8e115 QmlProfiler: Avoid a deprecation warning
Change-Id: Ie30d30d304faf71dee36c8ae3a37e8974af99bf3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-30 08:14:20 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
Eike Ziller
4545c81e57 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	doc/src/howto/creator-sidebar-views.qdoc
	doc/src/howto/creator-ui.qdoc
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/autotest/testresultmodel.cpp
	src/plugins/autotest/testresultmodel.h

Change-Id: I24cc585ca7782cb1d9cb0b8b73b46892b41937fd
2019-05-08 12:41:25 +02:00
Ulf Hermann
4cee3c845c QmlProfiler: Unconditionally disconnect on handleStop
We need to do this in the remote connect case as the application itself
will not disconnect.

Fixes: QTCREATORBUG-22273
Change-Id: I1b343fd7d8658ce8d9aa5bf21b610940507d0dd4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-06 08:02:29 +00:00
Ulf Hermann
c70f59075d QmlProfiler: If disconnected while serverRecording, show warning
... unless we actually triggered AppStopRequested. Furthermore, don't
clear the data in that case. The incomplete data could still be of some
value, and we call finalize() later on, which would otherwise confuse
the trace manager.

Fixes: QTCREATORBUG-22187
Change-Id: Ic4373201d6e9f29583186708a7acb6ba2ddcd502
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-24 07:33:06 +00:00
hjk
e6adb8aabf QmlProfiler: Avoid a direct use of runControl->runConfiguration()
Change-Id: Ib9caba243c3a41b11ff983b9ce764f69faeb8829
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-03-19 17:18:33 +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
Alessandro Portale
3115d082d3 QmlProfiler: Compile fix
Change-Id: Ie9d593179c26a24a473de9d537968aabaffc67c5
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2019-03-13 12:25:57 +00:00
Robert Loehning
83f54fda0d QmlProfiler: Fix variable name
Change-Id: I01e8981c440d7e6fe35793b659f477fb8da85e06
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-03-13 11:22:01 +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
9ef0b97716 Avoid some visible uses of RunControl::runConfiguration()
For a long time, probably from the very beginning, a RunControl
was meant to hold (a copy of) data needed for its operation, that was
valid at the time of its construction, to be resilient in cases
where RunConfiguration setting were changed while the RunControl
was running, or to properly re-run with the original settings.

Unfortunately, the task was repetitive, as RunConfiguration
classes had no generic access to properties / "aspects"
and there was was the runConfiguration() accessor (probably
for mostly unrelated reasons in the output pane handling) which
made the idea of just casting that to the original runConfiguration
and access the data directly there appealing, with all the
expected consequences.

This patch here partially addresses the issue by copying some
more of the related data at RunControl construction time and
adjust the using code, avoiding most uses of the runConfiguration()
accessor in a mostly mechanical matter.

Complete removal appears possible, but will be less mechanical
in "difficult" plugins like ios, so this is left for later.

The new accessors in RunControl are very much ad-hoc, leaving
room for improvement, e.g. by consolidating the access to the
run config settings aspects with the other runconfig aspects
or similar. For now the goal is to remove the runConfiguration()
accessor, and to as much as possible fixed data after RunControl
setup is finished.

Next step would be to officially allow construction of RunControls
without a specific RunConfiguration by setting the necessary
data independently, removing the need for the various workarounds
that are currently used for the purpose of faking (parts of) the
effect of the non-existing RunConfiguration or refusing to operate
at all, even if it would be possible.

Change-Id: If8e5596da8422c70e90f97270389adbe6d0b46f2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-12 12:27:35 +00:00
Eike Ziller
c129b8cfe2 Merge remote-tracking branch 'origin/4.9'
Change-Id: Ieed07c7fd0f422f8e1a96877c07916c7c1c1816e
2019-02-11 14:50:08 +01:00
Ulf Hermann
8789c5ab71 QmlProfiler, PerfProfiler: Properly style panel widgets
We need to set the "panelwidget" property for the foreground color to be
set. Now that we do this correctly we don't need to hack around in the
palette anymore in QmlProfiler.

Change-Id: Icdc737e1c74d16ec76a12dbbdf6f8f64062bd19c
Fixes: QTCREATORBUG-21961
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-11 12:13:22 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Ulf Hermann
39eec848ce QmlProfiler: Delay creation of views until activation
We don't need to waste the time and memory required to create the views
if they are never shown.

Change-Id: I56add08981c90263e6735f5b7e6fac2140b457e4
Fixes: QTCREATORBUG-21894
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-01-28 12:37:45 +00:00
Eike Ziller
0345bcb7cc Help: Rename handleHelpRequest to showHelpUrl
Since that is what it does.

Change-Id: I13ffe21cdb625a0df1313f2ff09bf84196f08768
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-01-25 08:23:18 +00:00
Alessandro Portale
d1df55d128 QmlProfiler: Modernize
modernize-*

Change-Id: Ibdf9c0ae91bf8a622facc7f323112b550f532f15
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-12-02 14:27:29 +00:00
hjk
1c9410e353 ProjectExplorer: Rename 'extraAspect' to 'aspect'
Using aspects is the standard pattern nowadays, there's nothing 'extra'
to them anymore.

Change-Id: I446f9d7b1db58a4899e5e44df33ce51f655e7be4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-02 08:32:51 +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
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
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
Ulf Hermann
27907bc417 QmlProfiler: When retrying to connect, double the timeout
If you are retrying, then probably you want it to be more patient this
time. Also, tell the user how long we have waited and how long we are
going to wait when retrying.

In turn, reduce the number of "internal" retries. Retrying 10 times
should be enough to determine if the given timeout is too short. This
will give us an initial waiting time of 2s, and make the second try 4s.

Change-Id: Ibdfe02d041550eb16cadc59cec1b78ce97289b30
Task-number: QTCREATORBUG-20529
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-06-06 12:44:47 +00:00
Ulf Hermann
92530fd05d QmlProfiler: stop trying to connect when the application quits
Change-Id: I3b33ced218320a19fd4e4e834093c0f3b67a8cba
Task-number: QTCREATORBUG-20499
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-06-04 08:28:18 +00:00
Ulf Hermann
7b08624ae7 QmlProfiler: Only consider data as lost if we are recording
If the server stopped recording before breaking the connection, we're
fine.

Change-Id: Ic6d57cd4eb7c831cdd8aca1f305b44b9ecbd10dc
Task-number: QTCREATORBUG-20530
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-31 12:01:29 +00:00
Ulf Hermann
7a68196328 Tracing: Don't change visible features on clearing and replaying
This used to be important for the mockup in the Timeline, but as the
mockup looks just fine with all available features visible, we can drop
it. As TimelineModel::clear() clears the "hidden" flag, we have to
restore that one on initialize(), though.

As a side effect the visibility settings are retained across profiling
sessions now.

Task-number: QTCREATORBUG-20503
Change-Id: I1512ab7e494ed79d20e2097d68f8494990cfecbb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-31 07:12:04 +00:00
Ulf Hermann
5e66f834e3 QmlProfiler: Keep text marks when replaying events
The text marks are conceptually part of the type storage, not the event
storage. We need to hide them on initialize and show them again on
finalize, though, so that they get updated.

Task-number: QTCREATORBUG-20506
Change-Id: I5fe50110b99ea81b9a7585758a30fcad98bfcaa3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-30 07:49:38 +00:00
Ulf Hermann
6b9ff15ad5 QmlProfiler: Move action registration out of QmlProfilerTool
This enables us to have multiple QmlProfilerTool instances without
conflicting action registrations. Ultimately there should be a way to
unregister actions, or to add some extra description on which tool
instance they refer to, but this is a minimal first step.

The main problem this fixes for now is the warnings generated by the
tests.

Change-Id: I2193fc48a5a68c52f46e5567919f3035bc93df36
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-29 12:14:58 +00:00
Ulf Hermann
bd659b2b99 QmlProfiler: Clear the model manager before deleting it
We cannot have the model manager clear itself from the dtor, as the
order of deletion between the various other objects parented to the tool
is undefined. Make sure we get into a clean state before the model
manager disappears.

This fixes the soft asserts when the tests shut down.

Change-Id: I8fcd52a7c2d0703cbdd215d85aa1d80c2e3296a3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-28 12:54:39 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
Ulf Hermann
1770c2ffe2 Remove TimelineTraceManager::State
This is redundant, now that we have registerFeatures().

Change-Id: Ia56c28b8892ab6da694570fe4b9ea5c96fe194f1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-23 14:20:16 +00:00
Ulf Hermann
1c2e0f387f QmlProfiler: Move parts of model manager and trace file to Timeline
This way we can use the trace file loading and saving mechanism for
other profilers.

Change-Id: I98ec1cdde6f7abcea152cabf72e64d4e696dfa59
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-19 08:09:07 +00:00
Ulf Hermann
7f7fe1a9db QmlProfiler: Avoid some 0 as nullptr warnings
Change-Id: I4763a22c6624eaffbb583bf26bf74a3e282b042f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 13:19:30 +00:00
Ulf Hermann
7ca958fa85 QmlProfiler: Integrate TraceTime into ModelManager
We never use it independently and only a subset of its interface needs
to be public.

Change-Id: I97bbc638270bcbb8fb1a4097fcfeacf37e96c048
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 12:17:23 +00:00
Ulf Hermann
1ccd058bdf QmlProfiler: Get rid of processing step
The child models are made aware of possible changes in the details
strings, and in turn, we can do the finalization immediately after
acquiring is done.

Change-Id: Ibe57f158e64e5d01d4c97aa617c9b2bcc8e4e96e
Task-number: QTCREATORBUG-20106
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 09:13:04 +00:00
Orgad Shaneh
eea6a7c3b3 Utils: Purge qtcfallthrough.h
No longer needed.

Change-Id: I9b0bee014df89d4c567f1d2431b5ff9404f5f925
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:13 +00:00
Tobias Hunger
0153c0000f QmlProfiler: Fix warning about unused lambda capture
Change-Id: Ib5abc199f55f3cf57d3db92c50c85ab303a208b9
Reviewed-by: hjk <hjk@qt.io>
2018-03-06 14:19:06 +00:00
hjk
da33f94e20 QmlProfiler: Pimpl QmlProfilerPlugin class a bit more
... to be able to remove an unneeded use of the global object pool.

Plus some code cosmetics.

Change-Id: Ifdb0ff9cd40820a34a8951563402a50a594e4fdd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-02-19 10:17:36 +00:00
hjk
75e71d5997 QmlProfiler: Remove a few uses of ActionManager::instance()
The used functions are static nowadays.

Change-Id: I1c7ce9765fba111fd3104cf151a519fd89818081
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-02-02 13:18:27 +00:00
Eike Ziller
0837f974da Merge remote-tracking branch 'origin/4.6'
Conflicts:
	qtcreator.pri

Change-Id: I7dcd8e067b7597144eb3b27d917cb7fe0279aad4
2018-01-19 12:05:11 +01:00
Ulf Hermann
5555b7137b QmlProfiler: Defer chained state changes
If the state is changed again from a signal handler before all handlers
for the signal have been processed, we can get confusing results. Defer
those calls.

Change-Id: I73f7b8faa48ee00c17fdedb4140823d7a1b13435
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-17 14:27:29 +00:00
Ulf Hermann
f9a3ac7f08 QmlProfiler: Also handle RunControl::finished() signal
If you force-stop an application by closing the output tab, we don't get
a stopped() signal. In order to properly reset the UI we need to handle
the finished() signal then.

Change-Id: Ibab5faf86542a59c3eb3aa139bb3dc66afe89ce2
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-17 11:33:16 +00:00
Ulf Hermann
e1ad7a1784 QmlProfiler: Drop static accessors from QmlProfilerTool
It wasn't really a singleton even before. For testing purposes make the
client/state/model managers accessible.

Change-Id: Ie5efbc47a6b9119495f999e4e05877d4789da407
Reviewed-by: hjk <hjk@qt.io>
2018-01-11 14:04:13 +00:00
Ulf Hermann
58ae456f4b QmlProfiler: Verify attached RunControl stops when connection closes
Change-Id: I2b7bd63c4e84fcb0e78318f810ed54e58468d05e
Task-number: QTCREATORBUG-19496
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-09 17:02:05 +00:00
Eike Ziller
cff2cc90e2 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/cpptools/clangcompileroptionsbuilder.cpp
	src/plugins/cpptools/clangcompileroptionsbuilder.h
	src/plugins/cpptools/compileroptionsbuilder.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.h
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.h
	src/shared/qbs

Change-Id: I364ababc5d41046d17e999096c4a7187c4e4e010
2018-01-09 13:13:00 +01:00
Ulf Hermann
4a5bd323a9 QmlProfiler: Retain event types between sessions on same connection
The server won't re-send the event types. We need to keep them until the
connection goes away. Otherwise we get invalid event types and soft
asserts when trying to look up event types for new events. Also, when
clearing the event types, also clear the server type IDs. Not clearing
those constitutes a memory leak.

Change-Id: I564b0c4cf0ed754549d2b8ede63c97fa01affcec
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-03 13:51:47 +00:00