Commit Graph

1484 Commits

Author SHA1 Message Date
Eike Ziller
c1f90aeca2 ICore: Change some path API to use FilePath
Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-04-26 08:03:47 +00:00
hjk
f2c34e51e9 Debugger: Fix setting of breakpoint by function name with GDB
Change-Id: Ib6194f9acc575ee089f11da6d1f3689eb7dee9af
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-19 12:08:04 +00:00
Eike Ziller
4151f091e3 Merge remote-tracking branch 'origin/4.15'
Change-Id: If0dbebdf37b0ffea2528bf6ce6d34d88554f8dfb
2021-03-16 10:55:54 +01:00
hjk
06a754cc74 Debugger: Add more information about the debugee when debugging
Fixes: QTCREATORBUG-25159
Change-Id: Ic462c8bb4d9f4f7163dbb9fcc13adce4c7172564
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2021-03-16 08:12:26 +00:00
The Qt Project
01be3816f9 Merge "Merge remote-tracking branch 'origin/4.15'" 2021-03-09 14:33:44 +00:00
hjk
641604429a Debugger: Use an aspect for the source path mapping
More in line with the other settings.

Change-Id: I86494f1955120cddda7d2f2eec8ba0fdbfd99585
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-09 12:40:12 +00:00
Eike Ziller
6371fa23a6 Merge remote-tracking branch 'origin/4.15'
Change-Id: Ia0cf8d72871437386bf8ad16a8e101bd9d97cc73
2021-03-09 13:17:52 +01:00
hjk
89646aadce Utils: Don't raise SIGSTOP in the process stub
Previously, the starting inferior was sent a SIGSTOP to avoid
progress before the debugger could attach.

However, these signals are then also visible in the debugger and
need to be ignored as part of the startup handling in Creator.

The waiting effect can be achieved less intrusively by waiting
on a pipe read between fork() and exec().

Task-number: QTCREATORBUG-25073
Task-number: QTCREATORBUG-25082
Task-number: QTCREATORBUG-25227
Change-Id: Ie70b9eb5ea865f85411c26b0dbf377a019fec8d5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-09 08:06:21 +00:00
hjk
93a5803956 Debugger: Aspectify settings
Change-Id: I527be79965250b82a0928171b17aa93bac9fa2a0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-03 07:39:17 +00:00
hjk
c4b7da9ab2 ProjectExplorer/Debugger: Add a 'Run as root' option for Unix hosts
For local run and GDB debug, with or without terminal.

Task-number: QTCREATORBUG-2831
Task-number: QTCREATORBUG-25330
Change-Id: I9b5d2156bcffea4f358474ecdbcad580a4419917
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-22 13:38:25 +00:00
hjk
2fb9d08082 Utils: Don't use ptrace in the process stub
Previously, ptrace was used to keep a tight hold on the spawned process
across the exec(), followed by raising a SIGSTOP to allow un-racy
attaching a debugger.

This makes implementation of 'Run as root' more difficult and is
apparently not needed: instead of the ptrace use, the SIGSTOP can be
raised directly, before exec().

Change-Id: I36025ac547b2a335e2a203c728d221830e4c0a7d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-18 13:18:21 +00:00
hjk
34945f84e4 Debugger: Use a class for GdbMI parser parameters
Currently only the previous from/to pair, but can be extended
by codec state.

Task-number: QTCREATORBUG-24462
Change-Id: I3d101e74d1fef65bb75ddaab1dc2eaf77201dcde
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-18 06:07:36 +00:00
Leander Schulten
54e5ff7e05 Debugger: Fix build
Amends 2081038953

Change-Id: Ieae6945b2a856b8ae253bf3a49ce8a7613e88a1f
Reviewed-by: hjk <hjk@qt.io>
2021-02-04 17:18:22 +00:00
Mattias Johansson
2081038953 Add gdb tracepoint support for Linux
Change-Id: Id2e46bae576a730f8c1b64a247aeed12e6d721af
Reviewed-by: hjk <hjk@qt.io>
2021-02-02 07:36:07 +00:00
Eike Ziller
ad09faab4e Fix build with Qt 6
Change-Id: I5c775460563dde17a363ea875d7f993e4e4d6ecd
Reviewed-by: Leander Schulten <Leander.Schulten@rwth-aachen.de>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-28 12:49:50 +00:00
BogDan Vatra
111624970d Group registers by type to make them easier to follow
These days the ISAs are adding more and more registers, which sometimes
are quite hard to follow. For instance if you're interested only in float
or only in system/CSRs registers you have to scroll down quite a lot for
monitor them.

Grouping them by thier type, it makes it much easier to follow each
register type.

Change-Id: I268626b3fe71aa8fa54be0999836caf03e8780ca
Reviewed-by: hjk <hjk@qt.io>
2021-01-21 15:22:55 +00:00
hjk
3e30c4b571 Debugger: Move initial breakpoint setting into individual branches
This avoids pending breakpoints in local attach setups now.

