Commit Graph

80 Commits

Author SHA1 Message Date
hjk
597488bef4 Debugger: Move some code around
Parts of the Debugger engine rampdown mechanisms are
essentially one code path now, don't distribute that
over four classes.

Change-Id: I4c6edbc0db94d1f658b0c1d9c154552f286db876
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-19 14:10:42 +00:00
hjk
3d11a27ad0 Debugger: Consolidate "Attach to running process"
Change-Id: I78e89a662140f37f5f9719dbbbff070f1e2fbe84
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-19 08:31:33 +00:00
Filipe Azevedo
9ebe266ae5 Add public api to set the inferior environment
This is needed for the GammaRay plugin.

Change-Id: Ia76c02756e9deb6f679c871a5cba1f6fc4c5028f
Reviewed-by: hjk <hjk@qt.io>
2017-10-16 11:49:44 +00:00
hjk
f1888a6331 Debugger: Remove no longer needed DebuggerEngine::setNeedsFixup()
Change-Id: I30bc1d6184bd66a634d890999e31dff48d2f25b4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-13 12:36:20 +00:00
hjk
55d9fac2fb Debugger: Clean up outdated includes and files
Change-Id: I1b4b84ff9bfa3f6e0fe3030d70a114e2cf0f0604
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-05 08:06:43 +00:00
hjk
b11f304ffb Debugger: Remove more non-const acccess to start parameters
Change-Id: I1311b652bb56ef4b9b51cca6b39be2b2215e0074
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-28 07:42:24 +00:00
hjk
895acd23e3 Debugger: Move external terminal into separate RunWorker
Change-Id: Ifb9701f840195ba90db48a0f6fa07b28e0409648
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-27 12:16:19 +00:00
hjk
295d3d7170 Debugger: Avoid use of dummy RunConfigurations
Allow to rely on kit plus data directly specified in the dialogs.

This means, RunControls with nullptr RunConfigurations are allowed
again.

Change-Id: I0b574b397603c0520c8187a8967bff2cf5e20ae8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-26 06:29:31 +00:00
hjk
0a226c77b0 Debugger: Replace RunParameter::languagues by individual bools
There was almost 1:1 overlap with DebuggerRunTool::is{Cpp,Qml}Debugging,
use one version only.

Change-Id: I4a8f2b7005d3f2e440cdab3eaf6ac476af894308
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-21 10:33:39 +00:00
hjk
434e895b73 Debugger: Remove parts of the engine parameter fixup phase
The idea is that the fixup should not be needed at all anymore,
instead, static data coming e.g. from the RunConfiguration should
be setup in the constructor, and everything else should be ready
at entry into start().

This also proceeds on path to the planned-but-never-implemented
idea that the RunConfiguration should (at most) be accessed at
RunControl creation time, not later.

Change-Id: I04d622785f5de628a7bb479bc0c39aff7d6cce01
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-20 11:49:15 +00:00
hjk
d2aaa26653 Debugger: Remove DebuggerRunTool::setRunParameters()
It's all coming via individual setters now.

Change-Id: I373f43963e696fa7223f9d664de1df1bc8b021e5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-18 13:01:28 +00:00
hjk
7eec0f63ac Debugger: Merge DebuggerStartParameter into *RunParameters
The users (typically target specific DebuggerRunTool derived classes)
are meant to use the individual setter functions nowadays, not the set
up the full structure, so the members are a true implementation
detail now.

Change-Id: Ida04801e3230a2fe8bbadde8845e58c3077c87a5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-13 14:00:59 +00:00
hjk
67b4a7a872 Debugger: Replace a few more uses of setRunParameters
Change-Id: I8f35bcd3812402cda7d3c69eb01ed3d3fb9e396a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-13 06:26:36 +00:00
hjk
001d4c10a7 Debugger: Remove use of setRunParameter() for state auto test
... which are disabled anyway.

