Commit Graph

281 Commits

Author SHA1 Message Date
hjk
bb31da3937 Debugger: Give some hint on what to change if QML breakpoints fail
Fixes: QTCREATORBUG-8200
Change-Id: I464a577f14f1e0e03355b2f176e4f6e67cc8459b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-04 10:03:09 +00:00
Jarek Kobus
c3a8429dc8 Fix a clazy warning about qgetenv
Fix the following warning:
qgetenv().toInt() is slow. Use qEnvironmentVariableIntValue()
instead [clazy-qgetenv].

Change-Id: Ifb5d3869e758f8c42bb9f34004d9c04d5dbb4d89
Reviewed-by: hjk <hjk@qt.io>
2020-11-18 12:10:37 +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
73865034c6 Android: Use adb:// in ConnectRemote
This is apparently the right thing to do anyway and also helps to
select the right emulator or device when multiple ones are connected.

In that situation otherwise an error

  "Expected a single connected device, got instead 2 -
    try setting 'ANDROID_SERIAL'"

would occur.

Change-Id: I650a221d1a321d4dd9035411f85c7a68244c20e2
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-05-15 11:37:35 +00:00
Christian Kandeler
b02f6b5d30 ProjectExplorer: Give the Task class an explicit summary
We'd like to create more useful tasks from compiler output, that is, try
harder to identify consecutive lines that refer to the same issue and
create one task for them, rather than one for each line. In such
"aggregate" tasks, the first line will not necessarily carry the main
information. Therefore, we make it explicit what this main information
is by introducing a dedicated summary member.
Also streamline the font handling for compile tasks.

Change-Id: I933f2643a13c710dab1ab548c56669b129026eb5
Reviewed-by: hjk <hjk@qt.io>
2020-05-14 08:23:59 +00:00
Nikolai Kosjar
cdc97f523e Debugger: Fix warning about unused variable
Change-Id: Ib26f94d54f7e9570efa69cdfefa4253b640bc664
Reviewed-by: hjk <hjk@qt.io>
2020-05-14 06:17:54 +00:00
hjk
6313489e2c Debugger: And possibility to modify debugger process environment
Might be useful to set ANDROID_SERIAL to get hold of the right device
when multiple are connected.

Change-Id: I8f1f02552a9f57ee8a9ed35ae696d137cc85fe52
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-05-13 09:07:58 +00:00
Christian Kandeler
eb96f9900a Fix clang 10 warnings about unnecessary copies in range loops
Change-Id: I3b57869b5a04528518bc432b76768b01e3f53e81
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-12 13:45:43 +00:00
Eike Ziller
897abf24e2 Merge remote-tracking branch 'origin/4.12'
Change-Id: I79083060dfc3bc4408123acd3b7305b9701650fd
2020-04-03 08:12:52 +02:00
hjk
fb784a1f80 Debugger: Start lldb-server instead of gdbserver
... when the debug server looks like lldb-sever.
Also use suitable arguments.

Needed for setting up device connection later.

Change-Id: Ie4130be7881e12d460ab5116b0018916d47ed012
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-02 15:07:00 +00:00
hjk
aec5563364 RemoteLinux/Debugger: Pass right platform string to LLDB
Needed for setting up device connection later.

Change-Id: Ib794a8bf093714935b9a3ed3f290d46550763d68
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-02 15:00:32 +00:00
hjk
d746b4ab2d Debugger: Rename some gdbserver variable to debugServer
It could be lldb-server at some time, too.

Change-Id: Iba4bd0d073ba74e10dd579f0115570ccd4189da3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-02 06:24:42 +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
hjk
82e8ceab8b Debugger: Use some more verbose description for attaching to remote
Change-Id: I36e9793b1db98b538455c8d6075e8116a5af14bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-02-11 13:12:16 +00:00
Igor Sidorov
a9e40ad14c Add final specifies to classes
Warning -Wfinal-dtor-non-final-class in clang trunk

Change-Id: I2bf17064bf8898eab10b82b69583a283157766d0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-05 09:33:55 +00: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
hjk
466764146c Debugger: Rename some GdbServer* to DebugServer*
This is mimicking a bit what has been done on the baremetal side,
and is formally more correct when the gdbserver is not a real
gdbserver, but e.g. a probe speaking the gdb remote protocol.

