Commit Graph

453 Commits

Author SHA1 Message Date
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
3b7e782bc6 Debugger: remove unneeded check and assignment
If the inner type is null at this point it will also be null when
assigning the same type again.

Change-Id: I4dbad41a60d4853ac016adb54c693ce19d6f65d0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-26 07:46:47 +00:00
David Schulz
6b8a41b1ba Debugger: fix manual list template arguments
'res' is not part of the function anymore, the result of the split is
directly written into self.type_template_arguments_cache since
67072d3f5b

Change-Id: Ib76b1f82a4f807e54fbb3cec96b317c36011bf51
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-19 08:56:48 +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
c5caee8be2 Dumper: fix exception string
'...' % ... has 3 placeholder(s) but 2 substitution(s)

Change-Id: I8d0ac49a97d8ff1745240276fa4ef02f73991dbe
Reviewed-by: hjk <hjk@qt.io>
2024-06-19 07:16:51 +00:00
David Schulz
963e55f3db Debugger: remove unneeded size cache lookup
Change-Id: I1d16c4d8d1436fe252269439e4059c6cd9886d81
Reviewed-by: hjk <hjk@qt.io>
2024-06-17 04:27:39 +00:00
hjk
363e9b4c1a Debugger: Drop some Python 2 leftovers
Change-Id: Id120abaadb23af4139fc126b14a37932f6d630ea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-11 16:11:08 +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
hjk
3697aac20e Debugger: Speed up QObject recognition
Change-Id: Ib9847725c1e97ad774173ecb95094791ff5d1bbc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-05-24 13:52:51 +00:00
hjk
6aab6f61b5 Debugger: Provider Qt version externally to bridges
Extracting within the bridges is expensive.

Change-Id: Icf69db4b112230cc23e331abc0b3eb0de1323f46
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-05-16 10:03:08 +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
hjk
87ca7882c1 Debugger: Fix QPair dumping
Task-number: QTCREATORBUG-30538
Change-Id: Iee17aec458d9ab69cd4349bedb26b1a2270ca41c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-19 16:00:23 +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
88aacbb562 Debugger: fix char type dumper optimization
Change-Id: I600f4ddc9a4539e19b70664fd9354c17e64cd0d6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-02-21 07:56:43 +00:00
David Schulz
c76fc8e1e5 Debugger: fix dumping char arrays
The calculation for the size of the memory to fetch for the dumper was
missing the char size information.

Amends a26aff7afd

Change-Id: I8ceb127efaf7effa94fc53e6782f75580ab8cdb4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-02-21 06:00:24 +00:00
hjk
a26aff7afd Debugger: Report full sizes instead of the elide setup
More direct communication of the meaning. Use 'length' when talking
about things like string lengths, and 'size' for sizes in bytes.

Task-number:  QTCREATORBUG-30065
Change-Id: Ifed84a5dab4ed890973c1abf4d427655eb50a61a
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-02-13 17:01:23 +00:00
David Schulz
596cd204e1 Dumper: fix array 10000 format
Fixes: QTCREATORBUG-29196
Change-Id: I23ddb17ac3f378b6602057c1964ef5984b83e245
Reviewed-by: hjk <hjk@qt.io>
2023-06-30 07:47:27 +00:00
hjk
de546ff3ec Debugger: Support piping dumpers into gdb
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>
2023-04-05 06:26:11 +00:00
Artem Mukhin
5c0a956e8c Debugger: Fix GDB MI output parsing
When using `lldbbridge.py`, Python throws `TypeError: string indices must be integers` because `gdbmiparser.parse_response` cannot parse the multiline output.

The bug was introduced in bb11788.

Change-Id: I5faae4c3d034c0f159e9c1e473b6929ba79b8272
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-03-12 11:16:05 +00:00
Eike Ziller
36d9341397 Merge remote-tracking branch 'origin/10.0'
Change-Id: Idf151b6cfe87957cf905e67aab6b1275b9f0506a
2023-03-06 08:24:18 +01: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
Eike Ziller
87ede95b5c Merge remote-tracking branch 'origin/10.0'
Change-Id: I7bd186df0bfae7906e980e9c2c811f8dcf29750d
2023-03-02 10:17:58 +01:00
David Schulz
a4fb9e20cb Debugger: improve dump time for various msvc std containers
... by caching the info whether we have a debug build. This avoids
expanding members of the container to check for a potential offset of
the actual data.

Change-Id: I4d7ac83003c303185ae51d57f0f0571b627edf22
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-02-27 12:26:37 +00:00
David Schulz
5169469911 Debugger: add <load more> functionality to array dumper
Change-Id: Ib44748fa3218788ca20a99b0a0f4cd85716dde06
Reviewed-by: hjk <hjk@qt.io>
2023-02-27 08:35:32 +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
Łukasz Wojniłowicz
76260f8038 Debugger: Port away from deprecated getargspec
https://docs.python.org/3/whatsnew/3.11.html suggests using
getfullargspec instead.

