Commit Graph

402 Commits

Author SHA1 Message Date
Alexandru Croitor
2d615d453e Debugger: Set a QTC_DEBUGGER_PROCESS environment variable
It can then be queried in debugger python scripts to detect that the
debugger process was launched by Qt Creator.

Task-number: QTCREATORBUG-31769
Change-Id: I7d46ff8bb0312be98ff3cdd5bab9c97e4de6164b
Reviewed-by: hjk <hjk@qt.io>
2024-10-09 15:26:51 +00:00
hjk
471067bd78 Debugger: Integrate core file unpacking into linear startup
Change-Id: I5bc257af7df24e3a22caba37dcbfe3665e8f6aa1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-10-08 09:13:30 +00:00
hjk
1ebd3c1750 ProjectExplorer: Dissolve SubChannelProvider
The channels can be extracted directly once the PortGatherer
is finished, before the start() of the RunWorkerTree.

Also, manager the one debug and one qml channel for the whole
runworker tree centrally in RunControl.

There is quite some potential for clean up left.

Change-Id: I2d877d34958cb67aa324c9b5a6f1529872b74b16
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-10-01 14:29:25 +00:00
hjk
b187d5ffd8 Debugger: Dissolve DebugServerPortsGatherer
Use a suitable amount of individual SubChannelProviders instead.

Remove the lumping of the perf channel and gdb/lldb channel in the
users.

Change-Id: I47d449e933799e1a10df4801dfbe99653f168f56
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-10-01 09:00:11 +00:00
hjk
49db4beb7d ProjectExplorer: Move PortsGatherer to RunControl
The PortsGatherer runworker was used in all remote setups plus local QML
tooling and injected in various ways into the tree of runworkers.

Having this centrally reduces complexity downstream.

Change-Id: I8e08a942209f5458fbdd5c9e286d05979beb8a40
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-09-30 13:00:26 +00:00
hjk
2876885e4a Debugger: Dissolve the DebugServerPortsGatherer::m_channelProviders[]
Try to simplify the structure. Lumping them together is not really needed.

Change-Id: Ie31411448f66df29326219bcf652fb3da16a54bd
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-09-27 14:56:54 +00:00
Jarek Kobus
37a9afe3f6 ProjectExplorer: Dismantle ChannelProvider
Merge it with DebugServerPortsGatherer.

Change-Id: I0b5448574cc4eca1f13040bc977f4427172df9ce
Reviewed-by: hjk <hjk@qt.io>
2024-09-27 13:33:39 +00:00
hjk
265491e408 Debugger: Dissolve DebuggerServerRunner
Replace it with a plain (optional) Process in the main debugger
startup sequence.

Change-Id: I9b67bc99625aba68a923a362fc5bf9be828a8fb1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-09-27 13:24:42 +00:00
hjk
46d98c3eea Debugger: Make terminal runner direct part of DebuggerTool
... and move its setup to a time when the ports are known.

This doesn't fix the console-for-Qml problem but simplifies
the code and puts port gathering -> terminal start ->
application start in the right order.

No change in functionality intended.

Change-Id: I0b3ecc24251106b31c854d94ab7bf2f3e4a9af69
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-09-27 10:09:05 +00:00
hjk
83ebffb321 Debugger: Add an option to not show the unsupported bp warning
Done-by: Elias Steurer
Task-number: QTCREATORBUG-31455
Change-Id: I9736a2a0a1b4c3a38516b3397068d2ba2b3f455d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-08-27 13:33:56 +00:00
Christian Stenger
370c2d7787 Debugger: Fix snapshot handling
Avoid sharing the workers with the engine creating the
snapshot to avoid closing both when stopping the debugger
engine for the snapshot.
Correctly detach at finish to avoid having a runcontrol
appearing still running.

Fixes: QTCREATORBUG-31220
Change-Id: Iccb54b0fc2d7f5bf54b42a116e56c1a840b1f46e
Reviewed-by: hjk <hjk@qt.io>
2024-07-23 09:03:40 +00:00
David Schulz
2364448f91 Revert "Debugger: simplify interrupting windows processes"
Ctrl+C events are only handled properly for console applications. When
gdb debugs a GUI application the CTRL+C events are not handled. This can
be even reproduced with a plain gdb started from CMD.

This partially reverts commit 9d88da6c2b
and 670b4ec729.

Fixes: QTCREATORBUG-31131
Change-Id: I11c9d9dc08b4dbe450f38e27559b130dd317b675
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-28 05:14:33 +00:00
Cristian Adam
8a7402c7cd Debugger: Allow GDB/LLDB DAP debugger as native C++ debugger
This would allow manual registration of a GDB/LLDB DAP debugger from a
CMake configure preset as follows:

