Commit Graph

1462 Commits

Author SHA1 Message Date
Tim Jenssen
b801a9339d Merge remote-tracking branch 'origin/4.14'
Change-Id: I70504e096be620434f38cd990c593950da8b24ba
2021-01-07 14:23:46 +00:00
hjk
da147880e8 Debugger: Rename 'AttachExternal' to 'AttachToLocalProcess'
And AttachCrashedExternal to AttachToCrashedProcess
And AttachCore to AttachToCore.

Clearer.

Change-Id: I47c2eca5cbdbbc0eb38b9f62b2504c96558ff112
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-07 12:11:42 +00:00
Orgad Shaneh
bb070d861b Debugger: Minor cleanup
Change-Id: Idfef663ec6701f7ed8904bd5c3dbfa87e0baaf8b
Reviewed-by: hjk <hjk@qt.io>
2021-01-07 09:14:54 +00:00
hjk
13c9b42a21 Debugger: Move initial GDB breakpoint settings after target setup
While GDB can handle breakpoints set before specifying an executable
fine, it stresses the machinery unnecessarily and fails in corner cases
("wrong" dynamic loader etc). We can avoid most of that by moving the
breakpoint setting to a later point in the process.

Change-Id: I0450a0e43a81c80bfdfefb7b67f6799042e0ec26
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-06 12:37:25 +00:00
hjk
8753889c63 Debugger: Use handleInferiorPrepared also for AttachToRemoteProcess
Same pattern as the other scenarios.

Change-Id: I065783b9ced3ad31a1918b48b44116071bb98d75
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-06 11:09:48 +00:00
hjk
c7e57ced3a Debugger: Simplify gdb startup
The reason for the special callback setup is lost in history.
A possibility is that the extra roundtrip was needed for synchronization
with earlier gdb versions and/or start up sequences. It seems to
works fine without nowadays.

Change-Id: I28c95aec2f065e9c6f0730f1ffbc3db1a3d819da
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-06 10:22:28 +00:00
hjk
d671983d81 Debugger: Drop GdbEngine::listFeatures()
The output of -list-features is nowhere near complete or usable to
determine the need of workarounds or such. We have never really
relied on it and the code was unused for a while.

Change-Id: Ide02f4d35d6075f534b756245ebe43c55ee69390
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-06 07:12:28 +00:00
hjk
b0d2c0d45d Debugger: Drop base DebuggerEngine::runEngine()
The lines between engine setup and running have always been
blurry, so it looks more and more unnatural to enforce this
in the architecture. Remove the runEngine() call from the
end of notifySetupEngineOk, and do it on the user side.

Change-Id: I3a5e158e8b3fe9b0a288d064f798e24b2ac47f86
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-05 06:21:27 +00:00
hjk
f2f139e90e Debugger: Remove DebuggerEngine::stateAcceptsBreakpointChanges()
Dead code since 3b5ecac238 (the end of the hybrid engine).

Change-Id: Ibb169ff657c8a88fdc52783a6a1f5b79fa0b29e5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-12-18 16:16:58 +00:00
hjk
4ac7bb5a01 Debugger: Use -file-symbol-file for cores, not for remote debugging
In 5467faa0d7 the replacement of -file-exec-and-symbols with
-file-symbol-file accidentally ended up in the wrong branch.

Task-number: QTCREATORBUG-24996
Change-Id: I2d6cb5432c0b11b02c3f8d3517075a7c00b05c9f
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-27 10:35:41 +00:00
Jarek Kobus
6d5e302157 Use typed syntax in calls to QMetaObject::invokeMethod
We do it wherever possible. Some places can't be fixed
since they still rely on dynamic introspection
(mainly QQuickItem cases).

Change-Id: Ia00b4a04d8b995c9a43b7bf2dbe76a60364bb8ca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-16 13:45:02 +00:00
hjk
5467faa0d7 Debugger: Use -file-symbol-file for core files with GDB
Task-number: QTCREATORBUG-24541
Change-Id: Ib6d070629f5a7d1505c272ce78f99dc14cd15fdc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-16 07:24:28 +00:00
hjk
fcaa6801cf Utils: Start replacing SavedActions by QAction or Utils::Aspect
First mechanical step here is to derive SavedActions from BaseAspect
instead of QAction.

