Commit Graph

104 Commits

Author SHA1 Message Date
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
Cristian Adam
1a37da15c7 Debugger: Add our lldb to the system search paths
This way the user doesn't have to manually register lldb.exe

Change-Id: Id0a19de0962d8ba47a66a8d1909dfe2eb5ca0a6f
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-11-21 14:38:33 +00:00
Cristian Adam
6b312ad54c Debugger: Speed up startup on Windows
The Qt SDK would not write the "Version" tag in the xml file, but the
supported ABI and engine type are set.

Only retrigger the debugger detection only if the version, and the ABI
and engine type are not set.

Change-Id: Ib73b1809f9dc6a16fa1988ee0e40e4d8131c667e
Reviewed-by: hjk <hjk@qt.io>
2023-08-30 11:54:24 +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
hjk
8d0aa34bfc Plugins: A bit more Keys and Store
Change-Id: Iee55eeaa881dd9f2047fdbe95ad8d827f4ba34e0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-25 08:00:02 +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
hjk
cf138ad909 Debugger: Small corrections to "Generic" item handling
Change-Id: Idd8f6a64aa64b8f13e713b3337ad1f8f2b8735db
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-29 06:30:02 +00:00
hjk
66c08a824d Utils: Rename most FilePath::{from,to}Variant uses to {from,to}Settings
Specifies the main purpose more clearly. The remaining ones a "true"
(internal) variants in models and as action data.

Change-Id: I8dd3c846e419f29d88283c2f48268ef6685b19fe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 09:00:30 +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
Marcus Tillmanns
1ba366c5c0 Debugger: Fix environment when initializing
Previously when detecting / checking debuggers the process would be
started with the Host environment set. This was incorrect for remote
debuggers.

Change-Id: Icd210dbfc9437e9abd2e0c4248e5503129bf6d8b
Reviewed-by: hjk <hjk@qt.io>
2022-11-17 13:08:14 +00:00
Orgad Shaneh
40a1a719fe Debugger: Improve ABI compatibility matching
Debugger ABI compatibility is not the same as the implementation in ABI.
For instance, GDB can support multiarch targets, so matching the arch is
not good enough.

Use DebuggerItem::matchTarget and adapt it to consider ABI mismatches as
MatchesSomewhat for GDB/LLDB, which are potentially build with multiarch
(unfortunately there is no easy way to tell, at least for GDB).

Amends commit c04f3a94ea.

Fixes: QTCREATORBUG-28020
Change-Id: I555c4e886c641bfdf50ca660eda499c18260f6f4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-09-05 11:13:41 +00:00
hjk
d139ee15fa Debugger: Simplify legacyGdbTargetAbiString handling
Change-Id: Iafcd998b8e05e8ce64e0fd2e3cefc4c944374153
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-05 09:09:39 +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
Alessandro Portale
b2af450cdb Debugger: (Re-)Fix start of Android lldb from NDK 23.x on Linux
In order to help lldb locate libpython3.9.so, we need to point
LD_LIBRARY_PATH to the right lib/ path inside the NDK.

Amends: b54bf8ad86

Reason for amend: The "prepend" use-case of Environment::prependOrSet
failed due to the undefined separator. Now, use
Environment::prependOrSetLibrarySearchPath instead, since that handles
the separator and knows the environment variable name.

Fixes: QTCREATORBUG-27297
Change-Id: I770a6335a7a26c65d23c930f7d6f9795b3dc52b5
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-06-17 06:19:55 +00:00
hjk
d76458a8b6 Utils: Replace Environment::size() check by some isValid() function
More descriptive, and later implementable without full expansion.

Change-Id: Ic3b17ea0b07273f292827a7b63e7695b4bd1cf23
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-03 09:42:26 +00:00
Eike Ziller
3b2134711b Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/webassembly/webassemblyrunconfiguration.cpp
	src/tools/processlauncher/launchersockethandler.cpp

