summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/gdb/gdbengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* All: Use the shorter access to aspect values in a few placeshjk2023-05-121-8/+8
| | | | | Change-Id: Ie0ff0e4e1cf4c2750897ea733dfccb743f44fa93 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}Jarek Kobus2023-05-041-1/+1
| | | | | | | | Follows QtcProcess -> Process rename. Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Utils: Rename QtcProcess -> ProcessJarek Kobus2023-05-041-6/+6
| | | | | | | | 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>
* Debugger: support piping the python dumper to cdbDavid Schulz2023-04-201-2/+4
| | | | | | | Fixes: QTCREATORBUG-29000 Change-Id: I7454ded07829d06a33dc1b2ec95a838ca977ca95 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* Debugger: Support piping dumpers into gdbhjk2023-04-051-8/+53
| | | | | | | | | | | This allows using dumpers available on the host being used from remotely running gdb. No lldb/cdb yet. Task-number: QTCREATORBUG-29000 Task-number: QTCREATORBUG-16246 Change-Id: Ib1a40a8c0284dcf41e8800d70ca3e632c699b2fa Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Debugger: Execute the non-installed gdb data-dir magichjk2023-04-031-4/+7
| | | | | | | ... only when there's a hope for it to help. Change-Id: I0b7215af371515a1eec8420fdf59e60037584941 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Debugger: run GDB post attach commands also for local inferiorsFilippo Gentile2023-03-271-0/+14
| | | | | | | | | | | GDB post attach commands previously where only run for Remote or Extended Remote targets. Now they are also run for Local and Local Attach targets Task-number: QTCREATORBUG-28764 Change-Id: I6cf34091f2e53ffc7ea436465c2c1de3ef637e9d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* Terminal: Enable TerminalProcessInterfaceMarcus Tillmanns2023-03-201-9/+14
| | | | | | | | | | | | | | | | Adds a new helper app "process_stub" that replaces the previous. "process_stub_unix/win". The purpose was and is to allow processes to be "injected" into other hosts apps like terminals while still being able to control and debug them. A new base class called "TerminalInterface" is used for both the new Terminal plugin and the legacy TerminalProcess implementation. Fixes: QTCREATORBUG-16364 Change-Id: If21273fe53ad545d1a768c17c83db4bf2fd85395 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-03-161-4/+4
|\ | | | | | | Change-Id: Ie591b7130b33a042509e56701384f8ff4d9cb7f8
| * Debugger: Fix several uses of remote pathshjk2023-03-151-5/+5
| | | | | | | | | | | | | | | | ... when passing into gdb. Change-Id: I8de8386fb1d398783dfa00ed883b1e44f0b2594a Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Debugger: Use more FilePath in source file handlinghjk2023-03-151-45/+41
| | | | | | | | | | | | | | | | | | | | Needed for the double-remote case. With this we have proper breakpoint markers in the text editor for a remotely running gdb on a remotely loaded project. Change-Id: If80e4a4108a4a0bcdd7612a59e2bd695213f5ea5 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Qnx: Fix passing nto-executablehjk2023-03-151-1/+1
| | | | | | | | | | Change-Id: I6c1749a74d153a8dbbbef891e8eee230226e452d Reviewed-by: hjk <hjk@qt.io>
* | Debugger: Use FilePath for Moduleshjk2023-03-141-15/+13
| | | | | | | | | | | | Change-Id: Ib3c8cf0de3560fdc77775460aa6282d69dbfef9e Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Debugger: Use more FilePaths in module handling interfacehjk2023-03-141-9/+9
| | | | | | | | | | | | Change-Id: Ie058b928900015d0f71776151547bf7ba32a62bf Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | GdbEngine: Allow remote symbol fileshjk2023-03-141-1/+1
|/ | | | | | | They may be needed when running gdb itself remotely. Change-Id: I57242e3111ab23701d197d26f1c3b12a9b3e96bd Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* GDB: Do not skip detach for core inferior shutdownOrgad Shaneh2023-03-131-4/+0
| | | | | | | | | | | | | | | | | Another attempt for 87c00b86dbf75a9204041b0b8e836415b97dc125. This section was added in 3b5ecac238, which was a refactoring commit, not sure why. It causes state discrepancy, because only on quit the "thread-exited" messages are processed, and when the thread list is clear, the engine considers it as InferiorShutdownFinished and triggers engine shutdown again, which is wrong, because it quits twice and can no longer write to the process, which is already dead at this point. Change-Id: Ic5cfced672b640865e701ac96b6fcea34d748211 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Debugger: Fix write error on terminated GDB processOrgad Shaneh2023-03-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Stopping/Aborting the debugger in core dump mode popped an error message saying "An error occurred when attempting to write to the process." Take 2 of 87c00b86dbf75a9204041b0b8e836415b97dc125. The flow is: InferiorUnrunnable -> InferiorShutdownRequested. For AttachToCore, there is a no-op transition to InferiorShutdownFinished, and then EngineShutdownRequested is triggered. This calls exitGdb, and when the thread group is clear, the engine calls notifyInferiorExited, which retriggered EngineShutdownRequested. Now the flow looks like this: EngineShutdownRequested -> InferiorShutdownFinished InferiorShutdownFinished -> EngineShutdownRequested And exitGdb is called again. Fix this by changing the Finished type to match the Requested. Change-Id: I45332d3ee1a1e9421ed516cd513542b310198c93 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* GDB: Adapt to message change on 13.1Orgad Shaneh2023-03-011-1/+7
| | | | | | | | | | | | Sample message: >&"Error while mapping shared library sections:\n" >&"`C:\\WINDOWS\\System32\\wow64cpu.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.\n" >=library-loaded,id="C:\\WINDOWS\\System32\\wow64cpu.dll",target-name="C:\\WINDOWS\\System32\\wow64cpu.dll",host-name="C:\\WINDOWS\\System32\\wow64cpu.dll",symbols-loaded="0",thread-group="i1",ranges=[{}] Library C:\WINDOWS\System32\wow64cpu.dll loaded. Change-Id: Icb4243b129faac581f37d3fdd1211448656abefe Reviewed-by: hjk <hjk@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* Debugger: Also log time stamp when handling output is finishedhjk2023-02-241-0/+3
| | | | | | | | | This helps to put the blame properly on either side of the communication. Change-Id: Id83de2bce1984f63427f655dce854ebb008a1a61 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Debugger: Save a few string allocations on result parsinghjk2023-02-241-25/+25
| | | | | | | Change-Id: I5b7614bd22d41f826b4977621d77a9aeba7f961f Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Translations: Fix stray QApplication::translate() callsAlessandro Portale2023-02-081-2/+2
| | | | | | | | | For references to the module-own context, use Tr::tr(). For references to other modules, use the right context name (with "::" prefix). Change-Id: I6dce8f1ceccb23c44d93f1826402cd3be8e98e5a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Gdb: Use path() of executableMarcus Tillmanns2023-02-071-4/+3
| | | | | Change-Id: I872da3995344b6337b5d72925768034b58f9b339 Reviewed-by: hjk <hjk@qt.io>
* Utils: Use an enum indication the possible abort of an dir iterationhjk2023-01-261-1/+1
| | | | | | | | The bool is not really clear. Change-Id: I4ce6412736aec6b1853fd53d4e535ad045748350 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Debugger: Adapt to change in FilePathChristian Stenger2023-01-181-1/+1
| | | | | Change-Id: I947f7c22bd59e445c94784fc50f29f6b571aad5a Reviewed-by: hjk <hjk@qt.io>
* Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*hjk2023-01-101-2/+2
| | | | | | | | | | | | ... and re-use the old QtcProcess::readAllStandard* names for a QString-returning 'decoded' version. For now, only use that in 'full Utf8' cases, to stay bug-compatible, the plan is, however, to employ the QTextCodecs we have already in the channel buffers. That will be one-by-one, though. Change-Id: Id209e0671920d4ea4197918e872f441254112d52 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | 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>
* Debugger: Check for skippable frames earlyhjk2023-01-031-27/+28
| | | | | | | | | This avoids unnecessarily opening of files with functions that are skip. Change-Id: Ie435949ad4033444ad5814a91109f33e022711d0 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Docker: Add Filepath::localSource()Marcus Tillmanns2022-12-161-1/+3
| | | | | | | | | | | | FilePath::localSource can return a filepath that represents a local version of a remote file. It is used to let the debugger select the local version of a file when debugging a remote target. Change-Id: Ieb934ef0d454e8ff55e71df41dca825974d85da7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* Debugger: Remove DebuggerCommand::arg(FilePath)hjk2022-11-171-2/+2
| | | | | | | | | It's better when the user code has to be explicit in what format and/or which parts of the FilePath is needed. Change-Id: I9d70e073f853a1bbc47c8482ebe77d7c4612b4b7 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Debugger: FilePath-ify .so libs handlingAlessandro Portale2022-11-171-1/+2
| | | | | | | | | Side-effect is the stabilization of the order in which the paths are passed to the debugger (was random, before). Change-Id: I2dba3ae6f2feef57b26eab93dee0903ee2f93dde Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* Utils: Add sorted() functionChristian Kandeler2022-10-251-3/+2
| | | | | | | | | For simpler calling code. Change-Id: Ia0a16a28770fd172f74d06a626148248bf5d3c0c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Get rid of unneeded includes of RunControlJarek Kobus2022-10-251-1/+0
| | | | | | | | | | Removed also some other includes that were marked with yellow triangles. In some cases includes of runcontrol.h were substituted with other includes, like qtcassert.h. Change-Id: Ica40f68198c7f8f70e6047acb2eddc8ef017e43d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-5/+5
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I88edd91395849574436299b8badda21bb93bea39 Reviewed-by: hjk <hjk@qt.io>
* GdbEngine: Support interrupting docker executableMarcus Tillmanns2022-09-151-11/+3
| | | | | | Change-Id: I084ff34b0455f069868aaac10d0003ac81ef1903 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: hjk <hjk@qt.io>
* Debugger: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*Eike Ziller2022-08-311-3/+5
| | | | | | | | | | | | And instead of qgetenv. Takes Qt Creator's setting at "Environment > System > Environment" into account, which makes it easier on some platforms to set them (e.g. macOS), can be configured differently in different settings paths, and potentially can be changed at runtime (depending on usage). Change-Id: I3ea7623fb528e13a202afa2f89b00e5ee83962d8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | 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>
* Merge remote-tracking branch 'origin/8.0'Eike Ziller2022-07-121-2/+3
|\ | | | | | | Change-Id: I37a1f78caf9ae258c6b052efa3be15b3dbcbe164
| * docker: Fix run environment setupMarcus Tillmanns2022-07-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Debugger: Convert to Tr::trhjk2022-07-081-115/+112
|/ | | | | Change-Id: I5d2475c790851c68f9997ac6af72b5eaca58482d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* GdbEngine: Don't call blocking waitForStarted()Jarek Kobus2022-06-211-13/+21
| | | | | | | | | 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>
* Utils: use cleaned stdout all over the place againDavid Schulz2022-06-171-1/+1
| | | | | | | Amends 5ee880ce5e6998170823e6fc9afb6b6c36c6170a Change-Id: Ie0202db7d8455372c3697087d9571db6706b45a1 Reviewed-by: hjk <hjk@qt.io>
* Debugger: Use ProcessResultData a bit morehjk2022-06-161-1/+2
| | | | | | | Instead of its individual items. Change-Id: Icd668a61de1c2de676e0a44769f1c1bb5375c523 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Debugger: Fix path to uninstalled gdb datahjk2022-05-161-2/+2
| | | | | | | | | Affects only self-build gdb. Amends adf1243ed9397f98b3c0b5352711de0d5c05c73a. Change-Id: I0b8380f27c14e155629aaf7235721aa80c0a3d45 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Debugger: Remove foreach / Q_FOREACH usageArtem Sokolovskii2022-05-031-13/+16
| | | | | | | Task-number: QTCREATORBUG-27464 Change-Id: Ib49afb4d0283aeeffead6b31e1a3d0bcb9a7ae14 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* Utils: Add a QString-based write to QtcProcesshjk2022-04-281-1/+1
| | | | | | | | | | | 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>
* IDevice: Make it possible to forward declare Ptr and ConstPtrJarek Kobus2022-04-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | 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>
* GdbEngine: Connect to QtcProcess::done() signalJarek Kobus2022-04-141-30/+15
| | | | | | | | 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>
* ProcessInterface: Rename interruptProcess() -> interrupt()Jarek Kobus2022-03-101-1/+1
| | | | | | | | Both functionalities meant to do the same. Change-Id: Idd9373cdb24b7b41f9e4befb09326c339263eeb1 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* QtcProcess: Limit the inclusion of qtcprocess.hJarek Kobus2022-03-021-1/+1
| | | | | | | | | | 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>
* DeviceProcess: Minimize the usage of DeviceProcessJarek Kobus2022-02-281-1/+0
| | | | | | | | | | 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>