Commit Graph

1394 Commits

Author SHA1 Message Date
David Schulz
28d1d3ffe1 Debugger: support piping the python dumper to cdb
Fixes: QTCREATORBUG-29000
Change-Id: I7454ded07829d06a33dc1b2ec95a838ca977ca95
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-04-20 12:51:22 +00:00
Eike Ziller
2bc37de42b Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/python/pipsupport.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/qtsupport/examplesparser.cpp
	tests/auto/examples/tst_examples.cpp

Change-Id: I00273622423fa99d41621969f6ecbbdaa0e18664
2023-04-13 15:59:08 +02:00
Marcus Tillmanns
cb4074713f Dumpers: Fix std::string for clang >= 15
libc++ has changed the layout of std::string again.
(see https://reviews.llvm.org/D128285)

This patch adds checks to differentiate between the two versions.

Fixes: QTCREATORBUG-28806
Change-Id: Ic21c488cf1c173120beddf414ca39040dfaba096
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-04-05 09:16:45 +00:00
hjk
de546ff3ec Debugger: Support piping dumpers into gdb
This allows using dumpers available on the host being used from
remotely running gdb. No lldb/cdb yet.

Task-number: QTCREATORBUG-29000
Task-number: QTCREATORBUG-16246
Change-Id: Ib1a40a8c0284dcf41e8800d70ca3e632c699b2fa
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-05 06:26:11 +00:00
hjk
2766b4004b Utils: Continue Environment/EnvironmentChange consolidation
Make Environment a stack of changes that gets "expanded" to
a full environment before things are actively accessed.

Later this expansion should be done lazily if possible.

Task-number: QTCREATORBUG-28357
Change-Id: If1c7bfdb9f58b81e71c51ed87ee75d6964a47019
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-24 07:45:35 +00:00
Marcus Tillmanns
cdfe9462af Debugger: Fix "Run in Terminal" with lldb
Previously lldb never actually attached to the process running
in the terminal, but started its own copy.

Since the process is interrupted by the terminal stub already,
code was added to automatically continue the process.

"Start and break on main" and "Run in Terminal" also did not work
together and are now fixed.

Change-Id: Iaeb6e7dd0f511f3bf195ab5d0008856b310615d9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-13 14:37:48 +00:00
Artem Mukhin
5c0a956e8c Debugger: Fix GDB MI output parsing
When using `lldbbridge.py`, Python throws `TypeError: string indices must be integers` because `gdbmiparser.parse_response` cannot parse the multiline output.

The bug was introduced in bb11788.

Change-Id: I5faae4c3d034c0f159e9c1e473b6929ba79b8272
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-03-12 11:16:05 +00:00
Eike Ziller
36d9341397 Merge remote-tracking branch 'origin/10.0'
Change-Id: Idf151b6cfe87957cf905e67aab6b1275b9f0506a
2023-03-06 08:24:18 +01:00
Christian Stenger
5ea655cabd Dumper: Fix dumping QDir with Qt6.6
Change-Id: I7ef37026c638f7e77e4e34af40c3ecff1e40e8b3
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-06 07:11:05 +00:00
David Schulz
1124a75948 Debugger: Fix highlighting values and members in memory view
Fixes: QTCREATORBUG-23681
Change-Id: I1420385d0c923be0ae4dd7ef2662263b88623333
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-03 07:04:18 +00:00
Eike Ziller
87ede95b5c Merge remote-tracking branch 'origin/10.0'
Change-Id: I7bd186df0bfae7906e980e9c2c811f8dcf29750d
2023-03-02 10:17:58 +01:00
David Schulz
f3cbd506dd Debugger: Avoid looking up qt symbols globally to get the qt namespace
This can get very expensive for targets that have a lot or big modules,
but are not linked against Qt. On the downside we might not be able to
identify Qt namespaces in static builds.

Task-number: QTCREATORBUG-18287
Change-Id: I90e0c4afcde17fd81d49017e828ce59f0abe9b5c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-01 11:43:19 +00:00
David Schulz
fb8182ca7c Debugger: fix QJSValue dumper for Qt >= 6.5
and disable the QV4::Value dumper for that version.

Change-Id: I31a0ddba2bdab3b196e4fc5298fd8e7c10f9dc92
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-01 09:51:07 +00:00
David Schulz
8288a4c563 Debugger: fix dumper for QVariant containing a QList<int>
...for Qt 6.5.
Found by dumper tests.

Change-Id: Ibb9ccf72a5f18e203e37123f1fc5458142bd4efc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-01 09:32:27 +00:00
David Schulz
a4fb9e20cb Debugger: improve dump time for various msvc std containers
... by caching the info whether we have a debug build. This avoids
expanding members of the container to check for a potential offset of
the actual data.

Change-Id: I4d7ac83003c303185ae51d57f0f0571b627edf22
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-02-27 12:26:37 +00:00
David Schulz
5169469911 Debugger: add <load more> functionality to array dumper
Change-Id: Ib44748fa3218788ca20a99b0a0f4cd85716dde06
Reviewed-by: hjk <hjk@qt.io>
2023-02-27 08:35:32 +00:00
David Schulz
b625e8bb9b Debugger: improve dumping Qt pointer types
Adding the data as pointers allow casting the data to the actual derived
class

Change-Id: Id1b421c2729c6da8bf17054e39b4f1e8d8ff2cfa
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-02-21 08:45:59 +00:00
David Schulz
1a575cd2df Debugger: Fix printing of pointer to multiple inheritence base class
...for cdb when we have no nativeValue. This is the case whenever we
have a container like std::vector, QList or a c array to the base class.

Fixes: QTCREATORBUG-28337
Change-Id: I18c63dfbc207d76bf41d85d5da83f7f4603504f9
Reviewed-by: hjk <hjk@qt.io>
2023-02-21 08:45:49 +00:00
Christian Stenger
beac91ac81 Dumper: Fix std::variant on Linux
Amends 2c39db8eb7.

Change-Id: I22e9e2d25d5353cf2e818b7e2fa9f52557dbdda5
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-02-15 14:24:49 +00:00
David Schulz
2c39db8eb7 Debugger: modify dumper for std::variant
Directly display the containing value without the need to expand the
variant. Additionally fix the dumper for Windows and add tests.

Change-Id: Iaae49470750fa3659339331e1518e13020df7938
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-02-15 08:23:18 +00:00
David Schulz
3a2b49aafa Debugger: test std::optional dumpers
Change-Id: Iae177dd3448a861e93935d02388ea6af187bd9f3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-02-15 08:23:13 +00:00
David Schulz
ab9b5357f9 Cdbext: fix expanding lamba captures
Change-Id: I2c1c64e3258cec503f83dbf561a734b4694592c4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-02-14 13:21:45 +00:00
David Schulz
e47dae643a Cdbext: lazy type lookup
Postpone the lookup until we need the type id. This potentially skips
the lookup for unresolvable types that are just to parse template
parameters. Also cache types we already checked to prevent looking up
types multiple times. Additionally traverse all modules in order to find
unresolvable types.

This combination reduces the time the debugger needs to execute all
dumper tests from ~7:30 to ~3:30 on my machine.

Task-number: QTCREATORBUG-18287
Change-Id: Ie1e9771f124096c2a9ad24ac26c9b51fcded4fed
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-02-14 13:21:38 +00:00
Christian Stenger
885c6c1f0e Pdb: Change shutdown handling behavior
Directly finish the debugger when program ends if the
debugger is in running state as this feels more natural.
Only get into post-mortem handling when stepping.

Change-Id: I6ac6600a7cb8f58a003a6e4783174864ed5e89d8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2023-02-14 06:44:07 +00:00
Christian Stenger
ab4516c85c Pdb: Make another builtins usage implicit
Amends f6afedeea6.

Change-Id: Idc0ffb9f0c24515475334a847382fc84c5c03e2e
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 15:31:03 +00:00
Christian Stenger
f6afedeea6 Debugger: Do not crash when using a builtin as value
Explicitly use str(), type() and similar from builtins
to avoid confusing the the debugger when these builtin
functions are overwritten by the script which is going
to get debugged.

Fixes: QTCREATORBUG-28733
Change-Id: I6b7bd1d7474972d0533d12a1bc45bb59db7f39b5
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 12:35:26 +00:00
Łukasz Wojniłowicz
b05a34b81e Debugger: Don't try to iterate on non-existent subprinters
gobject_gdb.py puts the pretty_printer_lookup function into
gdb.pretty_printers. Trying to access subprinters of it causes the
AttributeError exception.

Change-Id: I00ce7b62866dd9c06a1f0abef0c7043ece023d34
Reviewed-by: hjk <hjk@qt.io>
2023-01-26 17:09:11 +00:00
Łukasz Wojniłowicz
76260f8038 Debugger: Port away from deprecated getargspec
https://docs.python.org/3/whatsnew/3.11.html suggests using
getfullargspec instead.

Fixes: QTCREATORBUG-28505
Change-Id: I27199f7e2c3a070c675dce3a152d201e22a16380
Reviewed-by: hjk <hjk@qt.io>
2023-01-11 15:38:46 +00:00
Łukasz Wojniłowicz
0648cd49f9 Debugger: Don't split top-level name into letters
If names = ['foo.bar'] then toExpand = ['foo.bar', 'foo'] instead of
toExpand = ['foo.bar', 'foo', 'fo', 'f']

Change-Id: Ia6e021b1f32d9f1e5a78209e9a269725e298409e
Reviewed-by: hjk <hjk@qt.io>
2023-01-11 15:37:39 +00:00
Eike Ziller
0dfa542bee Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/cppeditor/cppcodestylesettingspage.h

Change-Id: I1aa4e2f9efc6d9cf9f284aef1abf148be9b93a60
2023-01-10 15:44:55 +01:00
Kai Köhne
4e9c1d126c Replace GPL-3.0 with GPL-3.0-only
GPL-3.0 is deprecated by SPDX.

Change done by

 find . -type f -exec perl -pi -e 's/LicenseRef-Qt-Commercial OR GPL-3.0(?!-)/LicenseRef-Qt-Commercial OR GPL-3.0-only/g' {} \;

Change-Id: If316a498e3f27d2030b86d4e7743b3237ce09939
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 08:05:04 +00:00
Dmitry Bravikov
34ff9c97e6 Debugging: Add dumpers for libcpp types: variant, optional, tuple
Task-number: QTCREATORBUG-25865
Change-Id: I262ac708ae040982d2ed4f62e1f95807eaaae718
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-01-06 12:07:45 +00:00
hjk
c7bb5fcc37 Debugger: Remove spurious waring
Task-number: QTCREATORBUG-27160
Change-Id: Ie69c60688249efcd4d2c2330d6555cf7f708edd2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 08:32:09 +00:00
hjk
f81724f458 Debugger: Make android std dumpers refer to libcpp
Amends af881688e5.

Change-Id: If207dd04e37e5f80f68b374fe66fd3beec330ead
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-12-20 11:19:46 +00:00
Marcus Tillmanns
af881688e5 Debugger: Fix name of "mac_stdtypes.py" file
It was incorrectly assumed that the types were only used on macOS.

Change-Id: I8acc326fe63d4cb96b764da1262355d24494f337
Reviewed-by: hjk <hjk@qt.io>
2022-12-14 08:25:37 +00:00
Marcus Tillmanns
d5b585dad6 Debugger: Fix dumper for std::string from lib++ in GDB
Fixes: QTCREATORBUG-28511
Change-Id: I56ca11c9a5f9b7a885bbaa0223bd2f47ea4abb4b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-12-01 06:55:20 +00:00
Eike Ziller
b038ea3a40 Fix debugging with LLDB
Broke with bb11788a0a

Change-Id: Ie02a36b98be83bd4721eacc834321a5494c584a3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-09 11:47:52 +00:00
hjk
bb11788a0a Debugger: Avoid quadratic behavior for larger debug output
Task-number: QTCREATORBUG-28111
Change-Id: I0567b6af9f74c2d335d19a52765834ef7cee9449
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-08 13:53:30 +00:00
hjk
689ba1ead1 Debugger: Fix internal FilePath dumper
Amends 23e96dd6fe.

Change-Id: Ia602f09e4138125d41cb455b847e8b85ad767782
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-10-13 13:24:49 +00:00
hjk
23e96dd6fe Utils: Use a single QString as data store for FilePath
Plus a few integers to get access to the pieces.

This reduces sizeof(FilePath) from 72 to 32.

Change-Id: I65eb856ad47b6a250c705d8d01893781a21d8e02
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-10-04 07:27:16 +00:00
hjk
37db98db30 Debugger: Simplify TypeData setup and registration
Change-Id: Ib23249eae63901d614cbe33fe184f174a10efbe4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-28 11:59:50 +00:00
hjk
2006d41680 Debugger: Store tdata as member in Type
Change-Id: I2e784be9a16914a30b08bdfbedb789d8a1d3f910
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-09-08 10:20:33 +00:00
Orgad Shaneh
661994c288 Debugger: Fix cross-endianness display for arrays
Debugging a BE target on LE host showed wrong values when expanding an
array.

Change-Id: Icad9db8be11c3093de3b7bab52df815bf56f1677
Reviewed-by: hjk <hjk@qt.io>
2022-09-05 13:55:14 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Marcus Tillmanns
b2b6577d5c Lldb: Use qtHookData to retrieve Qt version
Adds caching of Qt version information.

In case that qVersion() can not be found, use qtHookData[2] to retrieve
the Qt Library version number.

In case that also fails, we now use self.fallbackQtVersion instead
of just returning 0x50200.

Previously debugging apps in the iOS Simulator would fail to correctly
detect the Qt Version, as qVersion might be optimized out, especially
for very simple applications.

Change-Id: I9183c1e9793bd899f296a231c693cd5bc146ab96
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-25 06:24:15 +00:00
Marcus Tillmanns
8b143be86c Debugger: Adds boost 1.79 dumpers
Change-Id: I2111b91fe8914afdde54edd6009691dfe32e64a4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-24 06:56:08 +00:00
Marcus Tillmanns
42e1714ea1 debugger: Fix dumper for std::string and unordered_multiset
Moves mac specific dumpers to separate file
Creates android dumpers for stdtypes

Change-Id: I33d28198e1a2f24fb7707313845db81e283686cd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-08-23 10:49:43 +00:00
hjk
266adf7b1d Debugger: Delay template argument retrieval from native types
For performance reasons. They are often not needed.

Change-Id: I8a7bb03583b3ec2479a3691486c9c02f70ad014e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-22 13:26:02 +00:00
Marcus Tillmanns
2635d62721 Dumper: Show error message if module fails to load
Change-Id: Id4e445f71f70f0b07ccc4c4ffb25502607263dec
Reviewed-by: hjk <hjk@qt.io>
2022-08-11 14:02:30 +00:00
Christian Stenger
5b67f03416 Dumper: Fix bitfield handling on macOS
Amends f14634a651.

Change-Id: Iae1c7ad9c78786c9178a07a493abb76db3b4c4aa
Reviewed-by: hjk <hjk@qt.io>
2022-08-04 06:33:47 +00:00