Commit Graph

1242 Commits

Author SHA1 Message Date
hjk
e62d364d97 Debugger: Adapt QVariantMap dumper and test to Qt 6
Task-number: QTCREATORBUG-24098
Change-Id: I4e157a18ce5ff06a732fccbec1ec3d2ff507b961
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-03 15:22:24 +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
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
8e0780e28c Debugger: Fix QHash dumper for empty containers
Task-number: QTCREATORBUG-24098
Change-Id: I2bf15504ffefdb458a5d93c9185f8b695f120189
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-02 15:16:55 +00:00
hjk
25a89250f6 Debugger: Adapt QVariant dumper and tests to Qt 6
Task-number: QTCREATORBUG-24098
Change-Id: I9543bad098bb11d21079c1e2711b639bde3873b7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-02 10:16:33 +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
dd2a880b8c Debugger: Simplify QByteArray dumper again
Change-Id: Id2622db1e855c7706260796b633f06d0e5da0503
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-01 13:57:06 +00:00
hjk
e556463dc7 Debugger: Fix value endianness of register data with LLDB
Fixes: QTCREATORBUG-25009
Change-Id: I4de44cee6ef322791e3f4058a369548bfb210e77
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-01 10:09:44 +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
Christian Stenger
d31f2219fd Tests: Fix QString dumper test on Windows
Partially reverts 93fedb2c9.

Change-Id: I82c40c41a2d3e72774f046f91845fe2dc0745aad
Reviewed-by: hjk <hjk@qt.io>
2020-11-26 08:56:45 +00:00
hjk
0ce92b3ac7 Debugger: Adapt QXmlAttributes dumper to Qt6
Task-number: QTCREATORBUG-24098
Change-Id: I67ee0fae1308d20b474fe0dd565b46d2a83dd5e3
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-26 08:41:23 +00:00
hjk
93fedb2c9e Debugger: Disable Q{Typed,Byte,}ArrayData dumpers
Mainly because it is getting in the way of the string data dumper
consolidation. We can re-enable that afterwards. The loss here is
limited either way as QArrayData is only an implementation detail
of some Qt container, rarely, if ever used by end users.

Change-Id: I7e9074434f84da536d603b6a163a3a039facc8fc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-25 13:25:35 +00:00
hjk
35c2d51ec9 Debugger: Adapt QDate{,Time} dumper and test to Qt6
Essentially removing the parts that are gone in Qt6

Task-number: QTCREATORBUG-24098
Change-Id: I49f7ed8ea8e568803850bd4a0118b690248013af
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-25 13:06:28 +00:00
hjk
1f75893eba Debugger: Adapt QDir dumper to Qt6
Task-number: QTCREATORBUG-24098
Change-Id: I5346a8eb129dd042279754748b26852acf082f94
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-25 12:45:57 +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
8f338eb04f Debugger: Adapt QVarLengthArray dumper to Qt6
Task-number: QTCREATORBUG-24098
Change-Id: Ic93e15bd474d42be49de34c87d56ffbc07757bdb
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-24 08:52:38 +00:00
hjk
56b2158500 Debugger: Adapt QRegion dumper and test to Qt6
Task-number: QTCREATORBUG-24098
Change-Id: Ie9c75c779595a981e75f20e73bfaccb5d24cf16b
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-24 08:52:31 +00:00
hjk
5ad9b00cf7 Debugger: Adapt QImage and QPixmap dumper to Qt6
Task-number: QTCREATORBUG-24098
Change-Id: Ib9b6c824df67d18d9b4282340f2ab0d4a5bae837
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-24 08:21:15 +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
hjk
c80313f777 Debugger: Adapt QHash dumper for Qt6
This is a completely new structure, also effective order when
iterating is completely different.

QHashIterator doesn't work yet.

Task-number: QTCREATORBUG-24098
Change-Id: I917cacf7952d9d54a31d14a0691213ab944d0d8f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-23 12:26:24 +00:00
hjk
113fc9d060 Debugger: Adapt QStack dumper to Qt 6
Task-number: QTCREATORBUG-24098
Change-Id: Ibbe2f0c1faface1a1d6893eb0cb3987e5dff1b1a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-19 10:22:40 +00:00
hjk
92cd7f3c06 Debugger: Adapt QMap and QMultiMap dumper to Qt6
Chicken out of the QStringList == QList<QString> in Qt 6 dilemma
by using QList<QString> everywhere, that's not important for the
QMap test. value/key vs first/second nevertheless needs adaptation.

Task-number: QTCREATORBUG-24098
Task-number: QTCREATORBUG-23806
Change-Id: I4bdb8222978de7e7f1596be380e0fedc8f9d1a06
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-19 07:24:26 +00:00
Eike Ziller
46d2046173 Merge remote-tracking branch 'origin/4.13' into 4.14
Conflicts:
    src/shared/qbs

Change-Id: If75741825f5788165f9bf2f0248e976811273b6a
2020-11-12 11:39:01 +01:00
David Schulz
30b6147e80 Debugger: fix dumper for msvc release builds
... for std::vector and std::string.

Change-Id: I5c823b6c1b7b510344eeea4e1d5db0791d5c8e53
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-06 08:13:35 +00:00
David Schulz
3b611e07f7 Debugger: prevent calling functions with gdb on windows
and adjust tests accordingly