Change-Id: I2ec95883b825462c1d867f83cc2b3bd2c2732055
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-05 08:46:27 +00:00
Eike Ziller
2a70bc1d09 Debugger: Fix build with Qt6
QStringRef gone.
ViewOptions changed.
MetaType register stream operators automatically.

Task-number: QTCREATORBUG-24098
Change-Id: Ibf98561af951aa5fc4ec483d18dafeaad02e07c3
Reviewed-by: hjk <hjk@qt.io>
2020-09-18 14:41:20 +00:00
Eike Ziller
6477a07654 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/clangtools/virtualfilesystemoverlay.h
	src/plugins/mesonprojectmanager/project/buildoptions/mesonbuildstepconfigwidget.ui
	src/plugins/qmldesigner/designercore/model/abstractview.cpp

Change-Id: I5013bd8fdd28d79cdea74380bec01d4c106adfaf
2020-08-31 14:49:19 +02:00
Christian Kandeler
4f2a21541e Debugger: Fix environment passed to inferior by gdb
We must not set variables that the user disabled.

Change-Id: I2f559aefd6aaa43298dd9c4889a614a5130622c0
Reviewed-by: hjk <hjk@qt.io>
2020-08-27 09:38:23 +00:00
hjk
5d820b79e6 Debugger: Compile fix for Qt6
QMap and QMultiMap are distinct types in Qt6

Task-number: QTCREATORBUG-24098
Change-Id: I959012739231fb3b184dcc13cebd119c83059a99
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-20 09:27:55 +00:00
hjk
43b658e9e7 Utils: Drop Utils::SkipEmptyParts again
We require Qt 5.14 nowadays.

Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-21 12:42:27 +00:00
hjk
1c81a3b3e8 All: Use Utils::SkipEmptyParts
Task-number: QTCREATORBUG-24098
Change-Id: Iab45de9a9c17ddc39a0e343b1175d4f6cb94b098
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-17 05:55:25 +00:00
hjk
816a1df45a Debugger: Remove one use of QStringRef
This is a guinea pig to check whether using u"..." is ok
nowadays.

Change-Id: I402816d8892211e67fb6227cd0441c20c0b33818
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-16 07:35:04 +00:00
Eike Ziller
5b364de168 Use dialogParent() instead of mainWindow()
There are very few reasons to use mainWindow() directly.
Especially for modal dialogs, using dialogParent() is important, since
that guarantees the stacking order in case of other dialogs currently
being open.

Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6
Reviewed-by: hjk <hjk@qt.io>
2020-06-02 11:44:53 +00:00
hjk
14666c801a Debugger: Drop 'set print object on' for GDB
This does not seem to affect the code paths we are using through
Python.

Task-number: QTCREATORBUG-23965
Change-Id: I2e20d6d3c1937d56293e81b74c453e83a92ddc4c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-25 10:01:03 +00:00
Sebastian Verling
38e13e4216 add lower case a-f as address match
As the addresses were only matched against upper case letters
all registers with lower case characters were not correctly parsed
and had zero values

Change-Id: Idc3da0a33b9f075d7a209cad74768e81cced2d67
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
2020-05-07 09:34:48 +00:00
Viacheslav Tertychnyi
e0e5334d83 Debugger: Fix tooltips
Fixes: QTCREATORBUG-19574
Fixes: QTCREATORBUG-23807
Change-Id: I61f997e69f4a747aff8c5e1044bb6d856494ae47
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-03 10:14:33 +00:00
hjk
06b2023420 Debugger: Remove "IdentifyDebugInfoPackages" feature
This was only ever working with SuSE and GDB, and nobody
ever tests it, nor asks for extension to other setups.

Change-Id: I7b1e3cc8c9f71df4c86b957a79d5afe02eec0758
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-25 14:13:01 +00:00
Christian Stenger
94ee0a575d Debugger: Avoid crash when settings change after debugging
If the debugger engine is not running there is anyway no need
to update its data.

Change-Id: I8cda9218985db8b88d96046254847e8916ca37eb
Reviewed-by: hjk <hjk@qt.io>
2020-02-20 11:15:19 +00:00
hjk
0334b6e491 ProjectManager: Add convenience Task subclasses
For Compile, BuildSystem and Deployment. Unclutters user code and reduces
binary size.