Change-Id: I6872a97020955180d4c3f915f6bb19c1f771f07f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-21 07:06:53 +00:00
hjk
cd6b0cb795 Debugger: Also ignore SIGSTOPs inside clone() when using a terminal
Chances are high these are triggered by the process stub. There is
a small chance for false positives here, but true SIGSTOPs by
other external sources in these locations are very unlikely.

Task-number: QTCREATORBUG-25073
Task-number: QTCREATORBUG-25082
Change-Id: I25478caf6803877f2f8cbb2edef68ae1183223a6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-14 12:47:08 +00:00
Eike Ziller
7ce3ceabe9 Merge remote-tracking branch 'origin/4.14'
Change-Id: I26a53ef81a54a2f7aa482448118298895b712941
2021-01-12 14:14:41 +01:00
Orgad Shaneh
ac32cf56a1 Debugger: Add -file-exec-file when opening a core dump
-file-symbol-file alone doesn't cover all cases. Run -file-exec-file too.

Task-number: QTCREATORBUG-24541
Change-Id: Id4d8f7057f845bce32b28cc8f4db0eadcfcfab28
Reviewed-by: hjk <hjk@qt.io>
2021-01-11 05:19:08 +00:00
hjk
1df9951d03 Debugger: Split remote and local attach handlers
Called with different timing, no real shared code currently.

Change-Id: I5a8cc32c5f38f533acfa4512518fb51932d8aab2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-08 10:37:38 +00:00
hjk
0cb171ac96 Debugger: Shift initial breakpoint setting even further down
In case of 'attach' this is still a bit too early to avoid pending
breakpoints, but we are getting there.

Also, lump in the commandsAfterConnect bits into the initial breakpoint
setting, as this is the right time. The function is mis-nomed now, will
be fixed in a later patch.

Change-Id: I8c4c53d02b4eab31e8e095865fc3cb24265c5028
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-08 10:37:33 +00:00
Tim Jenssen
b801a9339d Merge remote-tracking branch 'origin/4.14'
Change-Id: I70504e096be620434f38cd990c593950da8b24ba
2021-01-07 14:23:46 +00:00
hjk
da147880e8 Debugger: Rename 'AttachExternal' to 'AttachToLocalProcess'
And AttachCrashedExternal to AttachToCrashedProcess
And AttachCore to AttachToCore.

Clearer.

Change-Id: I47c2eca5cbdbbc0eb38b9f62b2504c96558ff112
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-07 12:11:42 +00:00
Orgad Shaneh
bb070d861b Debugger: Minor cleanup
Change-Id: Idfef663ec6701f7ed8904bd5c3dbfa87e0baaf8b
Reviewed-by: hjk <hjk@qt.io>
2021-01-07 09:14:54 +00:00
hjk
13c9b42a21 Debugger: Move initial GDB breakpoint settings after target setup
While GDB can handle breakpoints set before specifying an executable
fine, it stresses the machinery unnecessarily and fails in corner cases
("wrong" dynamic loader etc). We can avoid most of that by moving the
breakpoint setting to a later point in the process.

Change-Id: I0450a0e43a81c80bfdfefb7b67f6799042e0ec26
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-06 12:37:25 +00:00
hjk
8753889c63 Debugger: Use handleInferiorPrepared also for AttachToRemoteProcess
Same pattern as the other scenarios.

Change-Id: I065783b9ced3ad31a1918b48b44116071bb98d75
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-06 11:09:48 +00:00
hjk
c7e57ced3a Debugger: Simplify gdb startup
The reason for the special callback setup is lost in history.
A possibility is that the extra roundtrip was needed for synchronization
with earlier gdb versions and/or start up sequences. It seems to
works fine without nowadays.

Change-Id: I28c95aec2f065e9c6f0730f1ffbc3db1a3d819da
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-06 10:22:28 +00:00
hjk
d671983d81 Debugger: Drop GdbEngine::listFeatures()
The output of -list-features is nowhere near complete or usable to
determine the need of workarounds or such. We have never really
relied on it and the code was unused for a while.

Change-Id: Ide02f4d35d6075f534b756245ebe43c55ee69390
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-06 07:12:28 +00:00
hjk
b0d2c0d45d Debugger: Drop base DebuggerEngine::runEngine()
The lines between engine setup and running have always been
blurry, so it looks more and more unnatural to enforce this
in the architecture. Remove the runEngine() call from the
end of notifySetupEngineOk, and do it on the user side.

Change-Id: I3a5e158e8b3fe9b0a288d064f798e24b2ac47f86
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-05 06:21:27 +00:00
hjk
f2f139e90e Debugger: Remove DebuggerEngine::stateAcceptsBreakpointChanges()
Dead code since 3b5ecac238 (the end of the hybrid engine).

Change-Id: Ibb169ff657c8a88fdc52783a6a1f5b79fa0b29e5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-12-18 16:16:58 +00:00
hjk
4ac7bb5a01 Debugger: Use -file-symbol-file for cores, not for remote debugging
In 5467faa0d7 the replacement of -file-exec-and-symbols with
-file-symbol-file accidentally ended up in the wrong branch.