Change-Id: Iab052af98013aa59282c16f22ae6e9ecb32f50c4
2022-04-20 16:12:41 +02:00
Alesandro Portale
b54bf8ad86 Debugger: Fix start of Android lldb from NDK 23.x on Linux
In order to help lldb locate libpython3.9.so, we need to point
LD_LIBRARY_PATH to the right lib/ path inside the NDK.

Fixes: QTCREATORBUG-27297
Change-Id: I4c234fabf291dfb5f5240120541897a79cb6933a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-13 11:18:15 +00:00
Rafael Roquetto
b2920fb76a QNX: Fix debugger detection
The QNX gdb binary requires the QNX_TARGET env variable to be set even
for codepaths that do not make use of it, namely, when invoking gdb with
the --version or --configuration parameters to detect the ABI. Failure
to set this variable causes gdb to fail with "QNX environment not set!"
instead.

This patch works around that by setting a phony QNX_TARGET variable in
these occasions.

Change-Id: I9f2638c422eb56516b87dde049186579d238de5c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
(cherry picked from commit 88aec12075)
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-09 22:38:34 +00:00
Rafael Roquetto
88aec12075 QNX: Fix debugger detection
The QNX gdb binary requires the QNX_TARGET env variable to be set even
for codepaths that do not make use of it, namely, when invoking gdb with
the --version or --configuration parameters to detect the ABI. Failure
to set this variable causes gdb to fail with "QNX environment not set!"
instead.

This patch works around that by setting a phony QNX_TARGET variable in
these occasions.

Change-Id: I9f2638c422eb56516b87dde049186579d238de5c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2022-03-07 00:49:28 +00:00
Jarek Kobus
8e0ae8ba96 QtcProcess: Limit the inclusion of qtcprocess.h
Move the rest of QtcProcess enums to processenums.h.
Move ExitCodeInterpreter into processenums.h.
Remove superfluous Utils:: prefix.

Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-02 13:30:39 +00:00
Alessandro Portale
4aea270790 Debugger: Set Python env also for ndk-lldbs outside the SDK
When using an NDK installation which was not installed via an Android
SDK manager, we cannot presume that the included lldb binary has a path
containing "ndk" or "ndk-bundle".

Looking for "/toolchains/llvm/prebuilt/" in the path should detect any
ndk-provided lldb.

Change-Id: Icbaab0915f5877ca37ee44cbca6cc37360363b5c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-12-06 06:38:16 +00:00
Eike Ziller
164aae53d2 Merge remote-tracking branch 'origin/6.0'
Conflicts:
	src/libs/utils/theme/theme_mac.mm
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/debugger/lldb/lldbengine.cpp

Change-Id: I5f2c62e0bce6c91a53a554b3278dbe23ff7dde36
2021-11-11 13:04:42 +01:00
Alessandro Portale
f84f430caf Debugger: Set "PYTHONHOME" for Androids lldb as native path
The correct path separators in this case make the difference beween
breaking on a breakpoint or not.

Change-Id: Ia33682e559ffe172a571bec6b78b32fca14d98f5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-11-10 10:30:00 +00:00
Alessandro Portale
d33cd5194a Debugger: Consolidate search code for python-path
Not just to deduplicate/reuse code but also to make make it clear that
different places where lldb is called, the same preparations have to be
done.

Change-Id: I104aca845fd7b42f63443bda2502574f4d28b411
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-11-09 09:35:23 +00:00
Christian Stenger
50b2395804 Debugger: Fix running android lldb
..when gathering version information.

Change-Id: I99d69de661edad856fe66a045e8e2ee03036dd2c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-08 11:40:49 +00:00
Jarek Kobus
3562c5e96e Remove unneeded includes of QProcess from cpp files
QProcess wasn't used in these files.

Change-Id: I24900bcf312eb6ea1ca3bc0c753cebb505ec552b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-11-01 12:04:41 +00:00
Alessandro Portale
5cde121aaa Debugger: Enable detection of Android Studio's lldb frontend
Android Studio (at least on Windows) ships an LLDBFrontend(.exe) which
differs in file name and version output, so that the code in
DebuggerItem::reinitializeFromFile needs to be tweakd a bit.

