Commit Graph

1547 Commits

Author SHA1 Message Date
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
Eike Ziller
90a03391d7 Merge remote-tracking branch 'origin/8.0'
Change-Id: I37a1f78caf9ae258c6b052efa3be15b3dbcbe164
2022-07-12 13:56:23 +02:00
Marcus Tillmanns
78e7c7b2a6 docker: Fix run environment setup
When starting a debug session the systemEnvironment() was used
as the basis for the debugger process. If the docker device
did not have the same shell installed as the host, this would
break gdb as the SHELL= env variable might point to a
non-existing shell binary.

Change-Id: I7253ad3c4995eed857279146f1b258febe1ca710
Reviewed-by: hjk <hjk@qt.io>
2022-07-12 10:43:43 +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
Jarek Kobus
e3f27b3d53 GdbEngine: Don't call blocking waitForStarted()
Connect to started() signal instead and continue
setup in its handler. Handle failed to start case
inside done() signal handler.

Change-Id: Iaf184ed3e934b1bd5f8128a6aa9c72e9f27e0f56
Reviewed-by: hjk <hjk@qt.io>
2022-06-21 14:49:06 +00:00
David Schulz
153ff77a6b Utils: use cleaned stdout all over the place again
Amends 5ee880ce5e

Change-Id: Ie0202db7d8455372c3697087d9571db6706b45a1
Reviewed-by: hjk <hjk@qt.io>
2022-06-17 13:04:42 +00:00
hjk
af4a6b1a74 Debugger: Use ProcessResultData a bit more
Instead of its individual items.

Change-Id: Icd668a61de1c2de676e0a44769f1c1bb5375c523
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-06-16 15:43:25 +00:00
hjk
1a019ca02a Debugger: Fix path to uninstalled gdb data
Affects only self-build gdb.

Amends adf1243ed9.

Change-Id: I0b8380f27c14e155629aaf7235721aa80c0a3d45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-16 07:35:01 +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
aa3bdcb427 Utils: Add a QString-based write to QtcProcess
Centralize some boiler plate and warn about best-guessed cases.

Keep the QByteArray based access as writeRaw()

Fixes: QTCREATORBUG-27445
Change-Id: I948d80fba78b36cf85cc73664175ab05eb7707d4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-04-28 08:20:11 +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
Jarek Kobus
876047d6cf GdbEngine: Connect to QtcProcess::done() signal
Instead of connecting to errorOccurred() and finished() signals.

Change-Id: Icf3e3d8cfdae3890cb4991da8b7d7e74e529ad39
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-14 11:06:54 +00:00
Jarek Kobus
82108e949a ProcessInterface: Rename interruptProcess() -> interrupt()
Both functionalities meant to do the same.

Change-Id: Idd9373cdb24b7b41f9e4befb09326c339263eeb1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-03-10 08:41:05 +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
Jarek Kobus
8af62eb256 DeviceProcess: Minimize the usage of DeviceProcess
DeviceProcess doesn't provide any public API, so
replace all usages of it with QtcProcess.
Keep using DeviceProcess only for reimplementations.

Change-Id: I35a14251a81dd0dde426f56ca2e809b527cc863c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-28 13:10:42 +00:00
hjk
e2cb64471a Utils: Move QtcProcess constructor setup data to shared setup data
This includes replacing DeviceProcess terminal handling with base
member.

Change-Id: Id1541bfce33c71dddc71b4816ad0b174dce3879c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-11 17:33:48 +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
hjk
1fc83d2a56 Utils: Wrap various file system iteration flags and filters
... into a single class.

This makes passing them around as a whole easier, and opens a path
to have "generic" filters in form of a lambda or such.

Change-Id: Ibf644b2fedcf0f1a35258030710afff8f5873f88
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-26 13:13:41 +00:00
Eike Ziller
85b60d9608 Merge remote-tracking branch 'origin/6.0'
Conflicts:
	src/plugins/coreplugin/editormanager/editormanager.cpp

Change-Id: I80fe565749ad5c06dfe99436f2dc6ab4b66a2537
2021-12-16 10:50:33 +01:00
Cristian Adam
352e66531e Debugger: Unset previous Path environment variable
Newer gdb versions (11.1) on msys2 32bit environment pick up the
`Path` value and not the `PATH` value that we set.

By having one one value (`PATH`) we fix such issues.