Fixes: QTCREATORBUG-28505
Change-Id: I27199f7e2c3a070c675dce3a152d201e22a16380
Reviewed-by: hjk <hjk@qt.io>
2023-01-11 15:38:46 +00:00
Eike Ziller
0dfa542bee Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/cppeditor/cppcodestylesettingspage.h

Change-Id: I1aa4e2f9efc6d9cf9f284aef1abf148be9b93a60
2023-01-10 15:44:55 +01: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
c7bb5fcc37 Debugger: Remove spurious waring
Task-number: QTCREATORBUG-27160
Change-Id: Ie69c60688249efcd4d2c2330d6555cf7f708edd2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 08:32:09 +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
Orgad Shaneh
661994c288 Debugger: Fix cross-endianness display for arrays
Debugging a BE target on LE host showed wrong values when expanding an
array.

Change-Id: Icad9db8be11c3093de3b7bab52df815bf56f1677
Reviewed-by: hjk <hjk@qt.io>
2022-09-05 13:55:14 +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
Marcus Tillmanns
42e1714ea1 debugger: Fix dumper for std::string and unordered_multiset
Moves mac specific dumpers to separate file
Creates android dumpers for stdtypes

Change-Id: I33d28198e1a2f24fb7707313845db81e283686cd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-08-23 10:49:43 +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
Marcus Tillmanns
2635d62721 Dumper: Show error message if module fails to load
Change-Id: Id4e445f71f70f0b07ccc4c4ffb25502607263dec
Reviewed-by: hjk <hjk@qt.io>
2022-08-11 14:02:30 +00:00
Christian Stenger
5b67f03416 Dumper: Fix bitfield handling on macOS
Amends f14634a651.

Change-Id: Iae1c7ad9c78786c9178a07a493abb76db3b4c4aa
Reviewed-by: hjk <hjk@qt.io>
2022-08-04 06:33:47 +00:00
hjk
f14634a651 Debugger: Fix bitfield dumping with Python 3
Change-Id: I2959a2e14c6f25e29460de74ea95a16a5226d48e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-03 08:18:39 +00:00
hjk
8bb22fa4f3 Debugger: Fail gracefully on systems without working base64 module
Change-Id: I341b0fdb1c9e32fda3ce80f3e7569cffbb0708d2
Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
2022-06-23 08:26:02 +00:00
hjk
61c6f532b2 Debugger: Use Qt 6,2 as fallback version
Change-Id: I0787d212f2a98b3aa2c2f1eda28b93731c81de08
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-04 06:12:38 +00: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
Christian Stenger
4303e62c50 Dumper: Fix passing fallback Qt version
We nowadays have an additional token there.

Change-Id: I65e5a55792802ae2ab7da6f7c6d8d1b109bf55a0
Reviewed-by: hjk <hjk@qt.io>
2021-11-10 10:20:08 +00:00
Andre Hartmann
f9f26570c9 Debugger: Add even more std and Qt char and int types
Make more stdint, quint and char types known to the debugger.

Task-number: QTCREATORBUG-26501
Change-Id: I1e757af2a495142fa37fe2b7cefec56690adbf08
Reviewed-by: hjk <hjk@qt.io>
2021-11-09 13:30:37 +00:00
Andre Hartmann
78a1beb06e Debugger: Improve handling of stdint types
* Make (u)intX_t known as integral type
* Handle uint8_t[] the same way as char[] and unsigned char[]

Task-number: QTCREATORBUG-26501
Change-Id: I1eac21be198f8107f088e56daf435b5bb3217120
Reviewed-by: hjk <hjk@qt.io>
2021-10-29 13:12:02 +00: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
Christian Stenger
dde5a52693 Revert "Debugger: Drop support for backends relying on Python 2"
This reverts commit 43bcf91121.

GDB coming with MinGW shipped by Qt (e.g. 5.15  official) are still Python2 based.

Change-Id: Iad658de7a242345cc7f6081f26f0238071668a06
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-09-24 07:04:34 +00:00
hjk
43bcf91121 Debugger: Drop support for backends relying on Python 2
The last discussion of the topic was 18 months ago, and already back
then it seemed not widely used anymore. See
https://lists.qt-project.org/pipermail/qt-creator/2020-February/008382.html

Change-Id: I48c879ce918b7351b1120bd70892deb0330637f5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-09-09 12:35:22 +00:00
Alex Richardson
ebc229a25b Debugger: fix QString printing in LLDB with python3
Before this change I was seeing all strings as
`<failed to decode '...' as 'utf16'>` when using LLDB bundled with CLion.
This error is misleading since the actual exception raised from the python
code was `'str' object has no attribute 'decode'`. To fix this, I updated
the hexdecode() method on Dumper to accept an optional encoding argument
and use that instead of the python2 str.decode().

Change-Id: Ic3afc786c42fd7384d9dc3117f0871837076c2ba
Reviewed-by: hjk <hjk@qt.io>
2021-08-16 09:34:28 +00:00
David Schulz
4f9ed8d620 Dumper: Fix qobject name dumping for Qt 5 again
Amends: e05fe66f4b

Change-Id: I244017a63216a6bbc89d9f211eec7d7def27beb4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-14 09:28:45 +00:00