Commit Graph

235 Commits

Author SHA1 Message Date
hjk
9e67a9453a Debugger: Use a somewhat less intrusive hack for 'start at main'
Change-Id: Ie649a4a11c88f3686cd6ed1e73f34c7c78fd0e13
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-12 09:45:28 +00:00
hjk
e9718b253a Debugger: Partially dissolve DebuggerRunControlFactory
Aspect creation must stay for now as the object pool is the only
central registry for it right now.

Change-Id: Ibe42009db6b0351aaa36e9ac8f0f6f7a0562167e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-11 11:10:44 +00:00
hjk
6f0a600bcf Debugger: Streamline error string handling
Let the workers keep track of errors instead of passing around
string pointers in some but not all interesting places.

Change-Id: I3956bc947a50747dd3a0c9302b9f9873d192e9c6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-07-11 10:53:00 +00:00
hjk
acc86aee5a ProjectExplorer: Move re-runnable decision to RunWorkers
A RunControl is re-runnable if all its workers are,
a RunWorker is re-runnable if it's Stopped and unless it
says otherwise.

Also ensure SimpleTargetRunner only reportStop() once
per run and make process error message re-usable.

Change-Id: I73f5fb724d3026ceb81d5e32a3a71b4814b2bca9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-10 09:02:17 +00:00
Orgad Shaneh
af98652215 Debugger: Fix core dump with project from command-line
Change-Id: I223dc3c00aa7d4b2cda743a9292272387177ed93
Reviewed-by: hjk <hjk@qt.io>
2017-07-10 07:36:25 +00:00
hjk
eb0aa0b76f Debugger: Connect GdbServerPortsGatherer signals in constructor
Not in start(), when it would add extra connections on each re-run.

Change-Id: I5fe9e047a188276f3bde54227dc0509ab77366c4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-07-07 14:55:27 +00:00
hjk
8f1f333004 Debugger: Use a SimpleTargetLaucher for gdbserver
Makes remote output appear again in the Application Output pane,
and is arguably the right thing to do anyway.

Change-Id: I05c365eec43f60a85482b8ae7d5856b3a31ee6f8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-07-07 14:36:39 +00:00
hjk
8376afd9d7 ProjectExplorer: Remove RunControl::worker<Type>()
It looks like the case where workers need talk to each other by
only knowing the type of the 'partner' does not exist in practice
anymore. With the now-common setup of a 'primary' worker that one
can introduce the 'lesser' workers to each other directly.

That's also conceptually more robust that picking a partner by
type only only from some 'pool' (all the workers in a runcontrol),
scales better (it e.g. is imaginable that a RunControl needs
more than one PortGatherer in complex setups where more than one
device is involved) saves a few cycles, and even removes the need
for workers to be qobject_cast-able.

Change-Id: Ib3d8c942c893d6c198d9813cce7df28ba3260ce8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-07-07 10:56:25 +00:00
hjk
3610b2a825 Valgrind: Fix Memcheck startup on remote linux
Remote CallGrind is still dysfunctional.

Change-Id: Ib9ab537dc068c94c7e61ac48b1a4b9d655ccb60f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-06-28 15:39:21 +00:00
hjk
3a45d763ca Debugger: Remove DebuggerStartParameters::connParams
It's nowadays a duplicate of a subset of what DSP::remoteChannel
provides.

Change-Id: I95363bd392cb1d24fb1f1e0a2780c2c295929cea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-23 13:09:04 +00:00
hjk
e797f41759 RemoteLinux: Prepare for downstream Qdb adaptations
Change-Id: Ie00eb97cd0aeaf8eac193ead3048c180fe39808e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-06-23 12:43:09 +00:00
hjk
ffc97df7a6 Debugger: Remove remote setup sub-statemachinery
Not needed anymore in the world of RunWorkers.