Change-Id: I172e08cfccc248eea06a94208c9e8e312d69e334
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-21 11:15:40 +00:00
Christian Stenger
9dbda24bca Dumper: Fix displaying intrinsic types in cdb
Change-Id: Id0089017912a8d5de0f822fed56231f291859bed
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-10-07 12:42:17 +00:00
Jeremy Ephron
b9323cccc0 Debugger: Use GetName instead of GetDisplayTypeName
In the newest version of LLDB, they remove anonymous and inline
namespaces from their display name, which breaks all debugger helper
code on Macs with the newest version of Xcode, since Qt Creator logic
determines libc++ vs. libstdc++ by the presence of the "__1" inline
namespace.

Change-Id: I139d0654ffbc9dec2e42b40eaad92ea2e3c067c0
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-01 10:29:12 +00:00
hjk
e685bb3b11 Debugger: Fix QVector dumper for Qt 6
QVector is a template alias to QList in Qt 6 and gcc creates insufficient
type information for template aliases:

g++ (Ubuntu 9.3.0-10ubuntu2) 9.3.0:

 <1><91>: Abbrev Number: 8 (DW_TAG_typedef)
    <92>   DW_AT_name        : QVector
    <96>   DW_AT_decl_file   : 1
    <97>   DW_AT_decl_line   : 5
    <98>   DW_AT_decl_column : 29
    <99>   DW_AT_type        : <0x2d>
 <1><9d>: Abbrev Number:

clang version 10.0.0-4ubuntu1:

 <1><86>: Abbrev Number: 8 (DW_TAG_typedef)
    <87>   DW_AT_type        : <0x67>
    <8b>   DW_AT_name        : (indirect string, offset: 0x4a): QVector<int>
    <8f>   DW_AT_decl_file   : 1
    <90>   DW_AT_decl_line   : 5
 <1><91>: Abbrev Number: 0

In order to not regress on what the user sees we generate the full
type name for the common case in the dumper.

Task-number: QTCREATORBUG-24098
Change-Id: Ic0b70b1b87ee027fc3fcc0409ea23f56a175bcc3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-28 07:31:42 +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
hjk
f7201c0c8f Debugger: Add leading zeros to transfer a hex-encoded float
Change-Id: Ie9d9159af67c0ef49cd133ec399d50909b853227
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-23 15:55:46 +00:00
Eike Ziller
5ad724c61b Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/qmakeprojectmanager/qmakeproject.cpp

Change-Id: Ieb1c3e946f11d3c4fa1ee6b5afdf83cc532d8aed
2020-09-17 10:28:19 +02:00
hjk
a50f1baf5d Debugger: Change LLDB value creation hack
... to something that works with LLDB 12.

Task-number: QTCREATORBUG-24596
Change-Id: Ib2f8255d45a02fa3d2c737864994397f587e9b15
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-15 08:45:32 +00:00
Eike Ziller
20f51bc642 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/languageclient/languageclientcompletionassist.cpp

Change-Id: If12e1c532e5623ef063681309a918e7b51117b1c
2020-09-14 10:12:14 +02:00
Dominik Holland
a535196c41 Add support for multiple Qt versions in "Load QML Stack"
Enable the functionality for cdb again.

Change-Id: I75405f830dd208cc110d6682a45beedf2f4199cc
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-09-11 08:11:21 +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
Jeremy Ephron
acd33f747d Debugger: Fix crash for std::vector<bool> on LLDB
Missing call to `.integer()` for the vector's size on the LLDB (libc++)
code path leads to a garbage size value and a failed size check. Fix is
to add the missing call `value["__size_"].integer()`.

Change-Id: If2113514fec02d9de248c1b4d3b0baea4f7ee5d2
Reviewed-by: Jeremy Barenholtz <jeremyephron@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2020-09-08 14:47:45 +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
Eike Ziller
3b76714290 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/MouseAreaSpecifics.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml

Change-Id: Ie5deacd39ae4f3c0966e7cb41a8fd832dcefbb09
2020-09-03 12:18:02 +02:00
Orgad Shaneh
fd32b222ee LLDB: Escape strings for correct parsing
Sample broken output:
>result={token="9",lldbid="1",valid="1",hitcount="0",threadid="0",oneshot="0",
condition="",enabled="1",valid="1",ignorecount="0",locations=[
{locid="1",function="foo()",enabled="1",resolved="0",valid="1",ignorecount="0",
file="F:\Projects\test\main.cpp",line="5",addr="4199979"},],
file="F:\Projects\test\main.cpp",line="5"}@

When parsed as GdbMi value, the strings are expected to be escaped.

Change-Id: Idb923516c1cf6e25b970ad08fae977bdf1045b4b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-03 07:39:50 +00:00
Orgad Shaneh
53c763029b Dumper: Fix size of refcount member in basic_string
It's an int. Still, the position is 3 pointer-sizes back due to padding
(the next member after this struct is the char pointer).

The pointer-size + bitwise stripping of the LSB probably doesn't work
on big-endian archs.

Change-Id: I4413d9b32986d1ea0be9abe1be4382ee36a9456c
Reviewed-by: hjk <hjk@qt.io>
2020-08-30 10:10:51 +00:00