Commit Graph

492 Commits

Author SHA1 Message Date
David Schulz
7293c01210 Debugger: Fix inappropriate debugger warning when using mixed debugging
Change-Id: I3fb1818e36d01f69cca6ad07653afdc49bda702e
Reviewed-by: hjk <hjk@qt.io>
2017-06-23 05:25:54 +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
a55a376b1d Debugger: Fix crash on ramp down
Change-Id: I76aab19d92eae10823196a4c6dc9a2c400d47e80
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-19 09:24:49 +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
David Schulz
118faf1180 Debugger: Fix warnings for inappropriate debuggers
Change-Id: If463c18d1d04cdd78b6be34e98b76c8df89594f2
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-30 05:35:25 +00:00
Orgad Shaneh
d84a6ed411 Debugger: Fix state transition warning
*** UNEXPECTED STATE TRANSITION:  "State changed from DebuggerFinished(22) to DebuggerFinished(22) [master]"

Change-Id: Iddacafbe337b95aa441aecbaf3ebf85c08a83d81
Reviewed-by: hjk <hjk@qt.io>
2017-05-29 06:22:29 +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
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
5955901f93 Debugger: Compile fix after e213585910
'prepared' got renamed to 'reportPrepared' in the mean time.

Change-Id: I2426e8ab156df642525d42feeedcd3692c7c8ac8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-02 09:02:57 +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
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
384d141aac Debugger: Use a qobject_cast instead of some static_cast
The underlying assumption may be violated soon, make it
easier to debug if it breaks.

Change-Id: I7511d5677659e266f2d01db8bafb46bcd93d7f7b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-21 11:59:41 +00:00
David Schulz
890e7546e4 Debugger: Merge prepareCommand
Change-Id: Idd316a88ae39d563c99d3b4081f88fc41e604499
Reviewed-by: hjk <hjk@qt.io>
2017-04-19 09:05:09 +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
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
Wolfgang Bremer
60379856a4 Provide human readable debugger states
The debuggerengine has an internal state machine. This change provides
the state name instead of the states number for debugging purposes.

Change-Id: Ic8d63902e83e3905d7880a703302cb597174460b
Reviewed-by: hjk <hjk@qt.io>
2017-04-06 12:44:40 +00:00
hjk
716f6e7f1c ProjectExplorer: Make RunControl::bringApplicationToForeground virtual
No practical change as the only case that is used so far are local
setups on Mac. It's a conceptual change, though, giving concrete
RunControl implementation the chance to act "sensibly", e.g. by
raising a locally running simulator control in case of remote setups
or such.

Change-Id: I5679428934fe08b8c9756f3906ee3d9073278822
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-01 16:26:18 +00:00
hjk
329db5f4cc Debugger: Use ProcessHandle in notifyInferiorPid()
Change-Id: Idcb6819b64964b6aa0e72d182cc628feba37ba55
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-03-01 11:57:48 +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
hjk
7c29ae462b Debugger: Fix crash in combined debugging
Fixes regression introduced in f8ad72deb3: Slave engines don't
have a RunControl pointer of their own, use the master pointer.

Change-Id: I1c695a1454cafc3532fb1b79374fac4f3ead607e
Reviewed-by: hjk <hjk@qt.io>
2017-02-28 08:00:05 +00:00
Tobias Hunger
f8ad72deb3 Debugger: Report PID back to RunControl
Change-Id: I4830d2703de86c3fce8356271a2262c14c8f1307
Reviewed-by: hjk <hjk@qt.io>
2017-02-27 12:34:03 +00:00
hjk
66b19f334d Debugger: Provide a startup customization hook for 3rd party plugins
Change-Id: Ia587abcb1bdcdfbf192d3314610ec9addf370c9b
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-23 14:48:28 +00:00
hjk
3e8a1ea7ad ProjectExplorer: Move ProcessHandle to Utils for further re-use
Also, use qint64 instead of quint64, as this is what Qt uses.

Keep 0 for invalid PIDs, even if arguably -1 would be better,
but Qt uses 0, too.

Don't move 'toString', instead inline it into the only
caller, keeping translations intact.

Task-number: QTCREATORBUG-17596
Change-Id: Ie9411ea1d2031a5ab0a99bcb3ff48ee430afe254
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-17 11:19:12 +00:00
Eike Ziller
589fedf455 Merge remote-tracking branch 'origin/4.2'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/projectexplorer/kitinformation.cpp

Change-Id: I94299b069418586db97d1d596a252794e4037556
2016-12-20 17:14:19 +01:00
hjk
fc01d0ac46 Debugger: Use new shared result reporting infrastructure
Unify the watchPoint() interfaces, move the combined
implementation to the DebuggerEngine base.

Change-Id: Ic93aa760e7258197aed5eb7bfea257a40012cccf
Reviewed-by: hjk <hjk@qt.io>
2016-12-16 07:41:43 +00:00
hjk
26331f771a Debugger: Avoid messagesboxes on the same topic at the same time
Task-number: QTCREATORBUG-16971
Change-Id: I625f04cbd8f609c66597450dbad22ebc6eadcfe5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-12-14 14:10:14 +00:00
Orgad Shaneh
9c09ca9e42 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ia98031eb87f1859c3736faa0cdd8b655e8a50689
2016-11-14 11:17:13 +02:00
Orgad Shaneh
f572f7da39 Debugger: Prevent popup on shutdown when debugger is running
* Run a debugger (of any kind)
* Close Qt Creator window
* When prompted to shutdown choose Yes
* An error message box appears with "Unexpected GDB exit"

This is not a real solution, but a quick hack to make the error message go.