Fixes: QTCREATORBUG-26504
Change-Id: Ic989a6110e03088148c28a7fe6248e5f836ea2ea
Reviewed-by: hjk <hjk@qt.io>
2021-10-29 14:15:36 +00:00
Alessandro Portale
6703162783 Debugger: Add commandline to "Unable to determine gdb target ABI" warning
Helps finding out which gdb doesn't want to tell.

Change-Id: Iab374f577ee133a3bad576dd425cad5c91391f41
Reviewed-by: hjk <hjk@qt.io>
2021-10-12 13:02:20 +00:00
hjk
4ceeeca715 Debugger: Remove some uses of FilePath::toFileInfo()
Change-Id: I78037741084630fc6852f5805595ec2943db64d2
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-23 11:46:08 +00:00
hjk
4652ef286b Debugger: Show output of debugger detection
... in tooltip of debugger path lineedit.

Helps with cases where necessary libraries are missing.

The tooltip is a bit hard to recognize, but as such cases now also
are marked in red text there's at least some direct hint that something
is not ok.

Change-Id: Ic5da8dcb1921a98f91f6eed755fa87ce5feed698
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-06 11:12:12 +00:00
hjk
7b7fb9f6c7 Debugger: Code cosmetics
Namespaces, names, ...

Change-Id: Id0b65585b8849e8bb47d63f6eba1c23b9db1a2c2
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-14 09:31:46 +00:00
hjk
076d1bf10a Docker: Fix debugger auto-detection
Mark detected debuggers as such and give them some bonus to match,
overriding other hacks.

Change-Id: Iaf4d88fa22dd50e68124b61087d4c742f7a56d0f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 08:28:56 +00:00
hjk
430e81facd All: Replace most SynchronousProcess by QtcProcess
Change-Id: I0bf22fef2cd4a7297ef5a1e9aa9c3e2b9348ba42
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 07:55:31 +00:00
hjk
0ba4338467 Utils: Rename QtcProcess::Result::Finished to FinishedWithSuccess
To make clear that this is not just any finish.

Also change FinishedError to FinishedWithError, to create
symmetry.

Also adapt enum member description to reality.

Change-Id: I13e05391eb86fdb24e2ae660f14dfddb282e1104
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-02 14:16:36 +00:00
hjk
90ad902486 Utils: Remove CommandLine argument from QtcProcess::run{,Blocking}
Makes run() more similar to what start() looks like.

Also add some asserts to make sure run() and related functions are
only called on SyncronousProcesses, as these are currently the only
ones where this works.

Change-Id: Idee6076c3f40a484db5c17f5bb348698cc83d220
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-19 13:01:51 +00:00
hjk
55f768e1b0 Utils: Make process results accessible through QtcProcess object
The result is fully stored in the object anyway. Using the extra
SynchronousProcessResponse structure only causes copies of
the data and complicates access on the user side in
a lot of cases.

The result bits are now also accessible individually.

There's obvious room for follow-up changes on the topic, e.g.
ShellCommand::runCommand's parameter list could shrink to
just a SynchronousProcess parameter.

Change-Id: I45aa7eb23832340be06905929280c012e1217263
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-14 13:19:01 +00:00
hjk
c23cdd9262 Utils: Merge {synchronous,qtc}process.{h,cpp} file pairs
Mechanical to prepare merging the actual classes.
Adapting #includes.

Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-10 09:47:51 +00:00
Cristian Adam
ee33fd6409 DebuggerItem: Pass environment to debugger probing
QNX 7.1.0 requires that the QNX specific environment variables are
present at the time of running the gdb executable.

Without this the QNX Device configuration fails with the:
"Configuration already exists or is invalid"