Change-Id: Id7fb24fece6acb03de12f2677dd99a05c513e7a4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-06-22 12:28:08 +00:00
hjk
f99352df5c Debugger: Add a display name to GdbServerPortsGatherer
For debugging reasons.

Change-Id: I8136bbfb9a6558ab89f775e8e1410081cda3f95d
Reviewed-by: hjk <hjk@qt.io>
2017-06-15 07:47:13 +00:00
hjk
1d921ae044 Android: Convert into a RunWorker based setup
This moves all of the RunControl implementation into a single
RunWorker, not yet splitting it up into separate RunWorkers
which is the final goal of this series.

Change-Id: I7373105603505aa4fffd7fe5ff0145f0128b34bc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-12 06:38:40 +00:00
Robert Loehning
ceb9533f75 Debugger: Clean out fixupParameters
Change-Id: I01b1308f4d438b7e0cb4ae643b79abd285ea9db7
Reviewed-by: hjk <hjk@qt.io>
2017-06-01 14:27:59 +00:00
Robert Loehning
ae80651163 Debugger: Don't try to find two processes with same PID
Change-Id: I88500973f698db55b10528a61cf38de6ef248949
Reviewed-by: hjk <hjk@qt.io>
2017-06-01 14:26:49 +00:00
hjk
406ddaa36c Debugger: Remove DebuggerRunParameters::device member
The device is always available via runTool().

Change-Id: I4a2a791a5a75b32803c06fc34947b82b869fe31c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-01 13:49:17 +00:00
hjk
74a96bd0a6 ProjectExplorer: Fix debugger shut down
Change-Id: Ic74470aedc6d5b9d70858e21a73df1bcdb48ac49
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-05-29 07:17:00 +00:00
hjk
a7ad7f1766 WinRt: Port to RunWorkers
Keeping it as one blob for now, a proper split in the new architecture
would make WinRtRunnerHelper a RunWorker, too.

Change-Id: Ie310d05c1edf0ef9544b80743c140e44fcffc3ae
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-05-19 11:35:38 +00:00
hjk
36ec37b29d Debugger: Streamline ramping down
There were only two used target states, and in case of mixed
debugging all parts of the machinery better agree on the
direction. So one bool in the (shared) runTool is sufficient.

Change-Id: Iffbf1651b82dde707cfc37d8da9d3da573b34b76
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-19 09:56:49 +00:00
hjk
1f6764a54e Debugger: Move run parameters from engine to tool runner
The parameters belong to the run control, they should not
be triplicated in case of a combined engine.

Change-Id: I4dd84220edbd7a44b902cc52627fe01d0568db75
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-18 07:05:09 +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
2a46b1521d ProjectExplorer/Debugger/RL: Make run control state transitions more uniform
Forward all tool and target activities to run control, and initiate
further state transitions (only) from there. Also, make sure
tool/target's on finished() triggered on all finishing code paths.

After that, the base state handling is sufficient to handle remote linux
running and debugging.

Change-Id: I0150ef249c9ad0b7b8ac7192be6dc860c9ca8fc5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-05-05 11:17:49 +00:00
hjk
fcdc9342b5 Debugger: Normalize some state handling
Remove some now-unusual connection to RunControl::finished
and use a finished() callback in the ToolRunner implementation
instead.

Change-Id: Ieddf05a2258d9a300ac50a739d77d9cfaee10ca6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-04 12:53:13 +00:00
hjk
ba5d12e80f Debugger: Move some commonly used flags to base DebuggerTool
Basically all derived tools will need access to the debugger aspect
data. Fetch it once.

Change-Id: I054e4255a036db258201a8a501af244206c06990
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-04 07:31:50 +00:00
hjk
5d8d3fbdc7 ProjectExplorer: Extend centralized state handling
Add some customization hooks to make tools aware of target errors
and vice versa.

Change-Id: I4d815087297a3fa1d1d6d52daeed7c4ae0f624bf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-03 11:48:23 +00:00
hjk
4f6293db8f Debugger: Make showPromptToStopDialog static
No need to depend on RunControl life time here.

