Commit Graph

99 Commits

Author SHA1 Message Date
David Schulz
9d8dc1d056 Debugger: remove put item code from cdbbridge
unneeded nowadays

Change-Id: I8e7d46f7344157459e86cbea95563194a579cd6e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-28 13:22:21 +00:00
David Schulz
b245912b56 Debugger: merge put array code from cdbbridge into dumper base
Basically the same. Only the type lookup of the inner type needs to be
avoided for performance reasons.

Change-Id: I2747ab44c23b764482b4a063d3618fae2e3c4d46
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-28 13:22:17 +00:00
David Schulz
9733957862 Dumper: merge put pointer functions from cdbbridge into dumper base
And remove the now unused DumperBase.Type.targetName helper function. We
can use the typeId nowadays for this. This reduces duplicated code and
simplifies adjustments in the base implementation without breaking the
cdbbridge.

Change-Id: If76297b83f088d98493c6f5aceea8fa93093e42e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-28 13:22:11 +00:00
David Schulz
eca562af54 Debugger: remove unused function from cdbbridge
Change-Id: I3e3fe0c89d7ecfa7c727a26998978d07fd9bc390
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-26 05:25:54 +00:00
David Schulz
f68c7e1024 Debugger: remove unsupported type annotations from cdbbridge
Change-Id: I997a2df2b6352e022a955f2441f4e7f9d9fa02ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-25 13:36:45 +00:00
David Schulz
ca7fd2aaf3 Debugger: remove overwritten createValue in the cdbbridge
The function is nowadays generating values the exact same way as the
base implementation.

Change-Id: Ie1b167021d9d450959d9cf3c27b0ac8ec7d0d3af
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-21 07:45:34 +00:00
David Schulz
3f1906dc20 Debugger: add cdbext stub file
... and add some typing infos to the cdbbridge

Change-Id: If85bc75976c869332ef658c32615f6b110459048
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-20 06:45:48 +00:00
David Schulz
66413dc06f Debugger: do not overwrite qtNamespace in the cdbbridge
Change-Id: I11a95710867fd0a6b5a2956a9f8f4a86932038dd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-19 08:56:29 +00:00
David Schulz
4ded08dd38 Debugger: defer type resolve again for the cdb debugger backend
Task-number: QTCREATORBUG-29833
Change-Id: I671359f84d3f4d78d051f6a087776ceab7d7460d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2024-06-19 08:55:20 +00:00
David Schulz
d30dda07a1 Debugger: fix PyType::resolved function call
Change-Id: I9301d7875bec68ccde5ccd480b12c0dc86b082f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-17 13:04:28 +00:00
David Schulz
bb4c6d2bff Dumper: optimize cdb Qt version detection
... by not overwriting DumperBase.qtVersion. This function already
checks whether the Qt version was passed via the fetch variables
command.

amends 3aee50f5fd

Fixes: QTCREATORBUG-31049
Change-Id: Ifa67be5701fc7e5492e4c1fcb8943111b299c78d
Reviewed-by: hjk <hjk@qt.io>
2024-06-13 12:20:40 +00:00
hjk
3aee50f5fd Debugger: Paddle back on the (non-)auto detection of Qt versions
It looks like there are Qt-using scenarios without easy way to have
the right Qt version in the kit,

Among the frequent cases where we need to distinguish Qt versions in
the dumpers are the Qt5/6 container layout differences which can in
some cases be detected from the currently dumped value. Use that now
as the primary distinction and fall back to the previous expensive
peeking only if that is needed. This also postpones any Qt version
related activity until a real Qt type is encountered, i.e. does not
impact non-Qt scenarios.

Task-number: QTCREATORBUG-31033
Change-Id: I67b6e34c42994ad9f6e8ec8698b430b55327cf0c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-11 11:46:11 +00:00
Eike Ziller
3d828123be Merge remote-tracking branch 'origin/13.0' into 14.0
Conflicts:
	tests/auto/debugger/tst_dumpers.cpp

Change-Id: I71bfee426a3e25ab7c7cd276ffe1e7d8fe550ffe
2024-06-03 12:23:06 +02:00
David Schulz
5c23ab8c2d Cdbbridge: report dumptime of fetchVariables
Change-Id: I866fd5dbf547a4d6ec1ab9806080419735131d19
Reviewed-by: hjk <hjk@qt.io>
2024-05-31 09:22:54 +00:00
hjk
67072d3f5b Debugger: Re-work bridges
The type cache has been split into smaller caches for individual
aspects. Type ids are now integral, not strings.

In addition, there is new supporting code for logging, timing and
profiling

