Commit Graph

1212 Commits

Author SHA1 Message Date
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
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
hjk
1c9194d2eb Debugger: Make QByteArray, QString and QList dumper work with Qt dev
Note that this is more a temporary workaround as there are more changes
to come (qsizetype instead of int for sizes, switch QList/QVector
aliasing).

Task-number: QTCREATORBUG-23806
Change-Id: Ic815fe293b1c4922276c127dec61930dc365acae
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-18 07:48:59 +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
Christian Stenger
9e4eafccd2 Dumper: Fix python code for Xcode 10.1
Change-Id: I65797bac8b668ce85082eccf6520147a2a4c5680
Reviewed-by: hjk <hjk@qt.io>
2020-06-11 12:58:32 +00: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
090110e1d8 Debugger: Fix passexception_s_ for GDB CLI
The intention was to always show errors, as this is likely an error
in the dumpers themselves. The case of operating on uninitialized
data is rather rare in the manual use case here.

Change-Id: I08874e302b402be94f760f744e82e127855dd16f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-02 12:34:21 +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
Eike Ziller
227904d4a6 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Ic39945a0e3e140a9467b4b4f572929257ff3a324
2020-05-26 09:00:05 +02: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
c6007f5a2c Debugger: Funnel some LLDB message to the AppOutputPane
This could be extended to the other bridges, not done in this patch.

Change-Id: I620290049b7c95f8e3fb7584d4ca99a42fd343d4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-18 06:47:10 +00:00
The Qt Project
8f1be3f343 Merge "Merge remote-tracking branch 'origin/4.12'" 2020-05-15 12:49:43 +00:00
Eike Ziller
52b7ec058b Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/mcusupport/mcusupportsdk.cpp

Change-Id: I1583fa81adc0218ad4657baa347c08e9e29f88e6
2020-05-15 14:49:11 +02:00
hjk
73865034c6 Android: Use adb:// in ConnectRemote
This is apparently the right thing to do anyway and also helps to
select the right emulator or device when multiple ones are connected.

In that situation otherwise an error

  "Expected a single connected device, got instead 2 -
    try setting 'ANDROID_SERIAL'"

would occur.

Change-Id: I650a221d1a321d4dd9035411f85c7a68244c20e2
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-05-15 11:37:35 +00:00
Christian Stenger
dd9bed93f0 Dumper: Fix Python 3 support
Change-Id: I3b981a0418b2a407adfbdbab5f6b73176aeb588f
Reviewed-by: hjk <hjk@qt.io>
2020-05-14 13:16:13 +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
a6e1894274 Debugger: Report LLDB error if bridge could not attach to process
Change-Id: Id54c0e21d7d803505b45f92ecf0a208771d10b81
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-05-13 09:08:18 +00:00
hjk
ca862e3fff Debugger: Fix LLDB listing registers when no frame is selected
Change-Id: I6c3d193a2622ed07c34e68bf8b5780d55520e4f2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-12 05:52:08 +00:00