Commit Graph

402 Commits

Author SHA1 Message Date
hjk
4b5aeb9a74 Debugger: Use FilePath for debugInfoLocation
Change-Id: Id538ab4ddd1d634d0dc73a00fe42d3fd35341bea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-28 06:38:52 +00:00
hjk
30f171a491 Utils: Rename FilePath::normalizePathName to normalizedPathName
Change-Id: Ib7bcc9968749649f762a396d3861f7b67711e926
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-26 07:03:13 +00:00
hjk
67e2db4bcb Debugger: Use QtcProcess in CoreUnpacker
Change-Id: I0eeaaf0c6f5d49f92de35a59c5e777e73a6abc66
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-24 13:08:37 +00:00
hjk
db014de91c Utils: Introduce FilePath::normalizePathName()
... as wrapper around FileUtils::normalizePathName, and use it
in some places.

Change-Id: I42792e1f175b8119c8db930eae80a9f822ac70fa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-23 10:37:26 +00:00
hjk
6d3659bef4 Debugger: Be a bit more explicit about why debugging fails
Ignoring python, pure Qml debugging is fine without debugger in the kit,
everything else not.

Fixes: QTCREATORBUG-26152
Change-Id: If6ebb50968ede85e8210e191dbabd51cf61e177b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-20 14:21:02 +00:00
hjk
03b05d8579 ProjectExplorer: FilePathify IDevice::debugServerPath
Change-Id: Ic7e5ba0ac5ff4fa2605f1e479e914cd85623c9da
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:44:00 +00:00
hjk
7c28c4f744 Utils: Introduce a FilePath constructor from char arrays
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.

At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.

Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:34:10 +00:00
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
e429aaa43b Debugger: Remove the extra server start script setting
This was part of very original gdbserver support where normal
remote debugging did not start the server on the device.

The effect can still be achieved by a custom deploy step.

Change-Id: I8763ea131700115065693bd8a8a5382f0e02a113
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-07-12 12:48:36 +00:00
hjk
6acc10a8bd Debugger: Simplify one process error check
Change-Id: Icee7c6099cf958faf41abf4172752ff5cdc81fcf
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-22 07:43:42 +00:00
hjk
f4a529ea95 Utils: Change signature of MacroExpander::registerFileVariables
... to take a function returning a FilePath as base.

Implementation is (not) yet changed.

Change-Id: I624efab35cf38631c816b630be5296bdf696899e
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-03 05:50:18 +00:00
hjk
08040e4e94 Utils: Move QProcess base to QtcProcessPrivate
Change-Id: I4c6811d42e051fadfcf32edb664ff3bc09e692e6
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-02 13:21:08 +00:00
hjk
f2f40efa03 Utils: Move process arguments class out of QtcProcess
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface

So move these items out of QtcProcess, later potentially to a separate
file pair.

Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 09:45:24 +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
3560a86c2e Debugger: Delay evaluation of stub runnable environment
There can be modifications in the environment between the decision
to use a terminal and its start. We want them taken into account.

Change-Id: I5622614c5fac3bdd8167c29e7b618b5e42a28287
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-11 12:26:54 +00:00
hjk
9943146cfe Debugger: Introduce an option to force QT_LOGGING_TO_CONSOLE=1
Debug output is ephemeral in nature, and does not belong into system logs.
It happens, however, on Arch. Let people override this.

Fixes: QTCREATORBUG-25421
Change-Id: I5686e256d76e5a127e3269c5f407daf39bad683f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-10 09:59:02 +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
hjk
c4b7da9ab2 ProjectExplorer/Debugger: Add a 'Run as root' option for Unix hosts
For local run and GDB debug, with or without terminal.

Task-number: QTCREATORBUG-2831
Task-number: QTCREATORBUG-25330
Change-Id: I9b5d2156bcffea4f358474ecdbcad580a4419917
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-22 13:38:25 +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
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