Commit Graph

361 Commits

Author SHA1 Message Date
Artem Sokolovskii
cd6e990de8 DAP: Add CMake debug to the debug panel
This commit introduces the capability to initiate
CMake Debug sessions directly from the debug panel
in the QtCretor.

Change-Id: I00245e0e14aded378e881c4049cdc41dd1fbd00e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-07-14 08:47:01 +00:00
hjk
a5e773aeee Debugger: Adapt to latest settings access style
Change-Id: I14f737612b4fe6a37e650190b587ef0b04e559ea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-14 08:39:08 +00:00
Eike Ziller
77c7e26779 Tasks: Show tool tips with information about the categories
When hovering an entry in the filter menu in the Issues view.
Also remove some categories that shouldn't be there.

Change-Id: Ifb367d69b9396c2fdc45b83ec5ffd88ac2f0eda7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-07-13 06:09:27 +00:00
Marcus Tillmanns
77edffe3cf Debugger: Support linux remote debugging with LLDB
Adds support for Linux remote debugging with lldb-server

Change-Id: I3ee08704a3116030111df75273a46a2e4888f98e
Reviewed-by: hjk <hjk@qt.io>
2023-07-06 14:22:50 +00:00
Artem Sokolovskii
1fc0ca5277 DAP: Add CMake support to DAP engine
Added CMake support to the DAP engine in Qt Creator.
This feature can be enabled by setting the environment
variable QTC_USE_CMAKE_DEBUGGER. CMake debug session can
be started by clicking "Run CMake" or "Run".

Note:
Doesn't work with "Run debugging" in this patch.
Works only with cmake 3.27.0 and newer.

Change-Id: I756ea57f507aa4a6621ad62a8c0ef52c44a5185d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-07-05 06:59:49 +00:00
hjk
e1c97d4e47 Debugger: Remove some path mapping
This reverts 67607e4bc6, which seems
not needed anymore.

Change-Id: I7c995fc158bb26acf3b4a8ad4b810fa427fcf009
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-07-04 10:35:02 +00:00
Jarek Kobus
c1f6d70445 RunControl: Remove initiateFinish() / finished()
The only difference between initiateFinish() and initiateStop()
is that the initiateFinish() deletes the RunControl automatically
after the final state was reached.

Add setAutoDeleteOnStop() property and reuse initiateStop()
and stopped() instead.

Change-Id: I8e842978831b19587a8658b4443c96a04eb7a6df
Reviewed-by: hjk <hjk@qt.io>
2023-07-04 07:29:23 +00:00
Marcus Tillmanns
31c6ff495a Debugger: Fix remote debugging macosx apps
Change-Id: I5328069ba9b82bb66dfa2c1e0d148a717d594a4b
Reviewed-by: hjk <hjk@qt.io>
2023-06-23 11:57:34 +00:00
hjk
26ef870761 Debugger: Somewhat more direct server command construction
No need to set args just to delete them again.

Change-Id: Ib97d327329a25cb907227feb22db2334908ef089
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-23 11:50:13 +00:00
hjk
ae33199d04 Debugger: Use CommandLine to set up debugger server
To allow more complex actions in the command line,
like parsing $SSH_CLIENT.

Change-Id: Ifc48a74f1fe4e42cd7ceddfd3c308bd1636212a7
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-23 08:20:01 +00:00
Eike Ziller
562c5774e3 Debugger: Fix automatic source mapping for Qt
- The QtVersion::sourcePath() was wrong because QT_INSTALL_PREFIX/src
  doesn't return the right path. Work around by checking if sources are
  found, and otherwise trying the location that we know the installers
  to put them.
- Pass the sourcePath along to the debugger run control, and use that
  instead of looking for qmake in the PATH (which fails because it is
  not in PATH).