Change-Id: I6db72a149650d42aecf8b899869c542b1303d43b
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-05-07 10:15:34 +00:00
David Schulz
a57a925b76 Debugger: defer type look up
Change-Id: I425c2bfc3c88ebf46af161c5434c0c05a3bb9c97
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-02-27 11:32:53 +00:00
David Schulz
a6eb6dd909 Debugger: try harder to find static meta object
Improves dumping of QObjects when the staticMetaObject is defined in a
different module than the object itself.

Change-Id: Ic02103016d14b4925978d8afeaf2dbcc5dcebf85
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-02-07 11:25:50 +00:00
David Schulz
cf1e9db73b Debugger: ignore fields with a null address
cdb reports static members in fields sometimes with a null address.
Ignore those static entries since they cannot be visualized.

Change-Id: I0c58b2d75e95892185051e3c0a8dd9e6217596c3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-02-07 03:58:50 +00:00
David Schulz
c7b8ed520d Debugger: avoid recursive pointer type lookup
the std::nullptr_t gets reported as a pointer type with std::nullptr_t
as the target type. In order to avoid a recursive lookup check whether
the target type name is identical to the pointer type name.

Fixes: QTCREATORBUG-29291
Change-Id: I25373bf56b5538b9e5c14c34b9a5e501b5803fea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-19 17:18:18 +00:00
David Schulz
1124a75948 Debugger: Fix highlighting values and members in memory view
Fixes: QTCREATORBUG-23681
Change-Id: I1420385d0c923be0ae4dd7ef2662263b88623333
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-03 07:04:18 +00:00
David Schulz
f3cbd506dd Debugger: Avoid looking up qt symbols globally to get the qt namespace
This can get very expensive for targets that have a lot or big modules,
but are not linked against Qt. On the downside we might not be able to
identify Qt namespaces in static builds.

Task-number: QTCREATORBUG-18287
Change-Id: I90e0c4afcde17fd81d49017e828ce59f0abe9b5c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-01 11:43:19 +00:00
David Schulz
1a575cd2df Debugger: Fix printing of pointer to multiple inheritence base class
...for cdb when we have no nativeValue. This is the case whenever we
have a container like std::vector, QList or a c array to the base class.

Fixes: QTCREATORBUG-28337
Change-Id: I18c63dfbc207d76bf41d85d5da83f7f4603504f9
Reviewed-by: hjk <hjk@qt.io>
2023-02-21 08:45:49 +00:00
David Schulz
ab9b5357f9 Cdbext: fix expanding lamba captures
Change-Id: I2c1c64e3258cec503f83dbf561a734b4694592c4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-02-14 13:21:45 +00:00
David Schulz
e47dae643a Cdbext: lazy type lookup
Postpone the lookup until we need the type id. This potentially skips
the lookup for unresolvable types that are just to parse template
parameters. Also cache types we already checked to prevent looking up
types multiple times. Additionally traverse all modules in order to find
unresolvable types.

This combination reduces the time the debugger needs to execute all
dumper tests from ~7:30 to ~3:30 on my machine.

Task-number: QTCREATORBUG-18287
Change-Id: Ie1e9771f124096c2a9ad24ac26c9b51fcded4fed
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-02-14 13:21:38 +00:00
Kai Köhne
4e9c1d126c Replace GPL-3.0 with GPL-3.0-only
GPL-3.0 is deprecated by SPDX.

Change done by

 find . -type f -exec perl -pi -e 's/LicenseRef-Qt-Commercial OR GPL-3.0(?!-)/LicenseRef-Qt-Commercial OR GPL-3.0-only/g' {} \;

Change-Id: If316a498e3f27d2030b86d4e7743b3237ce09939
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 08:05:04 +00:00
hjk
bb11788a0a Debugger: Avoid quadratic behavior for larger debug output
Task-number: QTCREATORBUG-28111
Change-Id: I0567b6af9f74c2d335d19a52765834ef7cee9449
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-08 13:53:30 +00:00
hjk
37db98db30 Debugger: Simplify TypeData setup and registration
Change-Id: Ib23249eae63901d614cbe33fe184f174a10efbe4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-28 11:59:50 +00:00
hjk
2006d41680 Debugger: Store tdata as member in Type
Change-Id: I2e784be9a16914a30b08bdfbedb789d8a1d3f910
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-09-08 10:20:33 +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
266adf7b1d Debugger: Delay template argument retrieval from native types
For performance reasons. They are often not needed.

