Commit Graph

36 Commits

Author SHA1 Message Date
Artem Sokolovskii
a1ac447d90 DAP: Fix highlighting changed variables
Change-Id: Idae543ba3af1a7c02c22d6619857cf0cf8b04f28
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-10-05 08:14:19 +00:00
Artem Sokolovskii
44836247ca DAP: Fix coverity warning
Change-Id: Ieb8cc7133b9b2dea4a4d97ec109f82dac28f7950
Coverity-Id: 1568465
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-10-02 10:41:10 +00:00
Artem Sokolovskii
19faf1a25a DAP: Add watcher feature
It is possible currently to add/remove watcher. Also it saves
expanded structure during the debugging process.

Note:
It doesn't work for CMake because of the issue #25282.

Change-Id: Ia0a48ca5cd0062617ae427b56b001ef87d5894ed
Reviewed-by: hjk <hjk@qt.io>
2023-09-28 13:42:49 +00:00
Artem Sokolovskii
6d92639a2d DAP: Update expanded variables over debugging process
Update and save expanded variables over debugging process

Change-Id: Iff35389fb5e56c0cde549565e88288e4bc9b52e7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-09-28 12:43:02 +00:00
Artem Sokolovskii
1640b74dfb DAP: Fix the same name variables expanding
Before when several variables had the same name it could be a cause
that wrong variable will be expanded.
Now the needed variables will be expanded.

Change-Id: Icc945e573721d033db82cac85e2ed4dabb6ad25a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-25 07:16:47 +00:00
Artem Sokolovskii
6c93ca2e66 DAP: Add proper stack frame selection
- Fixed locals view freezing when scope is empty

Change-Id: I1e64217b061937ab66abf3508e2156e9a2c1460c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-21 13:13:13 +00:00
Artem Sokolovskii
7605f5c934 DAP: Add different log category for different dap engines
Change-Id: Ia21926b860f8fee7399c40ad382ff31f360f73ce
Reviewed-by: hjk <hjk@qt.io>
2023-09-12 10:52:32 +00:00
Artem Sokolovskii
578e4c13fd DAP: Add attach function to gdb dap engine
Change-Id: Id1c886cf3bbdbf85d4eed39f288107fc71317496
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-09-12 10:52:21 +00:00
Artem Sokolovskii
1b67da6558 DAP: Show variables for different scopes
Fixed displaying several the same variables.

Change-Id: I848113de3a5e142394fbdb4efd40230f43c2417f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-09-06 09:49:58 +00:00
Artem Sokolovskii
19aeb45abd DAP: Remove redundant source field in breakpoint structure
Change-Id: I30c952971353ab316791cd68cf91f192bd398b84
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-09-05 12:35:14 +00:00
Artem Sokolovskii
53718bcf1d DAP: Add locals lazy loading
Change-Id: I49c6d9fce8c6f45f1ec4cb3b6c1733d93202bc0f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-01 09:05:28 +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
34a4313f74 DAP: Fix set invalid thread as a current warning
Change-Id: I39fad868ca8996f51b2b5d8681210d92ec9de76b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-08-30 12:22:34 +00:00
Artem Sokolovskii
b80cef815e DAP: Fix rootWatchItem deletion
Change-Id: I2fcdf7547a361dcb136cd1a03325e7f5186b273a
Reviewed-by: hjk <hjk@qt.io>
2023-08-28 15:29:04 +00:00
Artem Sokolovskii
e3808cf4f4 DAP: Change unique_ptr to QObject parenting
Change-Id: I47f5db1823e69829294fb9f551a2edcb980d86dc
Reviewed-by: hjk <hjk@qt.io>
2023-08-17 12:33:53 +00:00
Artem Sokolovskii
0192c3c26d DAP : Refactor DapEngine
Extracted client part to additional class DapClient.

