Commit Graph

640 Commits

Author SHA1 Message Date
hjk
52e5023bcc ProjectExplorer: Use Utils::CommandLine in ProjectExplorer::Runnable
Change-Id: Id965f1f9047dcbc3ea5c9ddaa550d12668cf8ae6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-13 15:04:30 +00:00
hjk
4a42bcd4e8 Utils/ProjectExplorer: Use FilePath for Runnable::workingDirectory
... and in some using code.

Change-Id: I231ea56628908f7d305d13f07eabe8803fe8a791
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 12:51:24 +00:00
hjk
1955c82d5c Debugger: Register "Reload Debugging Helper" action
This allows assigning shortcuts via Tools->Options, Environment,
Keyboard Shortcuts

Fixes: QTCREATORBUG-25900
Change-Id: I6dfa6b0f3ff12ad971444b2d3adb427c8acf783c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 11:48:03 +00:00
hjk
077c149667 Debugger: Don't pass comments as custom commands to backends
GDB creates disturbing replies for them.

Fixes: QTCREATORBUG-25666
Change-Id: If6223d1065cb96301e3e25aec15e653702e78d08
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-05 06:37:26 +00:00
Eike Ziller
34cd28aac0 Debugger: Fix compilation with Qt 6
Amends 7ccd9d6943

Change-Id: I8567a1238b9cc770c2a5ec551a06ef64a1164a0a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-04-13 12:33:22 +00:00
Eike Ziller
4151f091e3 Merge remote-tracking branch 'origin/4.15'
Change-Id: If0dbebdf37b0ffea2528bf6ce6d34d88554f8dfb
2021-03-16 10:55:54 +01:00
hjk
06a754cc74 Debugger: Add more information about the debugee when debugging
Fixes: QTCREATORBUG-25159
Change-Id: Ic462c8bb4d9f4f7163dbb9fcc13adce4c7172564
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2021-03-16 08:12:26 +00:00
hjk
641604429a Debugger: Use an aspect for the source path mapping
More in line with the other settings.

Change-Id: I86494f1955120cddda7d2f2eec8ba0fdbfd99585
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-09 12:40:12 +00:00
hjk
7ccd9d6943 Debugger: Move interpretation on nature of source path mapping to user code
Change f0e2708 introduced the ability to specify source path mapping
containing regular expressions and used this in the elf reader.

To simplify the code, this change here moves the decision which paths
are considered regular expressions to the user. The other users which
are not aware of the special handling of paths starting with '(' in
the elf reader will interpret them as plain string, which appears to
be the right thing.

Change-Id: I31f10ed866fe7582d44307a923b6db10206acc9a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-03-05 10:52:57 +00:00
hjk
93a5803956 Debugger: Aspectify settings
Change-Id: I527be79965250b82a0928171b17aa93bac9fa2a0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-03 07:39:17 +00:00
Orgad Shaneh
35245a7fcf Debugger: Show Threads dock by default
Change-Id: I11480919b4bccab2f5472d4683a3ee81068cac71
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-02-25 10:38:43 +00:00
Eike Ziller
f79e4b3677 Merge remote-tracking branch 'origin/4.14'
Change-Id: Ib343adc6b761d15410d357137e4fc38040ce8d48
2021-01-20 11:13:11 +01:00
hjk
79ade10c4a Debugger: Add an option to show simple values as text annotations
Change-Id: I726d8559d7e28abd776ce483d5f670be5af09412
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-20 09:45:03 +00:00
David Schulz
80a1870292 Debugger: log the debugger exitcode also in hex
Change-Id: Ia9742bfa9c36c7ff4fdd965f2a32ea36a4239422
Reviewed-by: hjk <hjk@qt.io>
2021-01-19 05:38:04 +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
hjk
111cc934fd Debugger: Mark currently hit breakpoint in breakpoint view
Fixes: QTCREATORBUG-6999
Change-Id: I2b080de0096d1e2bc5b348666adcf4797589fe15
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-07 12:09:40 +00:00
hjk
14c3f5ba51 Debugger: Drop the EngineSetupOk state
Directly proceed to EngineRunRequested.

Change-Id: I8419086f554bae298624cab3b33e852e92ea54bd
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-05 07:40:12 +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
Eike Ziller
8d67dd57e8 Merge remote-tracking branch 'origin/4.14'
Change-Id: I5e138bb7883c0436fee14ca6af20e99396676af1
2020-11-20 13:00:37 +01:00
hjk
ff3614ab5a Debugger: Don't use QApplication::alert too often
There's an ICore::raiseWindow() call already for spontaneous stops,
conditioned on boolSetting(RaiseOnInterrupt). This should be sufficient
for normal operation.