Change-Id: I8a7bb03583b3ec2479a3691486c9c02f70ad014e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-22 13:26:02 +00:00
hjk
c2e3e0419d Debugger: Prepare delayed type creation for DumperBase.Values
Change-Id: I283bcdec178e0a860bef71753cd29cc283a58391
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-21 11:21:01 +00:00
Christian Stenger
7fbc926c64 Dumper: Adapt Qt handling for Qt6
Task-number: QTCREATORBUG-24098
Change-Id: I62f2a4d91ed2f95ac167b836ea0e811599d0655f
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-12-03 14:03:28 +00:00
Christian Stenger
c6c320a6ea Debugger: Avoid decoding error when fetching native value
Change-Id: I4cfe144c7d96134e373e6d6d6141eb05a7dfe911
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-08-10 07:22:02 +00:00
Orgad Shaneh
e3312205ed Dumper: Adapt to Id that moved from Core to Utils
Change-Id: I6437d813234dc22923a313d540f115e070edeba7
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-07-06 09:37:21 +00:00
David Schulz
472797a1d1 Dumper: avoid redundant labeling
Change-Id: I85581cfe34a60e7f8a3e3590358443a15b7d2d4c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-03-02 12:14:22 +00:00
David Schulz
0776340ad8 Dumper: unify Codestyle
generated with autopep8 and the introduced setup.cfg

Change-Id: I5b55a7937f2cde81be59d2b434e94ada1a4af5ab
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-28 08:35:05 +00:00
David Schulz
4422805cec Dumper: replace xrange with range
Change-Id: I09b3dd4da548643e927dbc5bb3130c28a746396b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-26 10:26:55 +00:00
David Schulz
44db8e2eab Dumper: replace import * with explicit imports
Using imports like

 from foo import *

is considered as bad habit and it reduces
static code analysis usability.

Change-Id: I56a175f4c7b231e2b8e486bd9d1c65543720f56a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-25 13:22:50 +00:00
David Schulz
e17c96cf11 Dumper: move global enums and functions to utils
Change-Id: I11f5f0d970cd23a5fd907d33daa3cb8a441d0c58
Reviewed-by: hjk <hjk@qt.io>
2020-02-24 07:47:40 +00:00
David Schulz
79f7605a0a Debugger: fix cdb dumper test for namespaced Qt
Change-Id: I5cbf1db4cffb19ee63ab80dcd6e2a8659cd44389
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-09 08:40:00 +00:00
hjk
2cfa3502c3 Debugger: Remove identical CDB implementation of loadDumpers
Change-Id: I83582821f0670f65c8f325c54707947741a3df17
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 13:54:53 +00:00
David Schulz
11863cb517 Debugger: add cdb specific symbolAddress
Fixes: QTCREATORBUG-21864
Change-Id: I54d89fabd83dd06e5d733519f0b65416077323c9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-28 09:25:20 +00:00
David Schulz
18bee3a08f Debuger: Fix enum dumper (again)
Fixes: QTCREATORBUG-21726
Change-Id: I25f4a84d88a915247456ac8e12877d503ae0d49a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-12-17 12:55:18 +00:00
David Schulz
12f4ff5e5b Debugger: Fix Qt version detection in the cdbbridge
broken by b2052561cc

Fixes: QTCREATORBUG-21446
Change-Id: I303bb943a3b39703a6c5898aab99b89d35d1d2d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-12 14:09:52 +00:00
Alexandru Croitor
89fe2681f7 [Debugger] Add dumpers for Python "PyObject"s
The dumper calls PyObject_Repr and shows the result of that as the
value of a PyObject.

It also adds three new sub fields to show the object class (type),
super class (base class), and the meta type (the type of the class
object).

Change-Id: I0612833321f6d2b50826588e775cfa12e1db28e4
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-19 11:17:36 +00:00
Christian Stenger
49a498c0a6 Debugger: Fix accessing member function
Amends 975f5886a6.

Change-Id: I0e8f5a9ab0ccf76fc095e0e05bfbdb838a7583d3
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-09 12:56:26 +00:00
David Schulz
975f5886a6 Debugger: fix cdb enum dumper
Change-Id: Iac407d98afd8f024a45d0f6550c8b3c00df0a515
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-09 08:30:37 +00:00
hjk
a8a23110bf Debugger: Fix enum dumper
Make the hex display work with LLDB, fix GDB and LLDB test.

Change-Id: I529b5cdc908dbcba7270bc4574fa59a012fcacad
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-22 08:45:57 +00:00
David Schulz
b2052561cc Debugger: improve evaluate expression with cdb
Replace Evaluate with AddSymbol and create a PyValue representing
that expression

Change-Id: Ibb8ab70c41df81e9d7d683b633a070caa03036d3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-20 09:32:18 +00:00
David Schulz
17485c0678 Debugger: Optimize python output handling
Change-Id: Ia97e8adaabbffe49acec44575621a4f4243c5cea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-10 07:07:38 +00:00