2 soft assertions are also hit on this case:
SOFT ASSERT: "state() == EngineShutdownRequested" in file debuggerengine.cpp, line 1130
Debugger::Internal::GdbTermEngine(0x55ef651cea30, name = "GdbEngine") "InferiorShutdownRequested"
*** UNEXPECTED STATE TRANSITION: Debugger::Internal::GdbTermEngine(0x55ef651cea30, name = "GdbEngine")
"State changed from InferiorShutdownRequested(16) to EngineShutdownOk(21) [master]"

SOFT ASSERT: "state() == InferiorShutdownRequested" in file debuggerengine.cpp, line 1068
Debugger::Internal::GdbTermEngine(0x55ef651cea30, name = "GdbEngine") "DebuggerFinished"
UNEXPECTED STATE: 22  WANTED: 16 IN gdbengine.cpp:1841

They are *not* addressed in this patch.

Task-number: QTCREATORBUG-16770
Change-Id: I419f134e527a154dfbe1c85a3fd6629597a363f0
Reviewed-by: hjk <hjk@qt.io>
2016-11-14 07:37:53 +00:00
Frank Meerkoetter
e3b38b8a34 Fix dead stores in the debugger plugin
Found via the clang-static-analyzer

Change-Id: Ic461a8c369bef60081f7c2dfd9d6a778c64dbda0
Reviewed-by: hjk <hjk@qt.io>
2016-11-07 16:56:47 +00:00
Ulf Hermann
d771ba8921 Debugger: Don't clear unrelated views when updating locals
If the list of partial expressions is empty we need to tell the watch
handler that we are only updating the locals view, not e.g. the
inspector view.

Change-Id: Iedc74ffc66a8435faa272d053849b831f6b8cbbe
Task-number: QTCREATORBUG-16692
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-11-04 09:35:10 +00:00
Christian Stenger
ca3bcd811e Debugger: Provide way to process debuggee output further
Output coming from the debuggee was limited to be printed inside
the DebuggerLog and the Application Output pane, but the output
might be useful to process differently or even additionally to
the default logging.
Provide functionality to be able to add an output processor.

Change-Id: I715b90b28c64d3cf95bcc2a047a5aba1a56d1058
Reviewed-by: hjk <hjk@qt.io>
2016-08-31 04:39:16 +00:00
hjk
7c287eb6f9 Debugger: Drop Location::init()
We can do better with C++11.

Change-Id: Ie9e9cd4dfbbfc4ba29c0aa6bbfdf33ae7ac184fe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-22 08:45:22 +00:00
hjk
588443b259 Debugger: Use a StandardRunnable for the debugger process
One step further to separate the debugger environment from the
inferior environment and to make it possible to configure a
working directory. Guessing one from the inferior's working
directory is not always a good idea.

Change-Id: I33d139c0f228ec0870556b82bc6aecca0a8e62d6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-04 10:07:43 +00:00
hjk
6e925910b4 Debugger/BinEditor: Standardize interface
Change-Id: I4acf6bc7648e57c564e86023176ae3905a293a99
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-07-21 06:20:52 +00:00
hjk
2d79bdc29c Debugger: Remove some uses of semi-global currentEngine()
Make use of recent TreeModel improvements in various
tool views, push more operations into the engine-
owned data models, specifically context menu creation.

Change-Id: I479c97102b9fb81611c6461c6df1cec59295179a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-07-18 11:17:53 +00:00
hjk
2a104dcfe7 Debugger: Consolidate icon storage handling
We settled now on global objects being fine for the purpose
in Core and ProjectExplorer, so there's no point in using
something more fancy in the debugger.

Change-Id: I72e45f398c09d22894419c274dfbea77da0fc153
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-28 14:28:01 +00:00
hjk
5199f84f60 Debugger: Clean up debuggerengine.cpp
Some leftover stringfreeze workaround, plus QLatin1*.

Change-Id: I5e143af5cda64cb29b7769174187fc86185a89cb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-06-28 14:07:09 +00:00
hjk
78a800cb34 Debugger: Use dedicated structure for Qml server parameters
The main idea is to start using ProjectExplorer::Connection later.

Change-Id: Ie91eacdfb0e93ae142fec7ce32bcf554a5282122
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-14 06:25:34 +00:00
hjk
726b907cc3 Debugger: Remove debuggerstringutils.h
With QT_RESTRICTED_CAST_FROM_ASCII making GdbMi etc operate on
QString is feasible again. Take this as opportunity to move
debugger encoding handling closer to a 'conversion on input and
output if needed, storage in QString only' scheme.

Change-Id: I2f10c9fa8a6c62c44f4e6682efe3769e9fba30f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-09 08:09:46 +00:00
Eike Ziller
73bb92c5a6 Merge remote-tracking branch 'origin/4.0'
Change-Id: I89c52ca2145a43c94d3366367ba72fde605dd577
2016-05-31 12:02:13 +02:00
hjk
74b6d2e708 Debugger: Clean up GdbEngine member data on finish
Restarting with cached outdated information is problematic.

Change-Id: I396da2fef96a161c1ab150134b8e65a758a16d58
Task-number: QTCREATORBUG-16355
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-27 12:34:20 +00:00
Eike Ziller
0c5bae640b Merge remote-tracking branch 'origin/4.0'
Change-Id: I80bc3371c6d7cf9f2d46cbcf8e79e4761213d8aa
2016-05-27 12:01:36 +02:00
David Schulz
0aca5808cb Debugger: Fix creator crash on spontanous debugger exit.
Task-number: QTCREATORBUG-16233
Change-Id: I27b9ab17243463924dc410b3b5ffb0795ef3e33c
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-05-19 05:00:07 +00:00
Eike Ziller
ec231b5910 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/valgrind/valgrindruncontrolfactory.cpp

Change-Id: I96c0f8cc3b49f8f55f45ef1f839857f878f532f4
2016-05-18 12:12:46 +02:00