The isRunning test is already done outside sufficiently often.

Change-Id: I3b33444df6092f52b186bbf3a58585ad0bbb03bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-02 08:56:40 +00:00
hjk
e213585910 Debugger: Move part of engine startup to preparation phase
Change-Id: I414c356cd615096ee68588b839aaf975657fb7f9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-05-02 08:49:58 +00:00
hjk
6e990f96c6 Debugger: Remove DebuggerRunControl
Use plain RunControl + DebuggerRunTool combo instead.

Change-Id: Ib71b5eab50da667b9d71dcc6689d2643ad8ecdee
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-28 12:42:29 +00:00
hjk
c2ebce6849 Debugger: Reduce explicit DebuggerRunControl use
Aim is to replace it with its ProjectExplorer::RunControl base.

Change-Id: I30f837050e7c016887dc4b6cfef10b947f4f88ed
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-27 07:43:30 +00:00
hjk
07884645af Debugger et al: Move code from DebuggerRunControl to DebuggerRunTool
It's tool specific, so put it into the tool (only) related code.

The additional level of indirection will go again, plus the original
one will be removed once the *DebugSupport classes can directly
use DebuggerRunTool as base.

Change-Id: Ieaa386a0f7d724b09cedaaba8fb7d1e6dc4ad55b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-04-24 14:48:35 +00:00
hjk
ac86b2e8dd Debugger: One more sanity check
Change-Id: I2d788dd48415c4429f9456129e09e8fe1a9dffb9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-21 13:08:20 +00:00
hjk
d87afd4b89 Debugger: Make DebuggerRunTool publicly accessible
That's a temporary move to be able to port the per-target
Debug*Support classes one by one.

Change-Id: I3cf5f9ea367a68058add8713ed23f44da080a175
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-21 09:06:08 +00:00
hjk
dfb825e2a7 Debugger: Fix running on RemoteLinux
This (temporarily) works around the start up regression due
to wrong order of merged patches.

Change-Id: I7a386fb06175363aa23862716687764b930c52d8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-04-21 08:08:37 +00:00
hjk
d049a5be19 Debugger: Base magic Qml connection discover on base run control signal
Less debugger specific code and less convoluted paths in debugger
message handling.

Change-Id: Ib298889c386d65f17acbdfc585188097bb20ed74
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-20 14:57:57 +00:00
Eike Ziller
88897f3a87 Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/plugins/genericprojectmanager/genericproject.cpp
	src/plugins/genericprojectmanager/genericproject.h
	src/plugins/genericprojectmanager/genericprojectnodes.cpp
	src/plugins/genericprojectmanager/genericprojectnodes.h

Change-Id: Ie0c870f68c8d200a75489b75860987655b2f6175
2017-04-19 09:56:14 +02:00
hjk
5d97c4871a ProjectExplorer: Remove startRunControl()'s runMode parameter
It is redundant, as a RunControl has a runMode() getter.

Change-Id: Ia048b271a5003356d21f86a3f778827d23466037
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-04-12 12:11:49 +00:00
hjk
ee27248a56 Debugger: Streamline DebuggerRun{Control,Tool}Setup
Only one code path needed once we have a RunConfiguration.

Change-Id: Ib65f471a929a0c70694dd142b4f83be7eebbe151
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-12 11:56:44 +00:00
hjk
cd47065bf0 ProjectExplorer: Use a lambda to parametrize promptToStop handling
Less coupling than using virtual functions for better re-use.

Change-Id: Ibbab38175538f65c0f563129c87e01736ed220af
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-12 07:52:58 +00:00
hjk
27c8c74813 Debugger: Move engine construction into RunTool constructor
Makes using code closer to the intended run control/tool setup
pattern.