Change-Id: I1b42624b94071b34c009bd0650095792a5b2fcb7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-17 08:23:06 +00:00
hjk
a574706d29 Debugger: Add a per-runconfig way to add debugger startup command
Task-number: QTCREATORBUG-22979
Change-Id: I225b6cd1ee1dd3195bda3de4de72880d76e8cd37
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-30 12:00:39 +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
BogDan Vatra
6b31f9cf23 Android multi arch support
[ChangeLog][Android] Android multi arch support for qmake

Change-Id: Ib8b1874604a3392130c96fbc00b26713b3d788ae
Reviewed-by: hjk <hjk@qt.io>
2019-09-16 07:34:54 +00:00
hjk
4028a41d2e ProjectExplorer: Use std::function for SimpleTargetRunner::start()
This spares us the typical r = runnable(); modify(r); setRunnable(r)
roundtrip and the m_runnable storage that might or might not
be the same as runControl->runnable. Similar for m_device.

Change-Id: I8300260dd8dd7cd395e40bcd3d2ae45089085008
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-04 11:08:34 +00:00
hjk
e3184cfd6d Debugger: Inline/Remove rarely used argument handling
Change-Id: Ibe97f3e406a4fc01569aa8e1325531ce4764adca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-02 11:16:45 +00:00
hjk
f4c1c0e441 ProjectExplorer: Rename BaseStringAspect::{f,setF}ileName
... to filePath and setFilePath. In line with Utils::FilePath.

Change-Id: I7115b91876542629c3d61c8259bbd8d9f4022fc1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-29 05:42:37 +00:00
hjk
dca7edbeef Let PortsGatherer produce full URLs instead of ports only
This is what the consuming code expects in most cases.

Change-Id: I135592039e28b994996186f627215ab1d2f8d6dc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-26 08:16:03 +00:00
Christian Kandeler
6d3f236aab Utils::Environment: Use expanded values
The Environment class is supposed to support values with references to
other variables, but we failed to actually expand them in most places.

Fixes: QTCREATORBUG-22687
Change-Id: I108cb59d3b4571471423455240f6f4f1cf64bf05
Reviewed-by: hjk <hjk@qt.io>
2019-08-20 12:39:16 +00:00
hjk
8b72e92167 Utils: Add CommandLine convenience constructors
... taking a QString for the executable.

This weakens the very explicit QString -> FileName conversion via the
named constructors for the special case of constructing a CommandLine.

I think that's worthwhile here, as it reduces the noise on the caller
site under circumstance where the nature of the thing is obvious.

Change-Id: I27b4a73639728893d053b2e7ba65cb745f0ffe83
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-23 15:51:45 +00:00
hjk
5efa84b91f Replace remaining Utils::FileName occurrences by Utils::FilePath
Change-Id: Ic3120f18b4fbe90219de9128dba53d7453630b03
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 13:40:22 +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
f636f06b45 Debugger: Remove GdbServerPortsGatherer::setDevice
Apparently not used anymore.

Change-Id: Ic9ee826edd383254dcb77ea435843904a53d10a8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-13 14:49:36 +00:00
hjk
5f26fe6298 Debugger: Robustify DebuggerRunTool::showMessage()
Seems to be possible to trigger in a failing MinGW start on Windows.

Change-Id: Ica93c29ad677c24688a8cf2c5a0f1018471ffe51
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-11 08:01:46 +00:00
hjk
77d2cebc12 Debugger: Use Utils::FilePath for serverStartScript
Change-Id: Ia3c6263a8f020b90c6f623a6cf88169db8fc2865
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-04 10:12:41 +00:00
hjk
d965df6483 Debugger: Use new Utils::CommandLine in LocalProcessRunner
Change-Id: I41e67e5d52aa9a00d9e0fad3caf8da22391d2024
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-04 06:45:54 +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
2b1c8aa877 ProjectExplorer: Introduce a alias for QList<Tasks>
Change-Id: I91391ad22b420926b0f512cac23cfe009048b218
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 05:51:40 +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
c53ccceff1 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/debugger/debuggerkitinformation.cpp
	src/plugins/languageclient/languageclientmanager.cpp
	src/plugins/plugins.pro
	src/plugins/projectexplorer/kit.cpp
	src/plugins/projectexplorer/kitmanager.cpp