Task-number: QTCREATORBUG-24996
Change-Id: I2d6cb5432c0b11b02c3f8d3517075a7c00b05c9f
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-27 10:35:41 +00:00
Jarek Kobus
6d5e302157 Use typed syntax in calls to QMetaObject::invokeMethod
We do it wherever possible. Some places can't be fixed
since they still rely on dynamic introspection
(mainly QQuickItem cases).

Change-Id: Ia00b4a04d8b995c9a43b7bf2dbe76a60364bb8ca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-16 13:45:02 +00:00
hjk
5467faa0d7 Debugger: Use -file-symbol-file for core files with GDB
Task-number: QTCREATORBUG-24541
Change-Id: Ib6d070629f5a7d1505c272ce78f99dc14cd15fdc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-16 07:24:28 +00:00
hjk
fcaa6801cf Utils: Start replacing SavedActions by QAction or Utils::Aspect
First mechanical step here is to derive SavedActions from BaseAspect
instead of QAction.

Change-Id: I2ec95883b825462c1d867f83cc2b3bd2c2732055
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-05 08:46:27 +00:00
Eike Ziller
2a70bc1d09 Debugger: Fix build with Qt6
QStringRef gone.
ViewOptions changed.
MetaType register stream operators automatically.

Task-number: QTCREATORBUG-24098
Change-Id: Ibf98561af951aa5fc4ec483d18dafeaad02e07c3
Reviewed-by: hjk <hjk@qt.io>
2020-09-18 14:41:20 +00:00
Eike Ziller
6477a07654 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/clangtools/virtualfilesystemoverlay.h
	src/plugins/mesonprojectmanager/project/buildoptions/mesonbuildstepconfigwidget.ui
	src/plugins/qmldesigner/designercore/model/abstractview.cpp

Change-Id: I5013bd8fdd28d79cdea74380bec01d4c106adfaf
2020-08-31 14:49:19 +02:00
Christian Kandeler
4f2a21541e Debugger: Fix environment passed to inferior by gdb
We must not set variables that the user disabled.

Change-Id: I2f559aefd6aaa43298dd9c4889a614a5130622c0
Reviewed-by: hjk <hjk@qt.io>
2020-08-27 09:38:23 +00:00
hjk
5d820b79e6 Debugger: Compile fix for Qt6
QMap and QMultiMap are distinct types in Qt6

Task-number: QTCREATORBUG-24098
Change-Id: I959012739231fb3b184dcc13cebd119c83059a99
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-20 09:27:55 +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
816a1df45a Debugger: Remove one use of QStringRef
This is a guinea pig to check whether using u"..." is ok
nowadays.

Change-Id: I402816d8892211e67fb6227cd0441c20c0b33818
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-16 07:35:04 +00:00
Eike Ziller
5b364de168 Use dialogParent() instead of mainWindow()
There are very few reasons to use mainWindow() directly.
Especially for modal dialogs, using dialogParent() is important, since
that guarantees the stacking order in case of other dialogs currently
being open.

Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6
Reviewed-by: hjk <hjk@qt.io>
2020-06-02 11:44:53 +00:00
hjk
14666c801a Debugger: Drop 'set print object on' for GDB
This does not seem to affect the code paths we are using through
Python.

Task-number: QTCREATORBUG-23965
Change-Id: I2e20d6d3c1937d56293e81b74c453e83a92ddc4c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-25 10:01:03 +00:00
Sebastian Verling
38e13e4216 add lower case a-f as address match
As the addresses were only matched against upper case letters
all registers with lower case characters were not correctly parsed
and had zero values

Change-Id: Idc3da0a33b9f075d7a209cad74768e81cced2d67
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
2020-05-07 09:34:48 +00:00
Viacheslav Tertychnyi
e0e5334d83 Debugger: Fix tooltips
Fixes: QTCREATORBUG-19574
Fixes: QTCREATORBUG-23807
Change-Id: I61f997e69f4a747aff8c5e1044bb6d856494ae47
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-03 10:14:33 +00:00
hjk
06b2023420 Debugger: Remove "IdentifyDebugInfoPackages" feature
This was only ever working with SuSE and GDB, and nobody
ever tests it, nor asks for extension to other setups.

Change-Id: I7b1e3cc8c9f71df4c86b957a79d5afe02eec0758
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-25 14:13:01 +00:00
Christian Stenger
94ee0a575d Debugger: Avoid crash when settings change after debugging
If the debugger engine is not running there is anyway no need
to update its data.

Change-Id: I8cda9218985db8b88d96046254847e8916ca37eb
Reviewed-by: hjk <hjk@qt.io>
2020-02-20 11:15:19 +00:00
hjk
0334b6e491 ProjectManager: Add convenience Task subclasses
For Compile, BuildSystem and Deployment. Unclutters user code and reduces
binary size.

Change-Id: Ia18e917bb411754162e9f4ec6056d752a020bb50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-20 10:11:59 +00:00
David Schulz
b23d80d537 Debugger: make Location::fileName a Utils::FilePath
Change-Id: I637d39246ff576db1023f08c432a7f7b6aadbbaa
Reviewed-by: hjk <hjk@qt.io>
2020-01-06 13:29:54 +00:00