Commit Graph

1547 Commits

Author SHA1 Message Date
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
Eike Ziller
88b29792cb Merge remote-tracking branch 'origin/4.8' into 4.9
Conflicts:
	src/plugins/android/androidrunnerworker.cpp
	src/plugins/android/androidrunnerworker.h

Change-Id: I52b9117c8a57dc4a34cfc09d1ae9bc76e0752bfc
2019-02-04 15:21:55 +01:00
hjk
18f1a8d759 Debugger: Fix gdb detaching
Too much cleverness in python command detection: "attach" is parsed
as possible Python command. Make it explicit that it is not.

Task-number: QTCREATORBUG-21908
Change-Id: I68444bccfb485ef1befe81b4b6b13243c2c8a500
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-01 13:50:11 +00:00
Alessandro Portale
710e57a628 Fix warning: "Use midRef() instead of mid()"
[-Wclazy-qstring-ref]

Change-Id: If8a0844b39377feb3772542559655854a92b93cd
Reviewed-by: hjk <hjk@qt.io>
2019-01-17 13:00:37 +00:00
hjk
6974b34b86 Debugger: Gracefully recover from gdb crashes
Fixes: QTCREATORBUG-17341
Change-Id: Icc05b9810269e43ddcf968cf25d5949b3687838d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-08 15:04:52 +00:00
Eike Ziller
9084ca73df Merge remote-tracking branch 'origin/4.8'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: I87f47cecbb924064296a002fd9446a0627acad8e
2018-12-12 09:44:13 +01:00
Aaron Barany
f635af8908 GDB: Don't reset breakpoint when line numbers differ
When the breakpoint is put on a non-code line, it will be moved to the next
line that has debuggable code on it. When attempting to reset the
breakpoint to the originally requested line, this causes an infinite loop
of removing and re-adding the breakpoint.

Fixes: QTCREATORBUG-21611
Fixes: QTCREATORBUG-21616
Change-Id: I8943de0eae991644eb6728f491010599f62192ff
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2018-12-11 10:29:27 +00:00
Orgad Shaneh
7096649fc2 Merge remote-tracking branch 'origin/4.8'
Change-Id: I5b18233936e3b2cd674df92a694ba73b5a3ed752
2018-12-03 09:56:07 +02:00
hjk
185f8985c6 Debugger: Fix unexpected state transitions with GDB
... for temporary stops.

The transition is not unexpected, we just failed to communicate the
expectation.

Change-Id: I30cdcffdcc3672e759023cd0c07de4bea11c2e32
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-30 13:51:47 +00:00
Orgad Shaneh
5170dd0858 Merge remote-tracking branch 'origin/4.8'
Change-Id: Ia8bf92c8effdee0e1085730cb975ff88c8ad85fc
2018-11-20 19:13:13 +02:00
Orgad Shaneh
3a5e67a3d4 Debugger: Remove unused NativeMixedCapability
Change-Id: I8f36d52bced8fdecd0667c9bac069b833200d6b3
Reviewed-by: hjk <hjk@qt.io>
2018-11-19 10:25:52 +00:00
Orgad Shaneh
14bdcd2bff GDB: Support operate by instruction also for core dump
+ Deduplicate common capabilities.

Task-number: QTCREATORBUG-21454
Change-Id: Icd53b88274136c885b929030f1cfb71819667cc3
Reviewed-by: hjk <hjk@qt.io>
2018-11-19 10:25:44 +00:00
Eike Ziller
3d1d9aae2e Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/winrt/winrtdevicefactory.cpp

Change-Id: I33b8697e2ebf2bea051d7f1144449e0743ee16a5
2018-11-19 10:00:18 +01:00
Orgad Shaneh
fed9ac43f0 GDB: Enable adding expressions for core dump
Change-Id: I998bf3f3a7a719dc9b80492e55ffe5ace56ef461
Reviewed-by: hjk <hjk@qt.io>
2018-11-14 15:43:11 +00:00
Eike Ziller
3666e3aaeb Merge remote-tracking branch 'origin/4.8'
Conflicts:
	tests/unit/unittest/unittest.pro

Change-Id: I4f0ab05f96ee60900a3a35fad4c7331238367593
2018-11-09 13:30:40 +01:00
hjk
3cef77db86 Debugger: Ignore bogus signal number on QNX
Fixes: QTCREATORBUG-21351
Change-Id: Id2b45e830f860a9352aacbbd5f6932d8fcde7b26
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-09 11:33:42 +00:00