Commit Graph

338 Commits

Author SHA1 Message Date
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
hjk
15d6e1df1b Debugger: Use a full class for DebuggerRunWorkerFactory
This continues the work started with de6c7696d2.

Change-Id: Ifc306347f2346909a9eba39c74449c559a7c2f76
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-06 07:16:17 +00:00
Eike Ziller
81629e9228 Merge remote-tracking branch 'origin/9.0'
Change-Id: Id7665d5a269ef58cbbb2dbfc1e5b0d1820c4e13e
2022-11-17 16:11:52 +01:00
Alessandro Portale
92f7da917e Debugger: FilePath-ify .so libs handling
Side-effect is the stabilization of the order in which the paths are
passed to the debugger (was random, before).

Change-Id: I2dba3ae6f2feef57b26eab93dee0903ee2f93dde
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-11-17 10:24:07 +00:00
hjk
2d8dc4c779 Debugger: Disable re-running
It's currently broken in a lot of configurations.

Change-Id: Ic948bb619c4860ba0c0d81a383412e6d0b007367
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-16 10:10:33 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
Alessandro Portale
a917770053 Replace QtSupport::QtVersionNumber with QVersionNumber
Task-number: QTCREATORBUG-27786
Change-Id: I71a44709c264829f629c9dfce702076eda297a77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-09-19 12:08:39 +00:00
Marcus Tillmanns
bf9bfeaa9a Debugger: Warn about QML Debug Mode not being enabled
Previously we only warned the user that he has to enable qml debugging
in both run & build config for desktop runs.

With this change we now also warn for other types of devices
( e.g. iOS / Android / Remote debugging )

Change-Id: I1437edc9841668299703dad980a292178c891cfe
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-09-01 13:31:07 +00:00
Eike Ziller
d5bacfc087 Debugger: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*
And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).

Change-Id: I3ea7623fb528e13a202afa2f89b00e5ee83962d8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-31 06:25:01 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
hjk
9894c6eaf0 Debugger: Convert to Tr::tr
Change-Id: I5d2475c790851c68f9997ac6af72b5eaca58482d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-08 12:32:38 +00:00
hjk
551d458605 RemoteLinux: Use path on device for fallback gdbserver
This was using a gdbserver from the local system which appeared
to work with "local remote" test setups, but failed in real life.

Fixes: QTCREATORBUG-27752
Change-Id: I24c46dd737fc5396caeeedb55258e4edb465cbb0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-28 11:31:49 +00:00
hjk
1ffe32187a ProjectExplorer: Remove RunWorker::runnable()
A convienience function that leads to an interface that's "too stiff".

Change-Id: Ide2e5fd991707d08690e7e384e9048a30e0828f4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-31 07:36:38 +00:00
hjk
fc7634d730 Debugger: Remove DebuggerRunTool::setInferiorDevice()
Handled by the device implicit in FilePath nowadays.

Change-Id: I45b0e1b03de486df678e239143e2bdd995bee380
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-30 10:17:10 +00:00
hjk
f79a71df7b ProjectExplorer: Reduce use of Runnable in SimpleTargetRunner
Runnable functionality is nowadays mostly accessed more directly
in QtcProcess and its setup functions.

Change-Id: I2a2b5433aef1d464dc58d5a35069376dee051d57
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-25 10:32:23 +00:00
Jarek Kobus
87f3e7563c Ssh: Rename SshConnectionParameters into SshParameters
Move it to its own header.
Get rid of SshConnection and SshConnectionManager,
as they are not used anymore.

Change-Id: I52fe20d7816ea57e7a7158ab2ae9565d50a76e21
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-23 12:03:39 +00:00
Artem Sokolovskii
27fddc8dc7 Debugger: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: Ib49afb4d0283aeeffead6b31e1a3d0bcb9a7ae14
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-05-03 09:32:04 +00:00
hjk
a579fa52ee ProjectExplorer: Rename some RunControl functions
Change-Id: Ia86a50100ddfd465d548863ae8d58033a5dbafc0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-02 08:10:28 +00:00
hjk
28cfdf388a Promote previously python-specific InterpreterAspect
... and drop PythonRunConfiguration, which is a plain RunConfiguration now.

Change-Id: I540cb738180fc1424f730d6d1998886915ce527b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-04-27 08:54:22 +00:00
Jarek Kobus
bdbfa4ba0d CoreUnpacker: Connect to QtcProcess::done() signal
Instead of connecting to finished() signal.
Implement some error handling.
Fix reporting a stop, instead of start, on stop.

Change-Id: I6c528204416d8c5ba715875dd3bf5172007d9477
Reviewed-by: hjk <hjk@qt.io>
2022-04-14 12:39:28 +00:00
Jarek Kobus
7fadaff5d4 IDevice: Make it possible to forward declare Ptr and ConstPtr
Most inclusions of idevice.h inside other headers are
required just because of IDevice::Ptr or IDevice::ConstPtr
was used there. Unfortunately, since these "using"
are defined inside a IDevice class, we just can't
forward declare IDevice::Ptr nor IDevice::ConstPtr.

Instead, create a separate header that defines
IDevicePtr and IDeviceConstPtr while having IDevice
forward declared. Redefine IDevice::Ptr/ConstPtr
inside IDevice to use IDevicePtr/IDeviceConstPtr.