```
  "vendor": {
      "qt.io/QtCreator/1.0": {
        "debugger": {
          "DisplayName": "LLDB Dap 18.1.7 Debugger",
          "Abis": ["arm-darwin-generic-mach_o-64bit"],
          "Binary": "/Users/cristian/llvm/clang/bin/lldb-dap",
          "EngineType": 1024,
          "Version": "18.1.7"
        }
      }
    }
```

This way I can configure a project with a toolchain that uses a DAP
debugger (not every gdb/lldb has python bindings) and have debugging
working out of the box.

Change-Id: Id9bff26b6544b7af99caccb18cdbe0edb334218a
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2024-06-14 10:36:44 +00:00
Cristian Adam
dcaa55200b Debugger: Add "LLDB Dap" preset
lldb has a dap interface since a while now. The "GDB Dap" preset is not
compatible, since gdb uses the same executable and lldb has a "lldb-dap"
(previously "lldb-vscode") executable.

Change-Id: I4105223659de093f0ee44129527c4830d21a3090
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2024-06-13 15:02:45 +00:00
David Schulz
670b4ec729 Debugger: remove DebuggerRunTool::setUseCtrlCStub
The ctrl c stub is now used by default.

Change-Id: I802e8a4bd694bc98e8c4535875e9f2791d9dd5e9
Reviewed-by: hjk <hjk@qt.io>
2024-06-11 13:30:05 +00:00
hjk
acd3d60fb2 Debugger: Add debugger name to progress bar
... when there is more than one engine.

Mildly-related-to: QTCREATORBUG-30355
Change-Id: Idaf41b97f51c384ccf6a437d9c9c8dec922affc6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2024-06-10 13:34:30 +00:00
hjk
6aab6f61b5 Debugger: Provider Qt version externally to bridges
Extracting within the bridges is expensive.

Change-Id: Icf69db4b112230cc23e331abc0b3eb0de1323f46
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-05-16 10:03:08 +00:00
BogDan Vatra
3e4f50aeb9 Use SSH port forwarding for debugging
This feature is needed to enable debugging on remote targes which can
not expose gdbserver ports on the wild, and we must use ssh tunneling
for that job.

Change-Id: I6df712fd3b40790e89c79a7617a24430fde6805a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-04-11 12:11:24 +00:00
Eike Ziller
5af531cd39 Utils: Fix build with MSVC with C++20
Rename process.h back to qtcprocess.h

MSVC's "threads" standard header includes <process.h>, and that ends up
including our process.h from Utils.

There already was a hacky workaround in place for a similar issue with
MINGW, but that doesn't work with MSVC because that doesn't have

Simply use a name that doesn't conflict.

Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3
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>
2024-02-28 08:09:05 +00:00
Eike Ziller
8826a8b47b Merge remote-tracking branch 'origin/13.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs

Change-Id: I2a3d92a14e4dd16897d19f7d8a8c7b0ec30d14a5
2024-02-19 14:44:54 +01:00
hjk
04d7f63186 Debugger: Fix Attach to QML Port
This does not yet fix the reported problem but at least attaches and
gives a working QML inspector in a QML-only debugging session.

Task-number: QTCREATORBUG-30263
Change-Id: Ieac517c2b7c5dde24792f3bbcffe0058073ddbd1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-02-19 13:21:08 +00:00
hjk
7c5a0e6bb2 Rename RunControl::aspect to RunControl::aspectData
It's the "persisted" form of the content of the original aspect's data,
calling it 'aspect' already confused me a few times.

Change-Id: I88a6f76f0ca39d3d36dde9b84287032ceecf7033
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-02-16 10:21:15 +00:00
Dominik Holland
8f2d0dbcc9 Introduce a function to register all local run configs
Change-Id: I936fb4e970f04859ba19eb0ecf2dee1c1ce758d8
Reviewed-by: hjk <hjk@qt.io>
2024-02-01 15:58:31 +00:00
hjk
8adbb1ddab Debugger: Allow debugging of custom executables again
Amends c81efc39c.

Change-Id: I5f816371d8f08ffb127ba39891b2c5b8f7df7f20
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
2024-01-30 08:16:45 +00:00
Marcus Tillmanns
f5934d69de QtSupport: Remove dead code
"SourcePath" was meant to be set by the installer to make it easier
to find the installed source folder for a specific Qt version. This was
never implemented in the Installer and a workaround was later
created for it.

This patch removes the dead code.

Change-Id: I1c2f5c10e37a7df4643327d1071db9e2e62c8212
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-01-17 13:50:19 +00:00
Dominik Holland
c81efc39c8 Create RunConfiguration specific DebugWorkerFactories
Instead of relying on the DebuggerRunWorkerFactory to match for all
RunConfiguration, every plugin needs to create a WorkerFactory for
its own RunConfiguration.