Change-Id: Id898338008588227e778fe3835b96740996c3691
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-11 11:29:16 +00:00
hjk
49b98f1149 Debugger: Make DebuggerRunTool (more) responsible for output
Make DebuggerRunTool accessible to downstream users, but remove
the non-standard handleApplicationOutput from the run control
itself to move it closer to the base run control.

LogChannel and Utils::OutputFormat should merge at some time.

Change-Id: I47b0f0067e1427b25e47036c3d4bc6ed5eed6189
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-10 13:13:11 +00:00
hjk
9177fd60ca Debugger: Introduce a DebuggerRunTool
The DebuggerEngine cannot be promoted directly as in case of
combined debugging we have three DebuggerEngine at the same
time, but the base RunControl is only (and should be) able to
handle one tool. So introduce a DebuggerRunTool base-RunTool
derived class that's only a thin wrapper on the (master)
DebuggerEngine.

Change-Id: I948833f4cff68c7d6e3dfa43b28328b862d6ae81
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-10 10:49:16 +00:00
hjk
48c25d4d2b Debugger: Reorganize RunControl creation
Move engine creation closer to RunControl creation, One step closer
to switching orders and making the engine a RunTool.

Change-Id: I37e9c4fcca9381cc0b8fb14b98c892eef8cb1215
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-07 12:05:06 +00:00
Christian Stenger
1024d25e93 Debugger: Remove output processor from RunControl
The same functionality is available by using signals of the RunControl.
This reverts ca3bcd81 partially.

Change-Id: Id1d4d6e8326be60cdbe7c862dab46f49dbc6abe7
Reviewed-by: hjk <hjk@qt.io>
2017-04-06 13:53:57 +00:00
hjk
8e56c5be3e Debugger: Simplify DebuggerRunControl construction
The indirection was to prevent "others" to create "wrong"
DebuggerRunControls, but this is getting into the way now when
making the DebuggerRunControls/DebuggerEngine a ToolRunner.

Change-Id: I6c45e28affebc6b8db16c5d4bbc77325ef63604f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-06 08:51:10 +00:00
hjk
0410f4e0ba Debugger: Remove some useless assignments
That object is destructed soon, no data is ever read back.

Change-Id: Ida479c4dd934c6f45621b54adcfeda3f573a00bd
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-04-05 15:26:50 +00:00
hjk
2360a2d743 ProjectExplorer: Run RunControl::{start,stop} always asynchronously
This introduces a mini-state-"machine" to handle RunControl states
Intialized->[Starting->Running->Stopping->Stopped->]*->Finished.

Needing time between trying to start and getting feedback is nowadays
the normal setup for all remote targets as well as for most local tools.
Making that the default for all runs simplifies the code and provides an
opportunity to (a) fix some currently wrong reports of "stopped
immediately" and (b) to remove target-specific (WinRT) or tool-specific
(Valgrind, GammaRay) state members doing essentially the same.

Change-Id: I7f52fee41144188ee8389e922fdc265f8c0a6459
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-24 13:37:46 +00:00
Tobias Hunger
e07c6383d7 ProjectExplorer: Unify RunControl setup/teardown
Provide protected methods in RunControl to handle the notification
of when the RunControl starts and stops. Use these helpers to
move the isRunning() method into the RunConfiguration itself instead
of reimplementing it everywhere.

Change-Id: Ia8de42f7a6a14a049870d4e7fcb9af6756c2caa4
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-01 12:46:59 +00:00
hjk
32ae4d3e09 Debugger: Use Utils::ProcessHandle for DebuggerEngine::m_inferiorPid
That's the intended "typesafe" use.

Change-Id: Ib288fe87a47bd9484bda83e05406f0d22989b3c2
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-03-01 07:56:18 +00:00
Christian Stenger
beec36c7d3 Debugger: Allow debuggerruncontrol creation with warnings
Change-Id: I50092cb99c24ab31fafb1b5ce3c0b371adc42f38
Reviewed-by: hjk <hjk@qt.io>
2016-11-10 05:46:06 +00:00