Commit Graph

1476 Commits

Author SHA1 Message Date
Christian Stenger
cad822dfe5 Dumper: Silence debug output
Left-over from refactorings.

Change-Id: Ib37e04e5ea7ab9269bda98dc052e3fae1a862187
Reviewed-by: hjk <hjk@qt.io>
2024-08-06 08:49:01 +00:00
hjk
c1316e998e Debugger: Fix dumper for Qt4
Creator 14.0.0 effectively assumed "less then Qt 6 is Qt 5", even if it
is (incompatible) Qt 4.

We are now falling back to the expensive version extraction for anything
less then Qt 6  but it gets the distinction between 4 and 5 right again.

The check (once per debugger session) happens now unconditionally again
for Qt 5 and earlier and is arguably a performance regression for
Qt 5 / Creator 14 users, but it's not worse then Creator 13 where we
didn't have the shortcut mechanism

For master we should consider extending the qtVersionPing() to also
provide a cheap distinction between Qt 4 and Qt 5.

Change-Id: I4073395280fdf137e89c834bf014b9f31d74a1cd
Fixes: QTCREATORBUG-31355
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-08-02 13:05:11 +00:00
Christian Stenger
41aaf556cc Dumper: Comment out debug message
Left over from writing another patch.

Change-Id: I3d2eeda4a1ea3c7dda3f9062bb30ed5137c7b09f
Reviewed-by: hjk <hjk@qt.io>
2024-07-29 11:29:33 +00:00
Christian Stenger
130273a9a8 Dumper: Ensure QStringList is pre-registered
Task-number: QTCREATORBUG-31225
Change-Id: I597fc3368dab9c37e75008dee24ffec7b93bc2a7
Reviewed-by: hjk <hjk@qt.io>
2024-07-11 13:45:46 +00:00
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
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
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
Christian Stenger
267f392977 Dumper: Fix dumping QLocale
Change-Id: Ib34970549c147c593f39023ec0aed53885af6ce0
Reviewed-by: hjk <hjk@qt.io>
2024-06-20 10:44:20 +00:00
Christian Stenger
b1b27d4a49 Dumper: Fix dumping QDir
Change-Id: I5b02e8b0a000efe1c3bbbc22f7e624ea218e1cfc
Reviewed-by: hjk <hjk@qt.io>
2024-06-20 10:44:13 +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
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
745b32d10c Debugger: optimize QStandardItem dumper for cdb
Change-Id: I97f448da86f03edf82f0f1543e8c784d1f3a5f8b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-19 08:56:40 +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
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
d22a95bc54 Debugger: fix some qtVersionAtLeast checks
Change-Id: I681927fe5e086738f7635f7e578238c448dca2a2
Reviewed-by: hjk <hjk@qt.io>
2024-06-17 13:04:41 +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
963e55f3db Debugger: remove unneeded size cache lookup
Change-Id: I1d16c4d8d1436fe252269439e4059c6cd9886d81
Reviewed-by: hjk <hjk@qt.io>
2024-06-17 04:27:39 +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
David Schulz
804a890a00 Debugger: fix QStack and QDateTime dumper
amends 3aee50f5fd

Change-Id: Iaa6666eb6c59f88572add6ae79ef942643ba38d4
Reviewed-by: hjk <hjk@qt.io>
2024-06-12 07:42:12 +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
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
4bf55f3239 Debugger: Fix some internal code model related dumper
Type.unqualified() is gone.

Change-Id: Iea3378e0ff4172c197ae8ad025a6ebcd58a2cbbe
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-05-29 06:17:41 +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
Michael Weghorn
23b7ac84a9 Debugger: Use integer from native GDB value for typedef
Extend the solution from

    commit d86cf5e235
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Thu Sep 24 12:02:06 2020 +0200

        Debugger: Retrieve and remember int from native GDB value

to also retrieve the int representation for numeric values
from the corresponding native gdb.Value if a typedef to
an integer or bool type is used, not only when an integer
type is used directly.

This makes expressions for bifield members in the
debugger's expression view show the correct value
when the type of those bitfield members is a typedef
to an integer type.

Extend the "Bitfields" dumper test accordingly.

One real world example where incorrect values were
previously shown is GtkWidgetPrivate from the
GTK library [1].

[1] ebc84a6185/gtk/gtkwidgetprivate.h (L39-76)