Change-Id: I1cb8da58247247ac8248cb613f73e2e28d350e9e
Reviewed-by: hjk <hjk@qt.io>
2021-05-07 13:45:35 +00:00
David Schulz
5cd057d9fe Debugger: Prevent calling windows lldb on startup
The LLVM package on windows contains an LLDB linked against python but
misses a python library. Calling this lldb to get the version number
results in an ugly error message that python36.dll cannot be found. Use
the file version info instead.

Fixes: QTCREATORBUG-23848
Change-Id: I6d8e6cac07b427de564eaaedf7de369391aed37e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-24 13:52:58 +00:00
hjk
79010891e1 Debugger: Drop clang and llvm revision from LLDB version number
They are mentioned as separate lines in the lldb --version output
for self-build lldb binaries.

Change-Id: Ib0d6e46874ad5b576ac20a6aeab823d51571c0f2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-08 10:59:05 +00:00
hjk
43b658e9e7 Utils: Drop Utils::SkipEmptyParts again
We require Qt 5.14 nowadays.

Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-21 12:42:27 +00:00
hjk
1c81a3b3e8 All: Use Utils::SkipEmptyParts
Task-number: QTCREATORBUG-24098
Change-Id: Iab45de9a9c17ddc39a0e343b1175d4f6cb94b098
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-17 05:55:25 +00:00
hjk
37b079a19c Debugger: Some FileName cosmetics
Use {from,to}Variant for settings, and one time fromUserInput is enough.

Change-Id: I5774f425a4c775b0d78b87c60eabf7f48d78a082
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-14 12:30:32 +00:00
Denis Shienkov
96c1fbcd0a BareMetal: Long live support for KEIL uVision v5.x debugger
This patch adds debugger integration from the KEIL uVision IDE:

* http://www2.keil.com/mdk5/uvision/

This IDE has the uVision Socket Interface (UVSC) that allows
to the applications configuration, building and debugging:

* http://www.keil.com/appnotes/docs/apnt_198.asp

Besides, it provides a binary client libraries for Windows, which
are implements some API which we are use in this patch.

Currently implemented the following features:

* Enumeration of a stack frames.
* Enumeration of a threads (tasks).
* Registers view (read/write).
* Local variables view (read/write).
* Watchers view (read/write).
* Disassembler view.
* Current location marker.
* Break-points.
* Step-in.
* Step-over.
* Step-out.
* Step-by-instruction.
* Start/stop/pause/continue debugger.
* Auto-detection for the installed uVision instances (as debuggers).
* Wizard for choosing and configuring of the UVSC debug providers.

At this moment added support only for the 32-bit ARM devices, provided
by the STMicroelectronics:

https://www.st.com/en/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus.html

For this are implemented two debugger providers:

* Simulator - allow to simulate the target device.
* ST-Link v2 - it is a HW debugger.

This implementation tested only with the QBS using the following
target boards:

* NUCLEO-F767ZI (based on STM32F767ZIT6 MCU).
* STM32F4DISCOVERY (based on STM32F407VG MCU).
* STM32F103x (based on STM32F103C8T6 MCU).

A more detailed information about this patch can be found in a
bug-tracker.

Fixes: QTCREATORBUG-23426
Change-Id: Ie36a1f7430b56c33d6665cc35e43fe9bd95d28f1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-04 13:48:47 +00:00
David Schulz
6fc24653b8 Debugger: prefer cdb for msvc targets
Change-Id: I4d305ae6f3b54d7f724f2cfbde6062663e3c0ad1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-30 13:43:42 +00:00
hjk
ddf0dd8734 Utils: Add a FilePath::isDir() convenience function
Change-Id: I1df0ee1b136299ae6e4f2e5bd0bdc24bfeca33dd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-11 12:46:10 +00:00
hjk
7705fbb701 Debugger: Code cosmetics
Remove uses of foreach, ...

Change-Id: I3997d4dffc63d58c386c70b08063ecb894ef1abb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-07-26 10:13:27 +00:00