Fixes: QTCREATORBUG-28950
Change-Id: Iffa262d6c87dbc979c449d43cd4a85e1320bcd37
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-06-16 07:15:16 +00:00
hjk
d740a355bb Utils: Rework CheckableMessageBox
Remove function overloads, thes are hard to read, to use and to extend.
I'd even argue this should be a plain default ctor and a few setters +
exec(), pretty much like Process::start() nowadays.

Move "decider" magic into a structure that can be filled ad-hoc outside
checkablemessagebox.cpp paving the ground for:

...removing  aspect dependency from CheckableMessageBox, Instead, add a
convenience function to BoolAspect.  Arguably, the latter is not needed
and could be done on the user side.

Use pointers instead of mutable references for in-out parameter.
Makes the "specialness" visible on the user side.

Pass ICore::settings() centrally as done elsewhere to reduce line noise
on the user side.

Change-Id: Ibb366353d1ea35401723fd05ce05672617a0a8fd
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-22 06:40:13 +00:00
Marcus Tillmanns
1fc2459b62 Utils: Unify CheckableMessageBox and make it look more native
Change-Id: I5690c16f38cfd2058e01441283bec28d44cadf75
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-17 08:01:13 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
hjk
46b9cd952a Debugger: Add skeleton for a debugger adapter protocol using engine
- Support the launch of an application
- Support continue/pause an application
- Support add breakpoint only after an app is launched
(I.e. preset breakpoints won't work)
- Support stop the debug session
- "Remove one break breakpoint" works but removes all breakpoints

ToDo:
- Polish the transition between stages
- Fix breakpoints handling
- Add support "Step in", "Step out" and "Step Over"

Task-number: QTCREATORBUG-27279
Change-Id: I5c32ce713f5a0f19cc3b9d995cbbadd8adf6a413
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-06 13:04:43 +00:00
Marcus Tillmanns
3cd5e32e9c Debugger: Start debugserver for remote macOS
Change-Id: I5f713892dfbaaaecb7459c288df109bfe337f891
Reviewed-by: hjk <hjk@qt.io>
2023-04-06 07:14:45 +00:00
hjk
de546ff3ec Debugger: Support piping dumpers into gdb
This allows using dumpers available on the host being used from
remotely running gdb. No lldb/cdb yet.

Task-number: QTCREATORBUG-29000
Task-number: QTCREATORBUG-16246
Change-Id: Ib1a40a8c0284dcf41e8800d70ca3e632c699b2fa
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-05 06:26:11 +00:00
hjk
305ccfe259 Utils: Replace FilePath::onDevice() by new FilePath::withMappedPath()
Basically a.onDevice(b) == b.withNewMappedPath(a), matching the order
of b.withNewPath(a).

Whether the (curretly docker-specific) path mapping is useful /there/, and
whether some of the calls are needed at all is dubious. I added some
FIXME and changed a few cases directly.

Change-Id: I7514736ce922f632f1f737bc496f6783389a42b6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-04 06:56:55 +00:00
hjk
0dc61f55c3 Debugger: Use more FilePath in source file handling
Needed for the double-remote case.

With this we have proper breakpoint markers in the text editor for a remotely
running gdb on a remotely loaded project.

Change-Id: If80e4a4108a4a0bcdd7612a59e2bd695213f5ea5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-03-15 12:34:58 +00:00
hjk
3e7d93c788 ProjectExplorer: Move some not-fully-session related bits
... out of SessionManager.

The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.

Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.

Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-01 09:26:50 +00:00
hjk
89880907f2 Debugger: Simplify paramenter setup on Windows
Change-Id: Iec44dd33287ac23d2b51ef32483eae831d2ce4bd
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-02-07 14:07:52 +00:00
hjk
4ddd28ae22 Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*
... and re-use the old QtcProcess::readAllStandard* names for
a QString-returning 'decoded' version.

For now, only use that in 'full Utf8' cases, to stay bug-compatible,
the plan is, however, to employ the QTextCodecs we have already
in the channel buffers. That will be one-by-one, though.

Change-Id: Id209e0671920d4ea4197918e872f441254112d52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-10 12:08:53 +00:00
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