Commit Graph

22 Commits

Author SHA1 Message Date
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