Commit Graph

1330 Commits

Author SHA1 Message Date
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
Eike Ziller
6efb09a86a Merge remote-tracking branch 'origin/4.13' into master
Change-Id: I8b11dad770b37a7f6029ae818c9d92a24818e56d
2020-08-26 13:12:21 +02:00
Orgad Shaneh
29ecf16ed3 Dumpers: Fix string+allocator dumper for old GCC versions
Older versions of GCC headers don't have _M_string_length.

Tested against GCC 4.4.4.

Change-Id: Ib3a025edeb26afce7fd54acfb6e965e64200f024
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-08-26 09:23:27 +00:00
Eike Ziller
3944162039 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
	src/plugins/cmakeprojectmanager/cmakebuildstep.h
	tests/auto/debugger/tst_namedemangler.cpp
	tests/auto/qml/codemodel/check/tst_check.cpp

Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
2020-08-10 15:56:54 +02: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
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
hjk
557d7723eb Debugger: Fix Qt6 QBitArray dumper
Task-number: QTCREATORBUG-23390
Change-Id: I8f233524d1daa7afe65b4414e5c9926dce9811e3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-27 13:21:05 +00:00
hjk
4a434e14d5 Debugger: Fix QList dumper for Qt6 empty lists
Plus some cosmetics.

Task-number: QTCREATORBUG-23390
Change-Id: I959437902b74d234372c60055ef2f774f411850c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-27 13:20:57 +00:00
hjk
961560df6f Debugger: Fix Qt6 QString/QByteArray dumper
... for the fromRawData() case.

Task-number: QTCREATORBUG-23390
Change-Id: Ic603df428d03aa61f0fcde4e090d36231a7e05d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-27 13:16:54 +00:00
Eike Ziller
b18711da91 Merge remote-tracking branch 'origin/4.12' into 4.13
Conflicts:
	share/qtcreator/debugger/lldbbridge.py

Change-Id: Ia444f6424fb35b9a539e157afcee868161535272
2020-07-06 16:23:13 +02: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
Eike Ziller
d0e3f5ca98 Fix debugging C++ on iOS devices
Partially revert 7f958700a0 for 'remote-ios'.
The original commit changed the way attaching to a remote server or process
works, attempting to make it work with lldb-server on a remote linux device.
That breaks connecting to the debugging server on iOS devices.

Fixes: QTCREATORBUG-23995
Change-Id: I7a793fa73a564a4ef19cf82e13c2ad50d4247ee3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-06 09:18:40 +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