Commit Graph

480 Commits

Author SHA1 Message Date
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
hjk
e9e47ab452 Debugger: Allow re-evaluation of certain expressions without stepping
There are cases like changing an Evaluated Expression that make
re-evaluation necessary.

Change-Id: I51fe46b67399a59aebbdeb9c3e778795b1c52cf1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-17 16:01:52 +00:00
hjk
60f092f6bb Debugger: Cosmetics
Qt 5 connects, unused declaration, QLatin1Strings, ...

Change-Id: If09929993d750907ee3f4e2fa9f18acfcc28d9c1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-12 15:08:16 +00:00
Eike Ziller
0f94aa3f4d Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/projectwizardpage.cpp
	src/plugins/projectexplorer/xcodebuildparser.h
	src/plugins/qmldesigner/qmldesignerplugin.cpp
	src/tools/clangbackend/ipcsource/translationunits.cpp

Change-Id: Ibf0857cf8dbf95fc9ac13d5c2112b3f4a2ca7de6
2016-05-03 11:49:01 +02:00
Christian Stenger
b2a3c4e48d Debugger: Fix expanding of watchers...
...that have not been looked up completely.

Task-number: QTCREATORBUG-16195
Change-Id: I163426ed8a7457e77584b1bb7d091f1d63954743
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-05-02 07:03:19 +00:00
hjk
a246e43220 Debugger: Make safety check safer
This amends change ad55631c.

Change-Id: If0679ee2f3559fd3d1b2ef57e7456a159dd25b3b
Task-number: QTCREATORBUG-16180
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-04-29 05:30:46 +00:00
Eike Ziller
4a826ada04 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: I0cbc9d335073e3234f472aa43f462eef9a9178aa
2016-04-22 15:13:58 +02:00
hjk
1827688dd0 Debugger: Use symbolFile for binary validation
In remote setups this is typically a local copy of the executable.

Change-Id: I2c4e38559245e7b2cb4a609b93d80fde2b999cec
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-04-21 14:04:43 +00:00
Eike Ziller
ee8bf341c6 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/projectexplorer/session.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp

Change-Id: I6946139f5e5fa3a9cdbb322fd50be248e2c0133f
2016-04-20 14:58:48 +02:00
Ulf Hermann
385237dbbd Use Utils::Port where possible
This solves the ambiguity between 0 and -1 being the "invalid" port.

Change-Id: I3bac11dd4117bb1820fbd58186699925b73df1c5
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-20 11:06:34 +00:00
hjk
ad55631cdf Debugger: Add safety net to avoid infinite lookups
Do not lookup the same item twice without intermediate stepping.

Dumpers could announce the existence of children but when asked
for them bail out or produced similar inconsistent output.
Better not depend on it.

Task-number: QTCREATORBUG-15352
Change-Id: I38532d08bb438b12b6eb202a06ff610670b1069f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-18 10:38:58 +00:00
Eike Ziller
5c87432260 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp

Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
2016-04-12 11:34:46 +02:00
hjk
e73a9c1b0d Debugger: Always sort local variables alphabetically.
It was there for GDB at a time, but never for the other backends.
Fix the GDB regression and make the sorting consistent across
backends.

Task-number: QTCREATORBUG-15296
Change-Id: If728c65f0c8ca4a8378c7cf5e53f1dadbfb72b29
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-11 09:35:07 +00:00