Fixes: QTCREATORBUG-26670
Change-Id: I3fb9da75c2a037eb43a69f6f82474c7ec4972b75
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-12-13 10:53:54 +00:00
hjk
e64ce914f9 Utils/Ssh: Move SshRemoteProces::isRunning() to QtcProcess base
... and use it on a few places.

Change-Id: Id2cea709e355a46821a720e593740ac032888ced
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-12-06 13:44:23 +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
hjk
a8afa5c65c Debugger: Fix setting of Qt version fallback, again
Change-Id: I6b6cd448884800cb6d08dbdce15cb99f4ea8ba2b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-11-10 11:50:21 +00:00
Eike Ziller
588ef08d46 Merge remote-tracking branch 'origin/6.0'
Change-Id: Ib49e73e6c69d71fd0d8402c08f4344476295e409
2021-10-26 09:15:45 +02:00
David Schulz
5a2b58550e Debugger: use Qt version from kit as fallback for dumper
Fixes: QTCREATORBUG-26456
Change-Id: If2cd664212b3fa07d7abaef7a1173f79716884bb
Reviewed-by: hjk <hjk@qt.io>
2021-10-25 12:06:18 +00:00
David Schulz
12bc192422 Docker: mount python dumpers to device
Change-Id: Ic0d67b4a18247439f5797a0dcf74df945ef6f61e
Reviewed-by: hjk <hjk@qt.io>
2021-10-25 08:56:16 +00:00
Eike Ziller
bb9774de92 Merge remote-tracking branch 'origin/6.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: If8baed5564470e550a0ba5c7720915217eec2412
2021-10-21 09:13:03 +02:00
Orgad Shaneh
52f9db1ae0 GDB: Expand macros on substitute paths
Change-Id: Ifb7a7f007a7c46045d7c315c02c8309f0a599dbc
Reviewed-by: hjk <hjk@qt.io>
2021-10-15 12:09:54 +00:00
Orgad Shaneh
dafc32d8e2 GDB: Do not pass regular expressions to set substitute-path
Change-Id: If647e2d12b261ba2137c952640dfdb3a984fcfbf
Reviewed-by: hjk <hjk@qt.io>
2021-10-15 10:55:24 +00:00
Christian Stenger
2cc28dea65 Debugger: Fix compile
Amends b6d3e67270.

Change-Id: I0acf8a7bb447e99f7bccfc8f5055a49163727619
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-10-12 07:22:09 +00:00
hjk
786dbcb9e8 Debugger: Force English debugger output
So that ptrace output can be recognized.

Fixes: QTCREATORBUG-26384
Change-Id: Ibd9456963a5379c333782287754bf9aed4235dc4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-12 06:55:41 +00:00
Artem Sokolovskii
b6d3e67270 Debugger: Use iterateDirectory
Change-Id: I37010d4b33ac1c555f05abe91376b9befe9fa65c
Reviewed-by: hjk <hjk@qt.io>
2021-10-11 11:53:02 +00:00
hjk
b237db519b Debugger: Use FilePath for core files and surroundings
Change-Id: Icd648147ee907a2c5ba75042f003229bbd9226fe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-29 07:35:06 +00:00
hjk
4b5aeb9a74 Debugger: Use FilePath for debugInfoLocation
Change-Id: Id538ab4ddd1d634d0dc73a00fe42d3fd35341bea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-28 06:38:52 +00:00
Orgad Shaneh
74713e5ef1 Merge remote-tracking branch 'origin/5.0'
Change-Id: I7ca9791b95032a1f276c520f8eefde3801510eb9
2021-09-27 13:22:58 +03:00
Orgad Shaneh
76760d8d80 Debugger: Fix debugging of terminal apps with GDB < 10
Fixes: QTCREATORBUG-26299
Change-Id: I96ed413a4722799090307e6682d2ec70f4de9b56
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-24 07:05:16 +00:00
hjk
6c4c310278 Debugger: Expand Variables in Debugging Helper Customization
Fixes: QTCREATORBUG-26261
Change-Id: Ie034e3b170bad2ccd4aaa4c004c8eeeebeeaff87
Reviewed-by: Karsten Sperling Opdal <karsten.s.opdal@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2021-09-17 05:54:31 +00:00
Eike Ziller
3d4d7c7e14 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/plugins/clangtools/clangtoolssettings.cpp
	src/plugins/clangtools/executableinfo.cpp
	src/plugins/clangtools/executableinfo.h