Change-Id: Ia18e917bb411754162e9f4ec6056d752a020bb50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-20 10:11:59 +00:00
David Schulz
b23d80d537 Debugger: make Location::fileName a Utils::FilePath
Change-Id: I637d39246ff576db1023f08c432a7f7b6aadbbaa
Reviewed-by: hjk <hjk@qt.io>
2020-01-06 13:29:54 +00:00
David Schulz
a7dd0e50a2 Debugger: make BreakpointParameters::fileName a Utils::FilePath
Task-number: QTCREATORBUG-23339
Change-Id: Ifc497c14589cd6df10d8219533e100f1919213b3
Reviewed-by: hjk <hjk@qt.io>
2020-01-06 13:29:44 +00:00
hjk
d3b2c01c11 Utils: Move FileUtils::resolvePath to FilePath
In line with the general move toward use of FilePath nowadays.

Change-Id: I1c50e1479f7d9100ff8ded3ce3c22dd82b7fe6aa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-05 08:38:03 +00:00
Christian Stenger
c9086499f6 Debugger: Fix timeout handling
Task-number: QTCREATORBUG-21664
Change-Id: Ie6dec329443e9fa8e31e28f0fdd6d46a279804bb
Reviewed-by: hjk <hjk@qt.io>
2019-11-01 11:36:42 +00:00
hjk
a82b40e037 Debugger: Move convenience function to only user
Change-Id: I50952521bdd45faa8a31da674e7ea5f0796d75d9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-25 08:06:03 +00:00
hjk
b63034b551 Debugger: Move showModule{Sections,Symbols} to DebuggerEngine
A bit closer to where the functions are used. No real change.

Change-Id: Icbad68bd31d85caa59980316537ee532faf2d7ef
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-25 08:05:51 +00:00
Denis Shienkov
239c82bfb0 Debugger: Add peripheral registers description file support
This feature is useful for the bare-metal programming. It allows
to view the peripheral registers of the debugged device using
the GDB.

An information about the peripheral registers for a concrete
device contains in a special SVD file. A format of this file
described e.g. here:

* https://www.keil.com/pack/doc/CMSIS/SVD/html/svd_Format_pg.html

This feature supported only for ARM devices, and an appropriate
SVD files can be found in the Internet, also this files provides
by KEIL or IAR EW IDE's.

A use case in QtC is that the user should to choose desired SVD
file and set its path to the bare-metal device configuration widget.
After this, the user can enable the "Peripheral Registers" view,
choose a desired register group and to see a peripheral register
values.

Currently the following basic features are implemented:

* Choosing SVD file for a target bare-metal device.
* Choosing any peripheral register group, which is available for
  this device.
* Seeing the info about the each peripheral register and its fields.
* Seeing the value for the each peripheral register and its fields.
* Changing the value for the each peripheral register and its fields
  (if it is allowed by access for a concrete register or field).
* Changing the format of the values (hexadecimal, decimal, octal,
  binary).

Fixes: QTCREATORBUG-18729
Change-Id: I3c38ea50ccd2e128746458f9b918095b4c2d644a
Reviewed-by: hjk <hjk@qt.io>
2019-07-31 19:46:29 +00:00
hjk
e3b1106afa Compile fix with recent Qt dev
The reasoning in 1b4766e26c did not take into account that the scope
of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with
f70905448f6 in Qt base.

Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-29 08:54:18 +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
hjk
32bbf2a3b3 Debugger: Introduce a tree level above stack frames
This level is meant to take the role of current thread handler
in the long run, allowing per-thread stackviews in each engine.

For now, the additional level holds just a single, invisible
dummy item playing the role of a "current thread".

Change-Id: Ief6131500fc1aa8902f2313038a65840b80b495b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-26 06:58:03 +00:00
hjk
0d49c2cd2c Debugger: Use Utils::TreeModel as base for StackHandler
Change-Id: I3fcc1b3a149f15cf414a1560d91145b623e40c63
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-24 12:54:23 +00:00
hjk
1396c6e8e9 ProjectExplorer: Use Utils::FileName for Runnable::executable
Change-Id: I584bc18aa19a4c9886af7b13e95052dfd4350b34
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-21 10:32:31 +00:00
hjk
ca4ba34229 Use Utils::FilePath in SynchronousProcess
Adapt callers and surrounding code.

