Commit Graph

391 Commits

Author SHA1 Message Date
David Schulz
1981d90f39 Dumper: fix QMetaObject detection for Qt6 on windows
introduced by 9b8493314dd77f3e96b353187816bb7ef4dedbb5 from qtbase

This change does not address all usages of super data in the dumper, but
enables dumping children.

Task-number: QTCREATORBUG-24098
Change-Id: I813dacfa719dd6ca367e305fadcc8f2b8ee45425
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-11 14:01:20 +00:00
hjk
b3ad621e0a Debugger: Fix Bitfield dumper for LLDB with Python 3
Strangely enough, this issue did not trigger with GDB for either
Python 3 or 2.

Change-Id: I0e5cf7ce0a8605f105bff549634aa014ef1f8403
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-11 09:45:42 +00:00
hjk
8d6ca33a7a Debugger: Remove more dead code in dumpers
Change-Id: If0a48377470b75a2d9c5d7f3cb47a492b9214791
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-10 10:55:20 +00:00
hjk
e7e0fa5745 Debugger: Remove create{Container,List,Vector}Item
Not used anymore.

Change-Id: I1d534a094717cfc44aea73e6b4ca948c088480ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-10 10:55:11 +00:00
hjk
9c8c5b6363 Debugger: Strip inner typenames in pointer type lookup fallbacks
To compensate for a potential 'Foo*' vs 'Foo *' difference in
debug info.

Change-Id: I90e822f89bc13bdf7ffed30ee12a984a659aa38f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-10 10:22:47 +00:00
Christian Stenger
9c8768e752 Dumper: Remove some fallback code
..and unused or unknown variables.

Change-Id: I13d1d03fa09ef3952fe2cb3f4b257fb2882709f2
Reviewed-by: hjk <hjk@qt.io>
2020-12-10 10:21:34 +00:00
hjk
eac85f8261 Debugger: Fix QObject property display with Qt 6
Task-number: QTCREATORBUG-24098
Change-Id: I6e1013fe39208ef6e9ba792e6b2fb745eb5e3108
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-10 09:59:58 +00:00
hjk
c902974423 Debugger: Simplify QObject parent dumping
Change-Id: I24fd6bf684a213c2e47978485442dd6c47073a7a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-10 09:54:08 +00:00
hjk
276c0ae482 Debugger: Adapt QStandardItemDumper to Qt6
Task-number: QTCREATORBUG-24098
Change-Id: I1c21e6a1ee3db3532029638eedfcf58eead53424
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-12-10 08:52:49 +00:00
hjk
ddb2ae657d Debugger: Improve QMeta* dumper for default-initialized objects
Null-dptr strikes again.

Task-number: QTCREATORBUG-24098
Change-Id: I4e24cbe4cad4995ce39116a1b51b26153004ccfc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-09 13:42:08 +00:00
hjk
fff1fafec7 Debugger: Consolidate list data extraction in dumper
Change-Id: I5b860da4b1d15ffab8c60418321e40943dbbe07a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-08 14:19:40 +00:00
hjk
73f2ea11dd Debugger: Make GDB dumper tests pass with Qt release builds
Change-Id: I45ae41486b8081bb803290895e942a71d41d5c0d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-08 12:59:24 +00:00
David Schulz
6187998090 Debugger: re-add old qobject children dumper for qtversion < 6
Change-Id: Icbafb7c22d18247f89a8aa6a5029c9914d251c2e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-12-08 12:36:30 +00:00
hjk
786e4c6f8f Debugger: Re-enable shortcut to get known type sizes in dumpers
Looks like we need to continue with this crutch for MinGW.

This partiall reverts commit 1074c2ffce.

Change-Id: I89d32f31281c3ef720bbc2a21d5a99bfd0066ba3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
(cherry picked from commit ffe3c56670)
2020-12-08 10:03:54 +00:00
hjk
8e0cb785dc Debugger: Drop alloc return value from dumper vectorData() helper
Only used for checks, do that within the function.