Change-Id: Iba472d2fb2c2390f38ad9a3a75e9e1d9a76f912c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-08-17 11:02:13 +00:00
Artem Sokolovskii
b01fcf5e7a DAP: Add enable/disable breakpoint support
Change-Id: Ice1c17e1c1e257d9f828bb6a54c643f7ecf7b387
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-15 10:23:16 +00:00
Artem Sokolovskii
3ab2da691d DAP: Add check that cmake 3.27 or higher
If CMake version is lower then 3.27
- Shows the warning in general message
- Starts CMake without debugging
- Stops debugging correctly

Change-Id: Ibb13555c20ae2961c0a3c2ef6ec0fcc25930dddc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-14 13:41:39 +00:00
Artem Sokolovskii
83d2ee56b7 DAP: Add run to line support
Note:
"Run to line" feature is disabled for CMake.

Change-Id: If8dc271fe51c6e5695f2544a71be544c7575bfa9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-08-14 12:16:36 +00:00
Artem Sokolovskii
888e7e0c6d DAP: Add select thread support
Change-Id: Ib85d7d4413284d5919a2b19016aec503c9cb5fca
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-08-14 12:16:31 +00:00
Artem Sokolovskii
8b1047aa8f DAP: Refactor dap responses handling
Change-Id: Iebc16d7e497b4f3a1deec6f52f7b89815c2cde3b
Reviewed-by: hjk <hjk@qt.io>
2023-08-14 09:58:11 +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
Artem Sokolovskii
8fcf3a695f DAP: Fix windows support
- Added using named pipe for windows

Change-Id: I45561481d63c5dd81bda14e6ace4fb0374d1b488
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-08-08 13:20:14 +00:00
Artem Sokolovskii
8b0b190b49 DAP: Fix breakpoint behavior
Before adding and removing breakpoints when debugging is running
didn't work for cmake debugging. Fixes that.

Change-Id: I59fd4ec3905365647b552753bc06da855e83ac7c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-08 09:39:26 +00:00
Cristian Adam
3c0899d736 Debugger: use TemporaryDirectory for CMake debugger
Hardcoding "/tmp" is not the best idea.

Change-Id: I9d5abd48bdf37d842d790db5ae5c4a7b994075e1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-07-28 11:55:31 +00:00
Artem Sokolovskii
eeea437743 DAP: Add displaying nested variables
Change-Id: I588dde7c0ef402fe8d6c9d43dc9f0183bfa2d733
Reviewed-by: hjk <hjk@qt.io>
2023-07-14 08:47:08 +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
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
Artem Sokolovskii
03aeee71f4 DAP: Add showing locals and stack trace
Change-Id: I5298b4c2daf45ec4503d4a210e02b7025253c054
Reviewed-by: hjk <hjk@qt.io>
2023-06-22 13:31:57 +00:00
Artem Sokolovskii
b4874b6ce5 DAP: Add thread list
Change-Id: Ide9305e246f4e0dbe687e37a96b20e99b197ea3f
Reviewed-by: hjk <hjk@qt.io>
2023-06-21 10:37:48 +00:00
Artem Sokolovskii
9ad37a3c43 DAP: Add stepIn and stepOut and stepOver
Change-Id: I7d2bb573c4fc359a4d07b4cff8867a47f9691392
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-06-21 10:37:20 +00:00
hjk
0d4a546397 Debugger: Use Utils::Text::Position instead of int line number
The column is currently unused.

Change-Id: Iabc57c8d21e807187783071efe9a82e9c1877181
Reviewed-by: hjk <hjk@qt.io>
2023-06-07 07:36:29 +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
Artem Sokolovskii
cbaeee89d6 Debugger: DAPEngine improve breakpoints handling
- Added proper "Insert" breakpoint
- Added proper "Remove" breakpoint
- Fixed errors with engine states after pause and continue

Change-Id: Icbe1b4cf549cee633809d0a1c9ab19dbf877dbf0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-04-14 15:05:36 +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