Change-Id: Ib39e00ebbfc8d7d9ab10dc89af61f37ec41fb4ee
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-05-08 06:29:35 +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
de3841f138 Debugger: libc++ 16 dumper for string
Change-Id: Ic3eed66d7af54a0251ec58886b68dda611682bef
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-05-06 09:47:31 +00:00
Eike Ziller
a79f02ca4a Merge remote-tracking branch 'origin/13.0'
Change-Id: I77d3656aec10063a90095d5299b85304692d8b32
2024-05-06 08:14:24 +02:00
hjk
d3fb3a163c Debugger: Ignore stops in libart.so and other Android runtime specific places
From https://issuetracker.google.com/issues/240007217#comment17
"Some a background on the technical aspect of SEGVs:

Android Runtime (ART) uses SEGV for various internal purposes (it
triggers a SEGV and handles it without crashing the app, the app doesn't
know it happened). When the native debugger is connected, the debugger
must intercept all SEGV signals.

When running the debugger on Android API level 27 and newer, we make the
debugger skip these SEGV signals (i.e., forward them to be handled by
ART), because we know how to handle real SEGV signals inside ART.  For
older Android versions (26 or older), we did not have this support, so
the debugger stops at every SEGV (i.e., it cannot know if the signal is
a real crash or an ART-internal thing)."

Arguably, this should be caught by the LLDB Android platform bits, but...

Task-number: QTCREATORBUG-30759
Task-number: QTCREATORBUG-29928
Task-number: QTCREATORBUG-30080

Change-Id: I8cabe4a0675c596a9617520aff0d62ad11321f0e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-02 15:36:26 +00:00
hjk
b74f871b5b Debugger: Add a helper to visualize dumper profile data
A stripped-down and modified version of pyprof2calltree.

Change-Id: I9e37a4e13f312b40144394572ef6603bb2161487
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-04-16 07:14:16 +00:00
hjk
2a1d46bbfc Debugger: Move python2 supporting files out of normal bridge directory
They get in the way when working in that area.

Change-Id: Id59c83472a6ce093ca9b31ad9e94ec638b4a1df8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-04-08 08:25:08 +00:00
Robert Löhning
0cca4b283b Debugger: Fix calls to calloc
Change-Id: Id1ba0c4656eb611b6ac4269ebf9d141feb08d632
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-04-03 14:38:44 +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
hjk
4ca8ad8293 Debugger: Fix breakpoint settings in assembler for LLDB
Setting the breakpoint actually worked, but it was reported back
using a wrong address, so it never went "red" in the disassembler view.

Change-Id: I4c2bd808705dfe793c0febf29b3e78b318dbae00
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-02-28 16:28:16 +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
Michael Weghorn
4aaf7f2689 Debugger: Add debugging helper for std::tuple
Add debugging helper for std::tuple and add
a corresponding dumper test for it.

With this in place, the std::tuple variable and its elements
in the "tuple.cpp" sample program from QTCREATORBUG-25865 are
shown as expected on both, Linux (libstdc++) with GDB or LLDB and with
an MSVC build with CDB on Windows.

A debugging helper for libc++ had already been added in commit
34ff9c97e6.

Task-number: QTCREATORBUG-25865
Change-Id: I24b3d36b5daa26fd4fcb073c4df79015dfe752fc
Reviewed-by: hjk <hjk@qt.io>
2024-02-12 11:55:18 +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
Michael Weghorn
941ad80d60 Debugger: Add debugging helper for std::string_view
Add debugging helpers for std::string_view,
std::basic_string_view and std::u16string_view
and add a corresponding dumper test for them.

With this in place, values of the local variables in the
"string_view.cpp" sample program from QTCREATORBUG-25865 are
shown as expected on both, Linux with GDB or LLDB and with
an MSVC build with CDB on Windows.

Fixes: QTCREATORBUG-25865
Change-Id: If8959e3225d9ce7f427a65ff6f1f134d3ad48e91
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-02-07 07:47:13 +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
Ilya Kulakov
05d7070178 debugger: Fix RecursionError when fetching Qt version
When working with statically linked Qt qVersion may not be available.
In that case Qt uses the qtHookData which has type of quintptr.
This type is subject to SyntheticChildrenProvider because lldb
hooks are set up via a regular expression.

When SyntheticChildrenProvider is instantiated, it tries to fetch
Qt version, which causes another instantiation which again recurses.

The fix is to bypass SyntheticChildrenProvider via GetNonSyntheticValue.

Change-Id: Id00cdb3d0a0895bb02e4b3e4504c574d89be2ed0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-01-31 18:27:50 +00:00