Task-number: QTCREATORBUG-12769
Change-Id: I33daad2579f9cfdb8fd121b9c9db73c05f9eccb7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-20 09:47:36 +00:00
hjk
2bfd515b03 Utils: Allow BaseTreeView users to hide columns manually
... using a context menu on the header views.

Use the feature in the debugger views where it was previously
un-intuitively available as part of the main context menu of
the view, but not in the header.

Task-number: QTCREATORBUG-24384
Change-Id: I3f030c3dd8ce35dc91bad921e37d2273bfe548b5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-10 14:28:39 +00:00
David Schulz
af88afe943 Debugger: Activate split that contains the breakpoint being hit
Do not change the current editor after hitting a breakpoint if we
already have an editor open in another split, but switch the focus to
that split.

Task-number: QTCREATORBUG-24646
Change-Id: Id85cecdfb522807bafa097e578509853326a2e31
Reviewed-by: hjk <hjk@qt.io>
2020-09-16 07:29:30 +00:00
hjk
82e25e71c8 Debugger: Remove left-over comment
Change-Id: I5fecaed75cb2b5368e904ea4202657e56361f0d5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-15 15:02:02 +00:00
Alessandro Portale
0be309bcf1 Various places: performance-for-range-copy
Change-Id: I475990d32a5211d31a77782667a2dfedba134137
Reviewed-by: hjk <hjk@qt.io>
2020-06-15 05:58:46 +00:00
hjk
afde217f28 Debugger: Convert a QRegExp use in source path map
Task-number: QTCREATORBUG-24098
Change-Id: I1ee441a60cbf362d38459bcef869e02d7fca9b7e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-10 07:07:23 +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
Eike Ziller
be73f41ad4 Merge remote-tracking branch 'origin/4.12'
Change-Id: Ib95ec2c50c4bbaefd4ed0ec5af191ccc846c824f
2020-05-04 10:52:34 +02:00
David Schulz
09b69b274d Debugger: Fix crash after adjusting font size
Change-Id: Ic3b415a3791968f972d2f69ec71c8012c572995d
Fixes: QTCREATORBUG-14385
Reviewed-by: hjk <hjk@qt.io>
2020-05-04 04:22:56 +00:00
Eike Ziller
10114dc036 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/android/androidmanifesteditorwidget.cpp

Change-Id: I8143d9e02837dcd78a637da7b333a6eeebb105cb
2020-04-07 11:13:58 +02: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
Christian Kandeler
9348ac5fec Utils: Remove the *SameLine OutputFormat enums
Presumably, they were intended for output that shouldn't get an
automatic newline, but if there ever was such a thing as automatic
newlines, it must have evaporated over time. All users of
OutputFormatter provide a newline if they want one.

Change-Id: Ibd219b7305fd503ce075d6f77930d2b538d5e2e8
Reviewed-by: hjk <hjk@qt.io>
2020-03-18 13:52:17 +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
Eike Ziller
5c121d5791 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	src/plugins/genericprojectmanager/genericproject.cpp

Change-Id: Ib54f1645ec70a9e6460a888a13190ede130bccca
2020-02-05 11:59:35 +01:00
Denis Shienkov
96c1fbcd0a BareMetal: Long live support for KEIL uVision v5.x debugger
This patch adds debugger integration from the KEIL uVision IDE:

* http://www2.keil.com/mdk5/uvision/

This IDE has the uVision Socket Interface (UVSC) that allows
to the applications configuration, building and debugging:

* http://www.keil.com/appnotes/docs/apnt_198.asp

Besides, it provides a binary client libraries for Windows, which
are implements some API which we are use in this patch.

Currently implemented the following features:

* Enumeration of a stack frames.
* Enumeration of a threads (tasks).
* Registers view (read/write).
* Local variables view (read/write).
* Watchers view (read/write).
* Disassembler view.
* Current location marker.
* Break-points.
* Step-in.
* Step-over.
* Step-out.
* Step-by-instruction.
* Start/stop/pause/continue debugger.
* Auto-detection for the installed uVision instances (as debuggers).
* Wizard for choosing and configuring of the UVSC debug providers.

At this moment added support only for the 32-bit ARM devices, provided
by the STMicroelectronics:

https://www.st.com/en/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus.html

For this are implemented two debugger providers:

* Simulator - allow to simulate the target device.
* ST-Link v2 - it is a HW debugger.