Now, instead of forward declaring a IDevice::Ptr
it's sufficient to include the idevicefwd.h.

This drops the number of files being recompiled
after touching idevice.h from ~770 to ~210.

Change-Id: Ib6f2982aa0761fb4cd6593badb9c3c0c527ea535
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-04-14 12:27:04 +00:00
hjk
a26f0ba808 Debugger: Avoid one use of RunControl::runConfiguration()
Change-Id: Iaf9fb0cee4544121a4df433c3726d98ae0175ff2
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-04-14 09:25:46 +00:00
hjk
530b9ae85a ProjectExplorer: Copy more RunConfiguration data to RunControl
The aspects are now responsible for defining what data needs
to be copied and also to provide a suitable interface (kind
of source-compatible to direct use) for access.

The important change here is that RunControl::aspect(...) doesn't
need to access RunControl::runConfiguration() in fully aspectified
RunConfigurations anymore. In not-fully aspectified the runConfig
access is moved to the user code to make the problem visible there.
Long term, aspectification should be finished.

As an additional benefit, the resolving of macros etc can
now be done at the correct time.

Change-Id: I690d9f8f696ce9b4efd42082ba3f81b514efcb77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-04-12 08:43:09 +00:00
Jarek Kobus
176ec31817 CoreUnpacker: Get rid of no-op call to QtcProcess::terminate()
Calling QtcProcess::terminate() after disconecting from
process signals is a task for implicit ProcessReaper.
Delete the process instead.

Change-Id: I59b0aa1d9df602077d006084635a5321beae0010
Reviewed-by: hjk <hjk@qt.io>
2022-03-31 10:30:10 +00:00
Jarek Kobus
4bb4bc2a99 Use ProcessInfo instead of DeviceProcessItem
Remove DeviceProcessItem class.

Change-Id: I2fcac473dc12b47f50c329645f27d60619304e77
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-02 09:53:29 +00:00
Jarek Kobus
f1e973de79 RunControl: Drop IDevice * from doStart()
Use device set inside passed runnable instead.

Grep for all usages of RunControl::start().
If passed device wasn't nullptr, set this device
inside passed runnable. Otherwise ensure that
passed runnable contains device set to nullptr.

Change-Id: I06fd42a16246fa9fedd81eeb47481a217f887cb0
Reviewed-by: hjk <hjk@qt.io>
2022-02-23 16:28:01 +00:00
Jarek Kobus
239688180d Fix running as root
There is no need for TerminalRunner::setRunAsRoot()
as debugger is already being run as root.
Implement runAsRoot for non-terminal QtcProcess, too.

Fixes: QTCREATORBUG-26964
Change-Id: Id5110db86b7b809a5608714464241cee73875f2b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-02-03 10:23:25 +00:00
hjk
25f5771aa4 Rename QtSupport::BaseQtVersion to QtVersion
... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid
conflicts.

Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-24 12:13:19 +00:00
Jarek Kobus
d6f56254d1 Get rid of QtcProcess::workingDirectory() overload
Adapt all callers' code so that it passes the FilePath
instead of QString. As a consequence introduce
TemporaryDirectory::masterDirectoryFilePath() and use
it where easily possible.

Change-Id: I14564949b3b916921e32a2957c84c03d1da43af2
Reviewed-by: hjk <hjk@qt.io>
2022-01-18 17:18:34 +00:00
hjk
aac740f127 Utils: Make Utils::is64BitWindowsBinary operate on FilePaths
Change-Id: I8ef840219bc93f77f5a55e38013facf892de759d
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-11-11 09:49:37 +00:00
David Schulz
67607e4bc6 Debugger: adjust inferior paths for remote debugger
Change-Id: I251c7a69b6595848c737c2547d22d8e0a4f2076a
Reviewed-by: hjk <hjk@qt.io>
2021-10-27 05:34:28 +00:00
Leena Miettinen
e95778707b Debugger: Fix UI text
Task-number: QTCREATORBUG-26458
Change-Id: I6625d30e2eb2d2fcca87360f84d50109632071f2
Reviewed-by: hjk <hjk@qt.io>
2021-10-25 15:19:38 +00:00
David Schulz
5a2b58550e Debugger: use Qt version from kit as fallback for dumper
Fixes: QTCREATORBUG-26456
Change-Id: If2cd664212b3fa07d7abaef7a1173f79716884bb
Reviewed-by: hjk <hjk@qt.io>
2021-10-25 12:06:18 +00:00
David Schulz
12bc192422 Docker: mount python dumpers to device
Change-Id: Ic0d67b4a18247439f5797a0dcf74df945ef6f61e
Reviewed-by: hjk <hjk@qt.io>
2021-10-25 08:56:16 +00:00
hjk
e78f456083 Debugger: Use MacroExpander from RunControl instead from Kit
Kit is just a subset.

Change-Id: I9ddfbfeaa5eadaa2e9a1d9a4a3409c6cf8a9658e
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-11 06:04:49 +00:00
hjk
b237db519b Debugger: Use FilePath for core files and surroundings
Change-Id: Icd648147ee907a2c5ba75042f003229bbd9226fe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-29 07:35:06 +00:00
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