Change-Id: I66fb941202991f35f7d7761430b21e42dfc678a8
2019-03-14 15:51:15 +01:00
hjk
7a4752bde5 Debugger: Avoid some uses of RunControl::runConfiguration()
Change-Id: I1dcf5b96e6c23e369217f38a440305abb51dcd25
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-14 08:16:57 +00:00
hjk
ceb0fe429d ProjectExplorer: Add RunControl::set{Kit,Target}
For cases where no genuine RunConfiguration is available.

Use it in the debugger for the cases triggered from the menu.

Change-Id: I5671f4f5db2547c4a7a70bd34292bb6ccc8e6bf4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-12 16:47:47 +00:00
hjk
efb7d8deb7 ProjectExplorer: Split RunControl constructor
Into a trivial bit and two setters. Plan is to use it only with information
that is truly there (e.g. kit/device only) at the user side without having
to invent a RunConfiguration "handle".

Also remove some dead code in the test runner.

Change-Id: I987881e41722178b14b91f973b84cbdb67a9f85e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-12 16:38:45 +00:00
David Schulz
762bcc5c39 Debugger: inform user about misconfigured debugger settings
Change-Id: I304ae5147e04a89cd93800f8c44e82bd507f2d20
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-06 08:49:13 +00:00
hjk
317ab49793 Debugger: Code cosmetics
Move some constants to internalconstants.h or remove them entirely.

Change-Id: Iecd4def3b48130fb390bddf420da672d44e3d6b8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-21 07:56:58 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Friedemann Kleint
963dc84cc5 Fix some deprecation warnings in basic plugins
Fix warnings apppearing in 5.13, for example:
warning: ‘QDir& QDir::operator=(const QString&)’ is deprecated: Use QDir::setPath() instead [-Wdeprecated-declarations]
...
warning: ‘static QRgb QColorDialog::getRgba(QRgb, bool*, QWidget*)’ is deprecated: Use getColor() [-Wdeprecated-declarations]
warning: ‘Qt::DropAction QDrag::start(Qt::DropActions)’ is deprecated: Use QDrag::exec() instead [-Wdeprecated-declarations]
warning: ‘void QProcess::finished(int)’ is deprecated: Use QProcess::finished(int, QProcess::ExitStatus) instead [-Wdeprecated-declarations]
...
warning: ‘const QRect QDesktopWidget::availableGeometry(int) const’ is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations]
...
warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]
...
warning: ‘const QBrush& QPalette::foreground() const’ is deprecated: Use QPalette::windowText() instead [-Wdeprecated-declarations]
...
warning: ‘void QTextOption::setTabStop(qreal)’ is deprecated [-Wdeprecated-declarations]
warning: ‘void QList<T>::swap(int, int) [with T = ProjectExplorer::BuildStep*]’ is deprecated: Use QList<T>::swapItemsAt() [-Wdeprecated-declarations]
warning: ‘void QProcess::setReadChannelMode(QProcess::ProcessChannelMode)’ is deprecated: Use QProcess::setProcessChannelMode() instead [-Wdeprecated-declarations]
...
warning: ‘QString QFileInfo::readLink() const’ is deprecated: Use QFileInfo::symLinkTarget() instead [-Wdeprecated-declarations]

Change-Id: I1d893d42d372245892f2de8406f52dbe7bbd552a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-11 09:32:06 +00:00
Alessandro Portale
128a33548b Fix warning: "Missing reference in range-for with non trivial type"
[-Wclazy-range-loop]

Change-Id: I5dcb263c754d423740e7bce3dcb948d52f2dec67
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-16 20:22:56 +00:00
Eike Ziller
95db30bd3a Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/debugger/debuggeritem.cpp
	tests/unit/unittest/unittest.pro

Change-Id: Id2e4e9c2bc87b2556d7c2845aea3fe2fa11b630b
2018-10-22 09:53:54 +02:00
hjk
d0d83f6b31 Debugger: Remove unused DebuggerRunTool::quitDebugger
Change-Id: Id3b59f9651ebc65e3fc7588bea789ccaa96522af
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-16 12:03:41 +00:00
Orgad Shaneh
147a3c27c4 Debugger: Strip QLatin1* where possible
Change-Id: Idcab23875b5dc2ecf55e3303f417b995e2252720
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:32:31 +00:00
hjk
1c9410e353 ProjectExplorer: Rename 'extraAspect' to 'aspect'
Using aspects is the standard pattern nowadays, there's nothing 'extra'
to them anymore.

Change-Id: I446f9d7b1db58a4899e5e44df33ce51f655e7be4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-02 08:32:51 +00:00