Change-Id: I4cc302864a9d3f8edac6f6364dfdac33b548e60a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-07 15:47:20 +00:00
hjk
493f44ac6a Debugger: Fix QObject children display for Qt6
Task-number: QTCREATORBUG-24098
Change-Id: If7b1e498bcbd191faecbcab9462f1d72331211f3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-07 13:52:57 +00:00
hjk
5ca4427bb7 Debugger: Create list of arguments for manually created template types
This is one of the roadblocks for the current failing Qt 6 QVariant
dumper for self-registered types.

Change-Id: I304ce8e8aa3dfc5b3694b65198fbac4f42de6d4b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-04 11:41:35 +00:00
hjk
54f281944d Debugger: Use @ as Qt namespace placeholder more widely
Change-Id: I73a7abaed17c1a8a1461a66e66860cba64d4f9d9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-04 11:17:20 +00:00
hjk
f946e5b356 Debugger: Consolidate some string data extraction helper functions
Change-Id: Icfa395de5237e0f58e63b3ca0d88ff8c9a1998a9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-03 10:55:06 +00:00
hjk
08a1117c26 Debugger: Extend and fix QPolygon dumper and test for Qt6
Task-number: QTCREATORBUG-24098
Change-Id: Ia2e43d15263e18698d9db6b4d23fa553c7b7ae5b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-02 15:22:35 +00:00
hjk
e1790ed9d0 Debugger: Fix some dumpers with namespaced Qt
This makes the use of '@' prefixes in split('{@QString}'...) etc
mandatory, thereby removing the guessing on whether namespaces apply
or not on the dumper 'core' side, and removes the guessing on
whether dropping the '@' 'works' on the individual dumper implementation
side.

Amends 1074c2ffce.

Change-Id: I44611eb09557638dec12d2e2f78cdaeac0bbd449
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-01 14:59:06 +00:00
hjk
398a74b027 Debugger: Adapt QObject name dumper to Qt 6
Task-number: QTCREATORBUG-24098
Change-Id: Iee8a71eda4c15b3cd36e569805fef769f6eb090f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-30 14:30:13 +00:00
hjk
e65b9cde28 Debugger: Partially adapt QObject dumper to Qt 6
This makes meta method and property names visible again.

Task-number: QTCREATORBUG-24098
Change-Id: I2e0522396a5e91be43ae6b850217b9153b29a962
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-30 12:02:29 +00:00
hjk
2bb32ed7a3 Debugger: Use Values instead of addresses in vectorDataHelper
Also rename it to vectorData, in line with byteArrayData and stringData

Change-Id: I91a4ddba272fcada3e451680ba5a5a756f7a976e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-27 13:58:30 +00:00
hjk
80fdbfff05 Debugger: Use qArrayData instead of qArrayDataHelper
Change-Id: I97a6c428e6b09232c420e2b8cb3b5b31588c949f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-27 13:58:04 +00:00
hjk
79df1c0804 Debugger: Use Values instead of addresses in putStringValue
Change-Id: I31a3c1a326d777d9e7081552d5a956e8e2882dcf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-25 11:41:24 +00:00
hjk
1074c2ffce Debugger: Remove shortcut to get known type sizes in dumpers
This was incomplete, can conceptionally not be complete, and most
of the sizes were wrong for Qt 6.

Change-Id: Id107b30dd6707b280c18a5d2065a4ec9c39fb035
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-25 11:36:46 +00:00
hjk
961c660ebd Debugger: Use Values instead of addresses in encodeByteArrayHelper
Change-Id: I4ee44f14b5b0d6afddb305a923d25a737f0d3d97
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-25 11:36:26 +00:00
hjk
147ca66932 Debugger: Rename byteArrayDataHelper to qArrayDataHelper in dumpers
It's generic, and operating on QArrayData (-subclasses).

Change-Id: Ieedc0f1e3f573aeeb422eb9516d4634e6e0da4b9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-25 11:35:16 +00:00
hjk
1c244bd623 Debugger: Adapt dumper helper for embedded QString members for Qt6
This fixes the QUrl dumper.