Change-Id: Ie6c1883a44169cf9d790d06b660f46d24dc24c89
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-11 08:11:07 +00:00
hjk
611e1ea837 Utils: Encourage marking of raw command line parameters
Change-Id: Id66ac07732c66ab8c1232fe1f58042de8a61abb0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-06 12:22:47 +00:00
hjk
95a89b5615 Debugger: Use Utils::CommandLine for gdb process
Change-Id: I3744ae33a26f868c22730d144738526ba5d6b154
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-04 13:57:47 +00:00
hjk
4098be05b2 Utils: Extract a CommandLine structure from a QtcProcess
We regularly pass around strings or filenames or pairs of strings
or filenames and stringlist etc the in the end will be used
as a kind of "command line", with quite a bit of ad-hoc user
code and QtcProcess::addArg etc to set them up and manipulate them.

Let's have a class for that concept.

Change-Id: I288ab939d853b32c717135a65242c584c2beab50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-29 14:36:46 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
hjk
e95fd876aa Debugger: Make the time stamp recording option work for single items
Should help to drill down to individual expensive dumpers.

Change-Id: I983ba075231784f71dd9d5c3bda375a3ee508bf6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-12 08:32:52 +00:00
hjk
384ca4bdb8 Debugger: Fix "Attach to running process"
Change-Id: I3cef08621c40c87f52e20a229ab5e16f0bfa8bb1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-09 08:28:42 +00:00
Orgad Shaneh
39ba01da71 Merge remote-tracking branch 'origin/4.9'
Change-Id: I7d1912cd5c4d824fd40d3454c5f1bb796f2c21d8
2019-04-07 23:13:17 +03:00
hjk
5273ef2a8a Debugger: Re-organize dock widget persisting
Looks like the mainwindow cannot be convinced to handle multiple
sets of dockwidgets.

So switch back to a single set containing everything and keep
track of non-default visibility in the perspectives, and persist
these sets.

The following pass:

1.

 Start Creator with new settings
 Goto Debug Mode
 Move Break dock widget to right, switch on Global log widget
 Leave Creator
 Start Creator
 Goto Debug Mode
 Check: Debugger Selected, Break on right, Global log visible

2.

 Start Creator with new settings
 Goto Debug Mode
 Move Break dock widget to right, switch on Global log widget
 Switch to QmlProfiler sub-perspective
 Leave Creator
 Start Creator
 Goto Debug Mode
 Check QmlProfiler selected
 Switch to Debugger sub-perspective
 Check: Debugger Selected, Break on right, Global log visible

3.

 Start Creator with new settings
 Use any C++ test project
 Start debugging / stop at main()  (F10)
 Wait for stop
 Switch to Edit mode
 Switch back to Debug mode
 Check: Only "running" debugger dock widget layout present
  (not the normal + preset at the same time)
 Quit Qt Creator while this debugger is running
 Check: Shuts down without crash

4.
 Use any C++ test project
 Start debugging
 Switch to Debugger Preset perspective
 Start a second debugger
 Kill either instance
 Check: Application dies, Debugger Preset perspective gets displayed
 Switch to perspective of second instance
 Check: Perspective looks ok (docks visible as before)

Task-number: QTCREATORBUG-21083
Task-number: QTCREATORBUG-21669
Task-number: QTCREATORBUG-21668
Task-number: QTCREATORBUG-21813
Task-number: QTCREATORBUG-21851
Task-number: QTCREATORBUG-22110
Task-number: QTCREATORBUG-22169
Task-number: QTCREATORBUG-22189
Change-Id: Ic9eb41ff7699ac0f48a85e68376daa80b2b6847e
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-04-05 15:53:51 +00:00
Orgad Shaneh
2df4667620 Debugger: Expand target mapping only when required
Store the unexpanded string in settings and expand on execution.

Change-Id: Ib3160a548b7501b22d120629a6376e2252df32e5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-01 06:07:18 +00:00
hjk
6f37348b4c Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning.

Also adjust coding style in the surrounding connects when needed.

Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 15:18:14 +00:00