Similar to the SimpleTargetRunnerFactory there is now a
SimpleDebugRunnerFactory which makes the setup easy.

Change-Id: I25aaabcd70f7ac649baeab4eb4c7e88d53dac91e
Reviewed-by: hjk <hjk@qt.io>
2024-01-17 10:17:41 +00:00
Eike Ziller
2e280e1c50 Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/clangcodemodel/clangdfollowsymbol.cpp
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/miniprojecttargetselector.cpp

Change-Id: I45b7fee1a1d784c44f2139fb1ede69190d23d6fd
2023-12-06 16:50:15 +01:00
Friedemann Kleint
5b28043d46 pdb: Fix duplication of command line arguments
They are already added by the Python run configuration.

Change-Id: Icfea32e00209a690901cf672a17a8ef5c23b909d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-12-06 12:32:57 +00:00
David Schulz
eb740bdd95 Debugger: add python debugger setting in run configuration
Change-Id: Ifa5d72566007e0bb006523433dcef97689677fbf
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-12-04 14:56:27 +00:00
David Schulz
09e94ae4ac Python: use kits page in python wizards
Change-Id: I1f7aaf145443481546abb868c8c167186600b848
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-28 12:17:14 +00:00
hjk
3bbda8f9da ProjectExplorer: Rename Tool{C,c}hainKitAspect
Change-Id: I74460b6402ab00f972c208023f03fac617982a11
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-27 13:35:28 +00:00
David Schulz
72a8e2e644 Python: fix pdb debugging
The pdb engine is created in the DebuggerRunTool constructor so we
cannot unconditionally overwrite the engine in DebuggerRunTool::start.

Amends 9af8ecd935

Change-Id: I0c3c88d14235bfb01543da788a7bb5e7e99018d3
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2023-11-21 13:43:24 +00:00
Artem Sokolovskii
9af8ecd935 DAP: Fix dap engine selection with the translated strings
Change-Id: I051c1f7e9776922a98f7c54676c237c63984050d
Reviewed-by: hjk <hjk@qt.io>
2023-10-04 12:36:00 +00:00
Artem Sokolovskii
cecf577dc4 DAP: Add Python debugging
Added Python support to the DAP engine in Qt Creator.

Note:
Locals aren't displayed for python. It will be fixed
in the following commit.

Change-Id: I6d3b41fecc98b92951ed0522e9201401293034d7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-08-31 08:06:03 +00:00
Artem Sokolovskii
d304e82e63 DAP: Add engine chooser
The Engine Chooser empowers users to select the desired
debugging engine when initiating DAP debugging sessions.

Change-Id: I070ff2620b318494ee715c5ac369765d4a9dc616
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-28 15:29:42 +00:00
Jarek Kobus
121d73b30f Utils: Rename ProjectExplorer::Runnable into Utils::ProcessRunData
Move it into Utils lib.

Change-Id: I3b6c16d18439cabddf59afc03116f13c1970102c
Reviewed-by: hjk <hjk@qt.io>
2023-08-17 07:44:34 +00:00
hjk
2a07253a42 Debugger: Rename debuggerkitinformation.{cpp,h}
... to debuggerkitaspect.{cpp,h}

Change-Id: Ia6316fcdc893ca066933658a52c78ef1587a76e8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-08-16 07:33:43 +00:00
hjk
aa25fdcc69 QtSupport: Rename qtkitinformation.{h,cpp} -> qtkitaspect.{h,cpp}
Change-Id: I12229e5e98b468101d32edd35be74bbda0921d89
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-15 08:59:52 +00:00
Artem Sokolovskii
1836b50f5d DAP: Separate CMake and Gdb logic in DAP engine
This commit refactors the Debug Adapter Protocol (DAP) engine
to separate the logic for CMake-based projects and Gdb-based
debugging.

- Moved CMake-specific code to a new CMakeDAPEngine class
- Moved Gdb-specific code to a new GdbDAPEngine class

Change-Id: Ia616e7b7ea2ff2071bcadd26b28b620f9aca6ac4
Reviewed-by: hjk <hjk@qt.io>
2023-08-08 14:15:30 +00:00
Jarek Kobus
be0e0490af DebuggerRunTool: Remove unused methods
Change-Id: I9f55e79bc202eedbf594100155fc18fedaf7b814
Reviewed-by: hjk <hjk@qt.io>
2023-07-21 13:44:14 +00:00
Artem Sokolovskii
4a0a6f07e7 DAP: Fix start CMake debug mode
Change-Id: I2951142736b0e6ccf2b08a7bd78b08b1e96bca6f
Reviewed-by: hjk <hjk@qt.io>
2023-07-14 09:46:20 +00:00
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