Task-number: QTCREATORBUG-24098
Change-Id: I2dbc2f477c33bc0c7337e8a925dd0a35d15aa31f
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-24 08:52:44 +00:00
hjk
d0991ae5ae Debugger: Simplify user side of QString dumper code
Move the version dependency into the dumper base instead.
This also fixes the QFileInfo display, but not yet QFile.

Change-Id: Ia2cb75b2a74cbbd4bb2d6ede2178d96792883912
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-24 07:13:39 +00:00
Michael Weghorn
0ab97e1159 Debugger: Show actual type for 'gchar *' elements etc
When 'char *' typedefs (and the like) are used, this makes
the actual (i.e. the typedef's) type name shown instead of the
one that the type is a typedef for.
For example, 'gchar' is shown as type for all elements of a 'gchar*'
when expanding that one in the debugger's locals or expressions view.

Original display of text representation for 'char *' typedefs etc.
had been added with commit 70c4889ac9
("Debugger: Show text representation for 'char *' typedefs etc",
2020-06-26). Move the typedef resolution one level down so the
original type name is still available for display.

This also extends the existing 'gchar *' test case accordingly.

Change-Id: I9558360b3bf96906d6dc39a63706bb8ce28c2f1c
Reviewed-by: hjk <hjk@qt.io>
2020-09-24 14:31:43 +00:00
Michael Weghorn
d86cf5e235 Debugger: Retrieve and remember int from native GDB value
When adding expressions for bitfield members in the
debugger's expression view, their corresponding 'gdb.Value'
does not expose the fact that those are actually bitfields,
so e.g. an 'int : 3' is exposed like a "normal" 'int'.

Previously, this would result in wrong values being
retrieved in the 'DumperBase::Value::integer()' function,
when trying to read the value from the corresponding
memory address.

To avoid this, retrieve the actual int representation
for numeric values from the corresponding native 'gdb.Value',
remember them and return that one, similar to how it
is already done for known bitfield members
(s. 'Dumper::memberFromNativeFieldAndValue').

The conversion from the 'gdb.Value' does not work
for integers of a size larger than 64 bits
(like '__int128' used in the "Int128" dumper test).
Therefore, just ignore conversion failures and don't
remember any value explicitly for those cases,
so the same handling as previously used is applied.
(At a quick glance, the reason seems to be that this
is because GDB's corresponding functions use 'int64'
as a return value of the relevant functions [1] [2],
but I did not look closer into what GDB does
internally.)

Corresponding tests will be added in a separate commit.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdbsupport/common-types.h;h=f5b2f3d249177acea77231c21c5601f959c18d2f;hb=f3034e25fa98d44b775970f40c9ec85eeae096e6#l33
[2] https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/python/py-value.c;h=6e29284aad11ff344789152a4f601b3474d86bb5;hb=f3034e25fa98d44b775970f40c9ec85eeae096e6#l1706

Fixes: QTCREATORBUG-24693
Change-Id: Idfc3390115e8796f3c778070c23424c3dbdfeddd
Reviewed-by: hjk <hjk@qt.io>
2020-09-24 13:11:47 +00:00
hjk
3e732396e7 Debugger: Recognize QChar as simple type
This avoids creating individual child items when expanding a QString.

Change-Id: I49382dcf947ee7ac0470415a71ab05ede5f71b29
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-24 11:55:01 +00:00
Jeremy Ephron
495c08a3eb Debugger: Don't hardcode dumper module names
Changed the dumpermodules list to be dynamically retrieved as all
<module_name>types.py files instead of a hardcoded list. I don't know of
any reason it should be a hardcoded list, and this allows for more than
one custom extra dumper file instead of having to specify one extra one
and/or use personaltypes.py. It seems strictly better.

The code used is confirmed to be compatible with all versions of Python.

Change-Id: Ic1988961d5cb7e6523e84afdd0e6c4ed2993ac97
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-09-10 17:53:25 +00:00
Orgad Shaneh
9a7535d9e9 Debugger: Support C structs in dumpers
The lookup for qdump function was done by "struct Foo" instead of just
"Foo".

Change-Id: I325d00910a0c13c5e67692737033531e18392247
Reviewed-by: hjk <hjk@qt.io>
2020-09-04 14:51:13 +00:00
Christian Stenger
57c6a32b10 Dumper: Fix dumping of enum values for cdb
Fixes the Bitfields test.

Change-Id: I2aab020f1dc8be40ab994586d0989452c80bb8e3
Reviewed-by: hjk <hjk@qt.io>
2020-07-31 13:09:02 +00:00
Orgad Shaneh
00e814fdd1 Debugger: Respect "Use Dynamic Object Type for Display"
Broke in 5efa84830b.

Task-number: QTCREATORBUG-24280
Change-Id: Ice4b9d826d2402efb354180886d35926a2513e5a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-03 09:07:46 +00:00
Michael Weghorn
70c4889ac9 Debugger: Show text representation for 'char *' typedefs etc
'tryPutSimpleFormattedPointer' takes care of nicely
showing the actual string representation of character
arrays if the innerType is one of 'char', 'signed char',
unsigned char', 'CHAR'.

To make this work for typedefs of those types as well,
first resolve the typedef before passing the value to
'tryPutSimpleFormattedPointer' from 'putFormattedPointerX'.

This e.g. improves the display of variables of type
'const gchar *'.

Fixes: QTCREATORBUG-24264
Change-Id: I477b6d7552f9c30c12d819aa5f37e64e4f444969
Reviewed-by: hjk <hjk@qt.io>
2020-06-26 14:14:23 +00:00
Eike Ziller
8b8ecfa28f Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/fileapiparser.cpp

Change-Id: I39f8c2be859be043f506bef77de9bb5b42d38165
2020-06-15 11:30:34 +02:00
hjk
28d34d196e Debugger: Fix QJson dumper for Qt >= 5.15
Storage is internally based on QCbor now.

Since this works better when having dumpers for QCbor values,
add those, too, for Numbers, Strings, Arrays, Maps for now.
None of the custom types.

Fixes: QTCREATORBUG-23827
Change-Id: Idf281d859aaf8556d9895646bbc091af85b34157
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-06-08 09:34:35 +00:00
hjk
63655081c3 Debugger: Mark a few more sub items as expandable
... and remove some of the now implicit putNumChild() calls.
Also, adapt docs.

Change-Id: I1ab1dafada95a1703cd6a9ba5b9e7e4166b48cd9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-02 13:02:25 +00:00
hjk
e87c301787 Debugger: Fix gdb command line use of dumpers
Fixes: QTCREATORBUG-24103
Change-Id: I4a771e3694879755c46623c8f089857437eb0fb5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-02 12:04:23 +00:00
hjk
e71c0b7fe2 Debugger: Drop unnecessary use of ModuleNotFoundError
That's Python 3 only, and doesn't add value here.

Change-Id: I9b1702ea8b0b0ddb090fdfc393228b4430da0b07
Task-number: QTCREATORBUG-24004
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-05-25 23:53:47 +00:00
hjk
7a63a47ef0 Debugger: Work around for gdb reporting zero array sizes in some cases
Task-number: QTCREATORBUG-23998
Change-Id: I101d032705b66faf50260067f6aa604214f09298
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-14 10:52:18 +00:00
hjk
65935ce03c Debugger: Fix startup when Python's json module is missing
Task-number: QTCREATORBUG-24004
Change-Id: I1c0563868374263f13cec3a8f40138bce71338d6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-05-11 10:35:32 +00:00
David Schulz
04da8f4178 Debugger: prevent calling functions on windows targets
This will result in a crashing gdb.

Fixes: QTCREATORBUG-23982
Change-Id: I59b65c5854bb4b7cbd59522a555388d1e833a560
Reviewed-by: hjk <hjk@qt.io>
2020-05-06 12:55:49 +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
d91d4aa759 Dumper: remove unused imports
Change-Id: I447c9697dbd631ab26358c193c274484e70a908d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-02 12:13:34 +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