Change-Id: Id8caf63e3e594792467d3447870086bd2d8f73b9
2021-09-13 17:03:55 +02:00
hjk
7cc4e27184 Debugger: Don't wait for responses for flushing dummy commands
As this is also used after -exec-continue we won't see a result
before the next stop and consequently run into the watchdog
timeout regularly.

Change-Id: Ibb7e42ae1810d4d9f536cf755219fba6d8aa0f96
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-09-10 05:34:32 +00:00
Orgad Shaneh
7e362326fe GDB: Ignore initial SIGTRAP when debugging mingw32 with gdb64
Task-number: QTCREATORBUG-26208
Change-Id: I97e37b6aaca19f20081750de003b012c9853a80c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-09 06:38:21 +00:00
Orgad Shaneh
9032c7741a Debugger: Fix debugging 32-bit mingw console app with 64-bit gdb
For some reason, the executable is no determined correctly.

Feed it to gdb so it will have correct debugging symbols.

Fixes: QTCREATORBUG-26208
Change-Id: Id7da405e5ec9f9331399eb049fa383099981cb94
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-09 06:38:03 +00:00
Orgad Shaneh
7a7dc86716 GDB: Fix missing token on some responses
COOKIE FOR TOKEN 0 ALREADY EATEN (InferiorStopOk). TWO RESPONSES FOR ONE
COMMAND?

Change-Id: I569a9715f073f3fbba71045f14fa30a06cd434e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-09-06 12:48:11 +00:00
hjk
20a63d6c7e Utils: Drop OsType parameter from CommandLine functions
The type is implicitly given by the command's executble FilePath.

Also, rename the rarely used addArgs(const CommandLine &) overload
to addCommandLineAsArgs() and make it strip scheme and host from
the wrapped executable as there are no uses expected where keeping
them would be the right thing.

Change-Id: Id0b76778e7e01ac16e477f36bf30bb28d96bb177
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-24 07:36:04 +00:00
hjk
adf1243ed9 Debugger: Simplify some path uses in GdbEngine
Change-Id: I5094fb5e71c664e6f6fc69648733c9307c3bc115
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-08-19 08:35:21 +00:00
hjk
52e5023bcc ProjectExplorer: Use Utils::CommandLine in ProjectExplorer::Runnable
Change-Id: Id965f1f9047dcbc3ea5c9ddaa550d12668cf8ae6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-13 15:04:30 +00:00
Jarek Kobus
d22505c41f Use refactored ProcessMode
This patch needs to be applied together with the parent change.

There are 3 basic cases:
1. The user doesn't write anything to the write channel:
   You don't need to call closeWriteChannel manually anymore.
   By default the QtcProcess you create is in ProcessMode::Reader mode.
   Internally it opens the process in ReadOnly mode and
   closes the write channel just after starting.
2. The user writes some initial data (after being started)
   and then closes the write channel:
   All what is needed now it to set the write data
   (QtcProcess::setWriteData) before calling start.
   You also use the default ProcessMode::Reader mode.
   Internally it opens the process in ReadWrite mode
   and writes the writeData asynchonously when the process
   already started. After writing the data it closes the
   write channel automatically.
3. The user writes the data also after calling start.
   All you need now is to create a process with
   ProcessMode::Writer mode. In this mode the write
   channel is not closed.
   Internally it opens the process in ReadWrite mode
   as some writers also read the data from the process.

All the code base is adapted here to the above rules.

Change-Id: Id103019d1d71a3012fd1eade226fe96b9aaa48c2
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 07:51:31 +00:00
hjk
4a42bcd4e8 Utils/ProjectExplorer: Use FilePath for Runnable::workingDirectory
... and in some using code.

Change-Id: I231ea56628908f7d305d13f07eabe8803fe8a791
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 12:51:24 +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
76cf6ce983 Utils: Add a QtcProcess flag to keep stdin open
Needed to run e.g. gdb on-device.

Change-Id: I5a98df575478f18adf1540ced44f6808bdba0b76
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-22 07:48:36 +00:00
hjk
325773b5f6 Debugger: Introduce a GdbEngine::usesOutputCollector helper
Change-Id: Ia148baeb602c8794d0b5075afd4259f1529d727f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-22 06:28:03 +00:00