Commit Graph

616 Commits

Author SHA1 Message Date
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
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
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
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
Eike Ziller
b3baed58c6 Merge remote-tracking branch 'origin/4.9'
Change-Id: If36258b8e572b5c7875433a31a836e4f06e27286
2019-03-21 11:28:21 +01:00
hjk
0dbdc520a4 Debugger: Fix some perspective selection issue
Previously:
   - start combined debugging, stop anywhere
   - switch to QML debugger sub-perspective
   - switch to any other analyzer main perspective
   - switch back to debugger main perspective
->  QML debugger was selected in the sub-perspective chooser combobox,
but the visible views were the ones of the the C++ debugger.

With this patch, the visible views match the selected QML debugger.

Change-Id: I20e4bd6c07acb5e55c02f0a0ef042986f2e3f1f4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-18 07:08:35 +00:00
hjk
b9b1ed9b14 Debugger: Remove unused DebuggerEngine::isStartupRunConfiguration()
Change-Id: I0e3773052495b3812b87959ef16077c5bee441a3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-12 10:36:44 +00:00
Christian Kandeler
d0db212575 Resolve ambiguous results of searches for relative file paths
Qt Creator extracts file names from the output of external processes in
various places, for instance from compilers during the build. It often
happens that such file names are not absolute, so they cannot be
directly opened in an editor when the user clicks on their
representation in some widget. That's why they are processed by the
FileInProjectFinder facility first.
This patch enhances the FileInProjectFinder to be able to return more
than one candidate for a relative file path, and allows the user to
choose between these candidates where possible. This way, we won't open
a random file anymore when a project contains more than one file with
the same name.

Fixes: QTCREATORBUG-13623
Change-Id: Id19c9eace3e6b3dbde89f6528e6d02b55872d747
Reviewed-by: hjk <hjk@qt.io>
2019-03-04 09:52:13 +00:00
hjk
3fdb5f53e3 Debugger: Decouple combined engine rampdown further
There are apparently uses where one still want to have a fully
functional C++ engine even when QML is already done.

Task-number: QTCREATORBUG-21857
Change-Id: I5dfd80e5ff02dcc3e5e2d6b5913a75af071f53d3
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-01-28 10:24:05 +00:00
Aaron Barany
21c0f5395e Debugger: Fix sizing of debugger columns
Added span column property to BaseTreeView. This takes an index to a column
that will span remaining space not explicitly taken by the other columns.
This listens to resizing of the tree view and columns that are manually
resized to keep the sizes consistent.

The stack view now once again uses the StackView class, which now sets the
function column as the span column. This will adjust the column size the
first time stack frame contents are encountered. It will not resize
automatically until it's re-created (the next debug session) so it doesn't
undo custom resizing. This also restores the ability to toggle stack
addresses. Some obsolete parts of this class were removed as part of
retrofitting it for the current state of the debugger.

Stack, breakpoint, and thread views now resize remaining space for the
function column rather than empty space at the end. This is generally the
most important field when debugging and can get very long, especially in
C++.

Task-number: QTCREATORBUG-21763
Change-Id: I821c83d1d951f3311d7fa9fcddcbdeedfeed1573
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-08 18:43:44 +00:00
Eike Ziller
2529b36b40 Merge remote-tracking branch 'origin/4.8'
Change-Id: Id1484d611d457d8e4598fb53975b2288690b64bb
2018-12-17 10:05:11 +01:00
hjk
2c395df349 Debugger: Use toolbar stop icon in toolbar
Fixes: QTCREATORBUG-21720
Change-Id: I6929278cc9610a1cf0a1655875e837c738853185
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-12-14 08:09:48 +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
867befc5ae Debugger: Fix switching to previous mode on exit
This behavior was broken with refactoring done in commit
3b5ecac238. This has two main components:
1. Perspective::select() needs to call EngineManager::activateDebugMode()
   in order to save the previous mode.
2. The contents of the previous function
   DebuggerPluginPrivate::activatePreviousMode() was placed in
   EngineManager::deactivateDebugMode() and is called in
   doFinishDebugger().

Task-number: QTCREATORBUG-21415
Change-Id: Ibca188ba740027769c497e25ea695af8e218ea4e
Reviewed-by: hjk <hjk@qt.io>
2018-12-10 18:42:14 +00:00
David Schulz
57715c7f66 Debugger: do not show warning on remote debugging session
Do not show a warning about debugging a release build when attaching to
a remote cdb debug session.

Change-Id: Icfafe13efc873cafc98466d3ab2cd2c344796e0e
Reviewed-by: hjk <hjk@qt.io>
2018-12-07 12:59:39 +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
Robert Loehning
efe30bc5a5 Debugger: Fix translation contexts
Change-Id: Id41ba15a4f0f5956148661e3c329cbb36a373f48
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-14 13:21:17 +00:00
hjk
18e73a738b Debugger: Fix display of location marker when switching perspectives
Fixes: QTCREATORBUG-21362
Change-Id: I9bc1f0931ea902d04ab256774347b63c1fc64262
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-14 13:08:54 +00:00
hjk
0ee07ae2ad Debugger: Make validateExecutable a validateRunParameters
Gets rid of the odd and otherwise unused
DebuggerEngine::mutableRunParameters() function.

Change-Id: Ib0861432e7c61072db2968acf2f36c7f2d56c89a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-13 09:18:29 +00:00
hjk
6a043d32dc Debugger: Fix handling of some actions after multiinferior split
The pattern used is some inactive/invible global action with a
command to put in the menus, and per-engine action "overloads"
to reflect the active engine's state once there is an engine.

Task-number: QTCREATORBUG-21454
Change-Id: I861a42994849ef9f0b51fb7b1608f14fa7fa9d7c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-13 07:16:37 +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
Orgad Shaneh
70b466b7d9 Debugger: Split expressions and locals and anchor Registers to Locals
The Locals view is the first tab, and the Expressions view is not visible
at all. If you grab a variable to the Locals view, it just "disappears",
and you need to know where to look in order to find it.

Return to the previous layout, when Expressions and Locals were both
visible in the same view.

Change-Id: I775fe88beb921c61c048ba7106d05ae08b8fe026
Reviewed-by: hjk <hjk@qt.io>
2018-11-07 14:52:15 +00:00