This implementation tested only with the QBS using the following
target boards:

* NUCLEO-F767ZI (based on STM32F767ZIT6 MCU).
* STM32F4DISCOVERY (based on STM32F407VG MCU).
* STM32F103x (based on STM32F103C8T6 MCU).

A more detailed information about this patch can be found in a
bug-tracker.

Fixes: QTCREATORBUG-23426
Change-Id: Ie36a1f7430b56c33d6665cc35e43fe9bd95d28f1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-04 13:48:47 +00:00
Christian Stenger
32d9af894f Debugger: Do not raise watchers window unconditionally
In case of mixed debugging it may happen that the trigger
for add an expression happens on a different debugger
engine than the raise of the watchers window as the
companion engine might have been interrupted and the
current perspective has changed accordingly.
Avoid raising the watchers window for the other engine
in that case.

Fixes: QTCREATORBUG-23545
Change-Id: Ic3472b17c727f1336afd1945b5bc448e75e25b4f
Reviewed-by: hjk <hjk@qt.io>
2020-02-04 05:40:22 +00:00
hjk
5496d7cbde Debugger: Use new IOptionPage convenience for global options
Change-Id: I42391a01027f25be638b2d1b839d3038bced5f33
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-09 12:45:48 +00:00
Eike Ziller
0f30adcc8c Merge remote-tracking branch 'origin/4.11'
Change-Id: I949f4f63abe12e11c4598c98295bfccc82e0ebdb
2020-01-09 11:18:44 +01:00
Marius Sincovici
9165119819 Debugger: Check if m_perspective is valid before using it
When debugging a remote machine using ssh, if the ssh connection returns
an error before other workers are fully started, and it will call
destroyPerspective(). Then the other workers will call setState() when
they are in EngineSetupOk and then in EngineRunRequested.
Before calling select() method check if m_perspective is valid.

Fixes: QTCREATORBUG-23415
Change-Id: Ib174015b1d11cdaa5f59e7ccb012b849d49672f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-01-08 18:00:47 +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
hjk
4bd26c3e4b Debugger: Add ability to hide view columns
Not perfect, e.g. one would probably expect the items to
appear in the context menu of the header views, too, not
just on the main background of the view, but better than
nothing.

Task-number: QTCREATORBUG-23342
Change-Id: Ifdc44dcfd390112faa7b15bb8a51d809e42d7b29
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-13 08:07:31 +00:00
Christian Stenger
482c53d11a Debugger: Fix display of stack
When switching between interrupted and continue while
debugging the stack was not updated when the engine
states it is running again, but immediately did so
when clicking into the stack view.
Fix by explicitly updating the stack when the engine
reports it is running.

Change-Id: Ie8cb445e87fe6e45f9ae86b8ee2eec386be78a5c
Reviewed-by: hjk <hjk@qt.io>
2019-10-18 11:29:18 +00:00
Eike Ziller
f8c8c01096 Merge remote-tracking branch 'origin/4.10' into 4.11
Change-Id: Ic05bd53ea060d42c2013884972c05de08ed63f10
2019-09-30 10:36:00 +02:00
Christian Stenger
716ec39ae0 Debugger: Fix automatic raising of Expressions
When adding a new expression automatically raise the
Expressions widget if it is not shown already.

Change-Id: If89e4e4fbf8cbe57e0f08478cd2d3b9f4797f5ad
Reviewed-by: hjk <hjk@qt.io>
2019-09-30 04:33:58 +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
hjk
7b0a5e44d3 Debugger: Inline rarely used convienience function
Change-Id: Iad5db32af9adb90f5d191e4fdcd2be751bd2b412
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-09-20 13:39:31 +00:00
hjk
ee23dcba23 Debugger: Move toFileInProject to QmlEngine
The only user.

Change-Id: I443cbfab20739fb43a45848355110f879b0f3041
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-02 11:09:17 +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
7705fbb701 Debugger: Code cosmetics
Remove uses of foreach, ...

Change-Id: I3997d4dffc63d58c386c70b08063ecb894ef1abb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-07-26 10:13:27 +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
Michael Weghorn
b8d4a9bef8 Debugger: Only append ".exe" for symbol file if necessary
Only append the ".exe" suffix if the the symbol file cannot be
found. Otherwise, this shows an unnecessary warning if an existing
and valid executable file like *.bat or *.cmd is passed.

Change-Id: I129c89deee9d63aefecc84d489ee08e81eaa11ab
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-07-18 11:35:16 +00:00