Change-Id: Id15de0e5b766373570d89bacf02464e46f5b2b89
Reviewed-by: hjk <hjk@qt.io>
2017-09-12 15:34:23 +00:00
hjk
c26149dc43 Debugger: Integrate setupEngine() into tool start()
... a step towards abandoning the engine-related bits of
the debugger state machinery. The base RunWorker states
meant for that are good enough now.

Change-Id: I3b269bdeb66f14a956b76e6a7e8258f45b3e59e5
Reviewed-by: hjk <hjk@qt.io>
2017-09-12 14:36:22 +00:00
hjk
808f192ff8 Qnx: Dissolve a QnxDebugSupport setRunParameter() use
Change-Id: I54cacf6dbcb5f68a2f063e41a86fc6d0c33da900
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-11 07:58:28 +00:00
hjk
e44d16e3de Debugger: Remove convenience DebuggerRunTool constructors
Use setRunParameters() for now, and individual setters later.

Change-Id: If7d044ea249b79ce117897a976659e9302bfc544
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 13:53:51 +00:00
hjk
440f2ba028 Debugger: Dissolve a few more setRunParameter() cases
Change-Id: I92d7b75c9a9758ab8c2ad8f9956ebcd8ecc9cb69
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 13:42:18 +00:00
hjk
49c14f5616 Debugger: Remove non-unneded DebuggerRunTool::setStartParameters
Change-Id: I5647f0c7232fbc12c66902a42c7a09f47cdef547
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-07 07:19:21 +00:00
hjk
5e871ddb65 Debugger: Dissolve createAndScheduleRun()
... into DebuggerRunTool creation and explicit RunParameter bulk setting,
which later is to be replaced by setting individual parameters.

Change-Id: Ic4d2c6d10d659287ae61fdb4db735e658e3a68ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-07 07:08:47 +00:00
hjk
706fb1a2b6 Debugger: Make setFixupNeeded() accessible to user code
Change-Id: I470b91e5ad80f2086f49c48d00975dd66444aa30
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-05 13:41:29 +00:00
hjk
0a5abdae59 iOS: Adapt to new setter-based DebuggerRunTool interface
Change-Id: I96f113b831dcbd3735f743c8f12042e9b17903a4
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-09-04 11:59:04 +00:00
hjk
82ce3c885f Debugger: Extend new setter based interface
Needed for WinRT and BareMetal

Change-Id: Iad8b4c36df6f004f74cb66dbf730b2ca43a0e413
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-25 11:00:43 +00:00
hjk
503a73d527 AutoTest: Use new setter based DebuggerRunTool interface
Change-Id: I559bef1b088af9009247542730208d18b514b118
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-08-25 05:50:16 +00:00
hjk
d34f33d8d7 Valgrind: Extend and use new DebuggerRunTool interface
Change-Id: I5e015a484e67175be12d538e7f814d61001ad7bb
Reviewed-by: hjk <hjk@qt.io>
2017-08-24 16:21:23 +00:00
hjk
ce62181cb8 Debugger: Add a few convience setters for some run parameters
The idea is to use them later to make the DebugRunTool setup leaner.
As proof of concept, use the new interface in LinuxDeviceDebugSupport.

Change-Id: I045ba4d05cfc56a9e875fd4461e9f562153872dd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-08-24 15:21:27 +00:00
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
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
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
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
c060571fcd BareMetal: Avoid use of otherwise unneeded requestRemoteSetup() signal
Note that this changes the startup timing in the StartupOnNetwork
case slightly, as the application launch is now triggered in
parallel with the gdb launch.

Change-Id: Iaa0b60b8c478eb47abb6e93fbd3b326e0acdd13b
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-19 10:43:19 +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
hjk
a37c8add58 Debugger: Fix QmlInspector state update connection
Change-Id: I1693d593ec08c14c48b2c2800ce2f240f9e5f438
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-19 13:07:01 +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
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
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
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