Commit Graph

1467 Commits

Author SHA1 Message Date
Christian Stenger
9893768461 Debugger: Fix dumping std::unique_ptr on macOS
Change-Id: If718201d0f32f1eb210bd0f786f62182225b94c8
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-11-01 14:19:37 +00:00
David Schulz
7f1eaff398 Debugger: improve std::unique_ptr dumper for cdb
Fixes: QTCREATORBUG-29739
Change-Id: Ia8808c54137c762c54ad28f576c9d3be921d7d9c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-01 14:16:44 +00:00
Marcus Tillmanns
53931b18ad Debugger: Fix QDateTime dumpers with TZ != UTC
Fixes it for Qt 5.4 and onwards hopefully.

Fixes: QTCREATORBUG-29737
Change-Id: Ic555e304a872dfbd458a95097e4e0b6a6632509a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-10-30 07:44:28 +00:00
Marcus Tillmanns
3f647a4bc5 Debugger: Fix lldb fetchFullBacktrace
Change-Id: Ib0a513ecd6c0a0094797fe987aeaddc57d0b5149
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-10-20 07:43:06 +00:00
hjk
2886b2b383 Debugger: Robustify gdb stack frame extraction
frame.older() might run into invalid debuginfo and throw.

Change-Id: Iba1d395f21719bf28184302427c7ab2435c6a663
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-10-18 09:48:23 +00:00
hjk
b26e12e199 Debugger: Add a dumper for Utils::Key
Change-Id: I7e586b622160d5b06a3971fec825521231c09522
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-10-17 07:11:14 +00:00
Tor Arne Vestbø
81d571468c lldb: Auto install pygdbmi if not found
It's quite awkward that the user has to manually install pygdbmi
for the LLDB summary provider to work. And if the user has python
from homebrew, their 'pip3 install pygdbmi' won't be seen by LLDB
either, causing confusion.

By automatically installing pygdbmi via the python3 interpreter we
know we're running under, we simplify this for the user.

The user can opt out by setting QT_LLDB_SUMMARY_PROVIDER_NO_AUTO_INSTALL
in the environment.

Change-Id: Iad7935fd77e6f56ddf719126ef7ad1cb1a024877
Reviewed-by: hjk <hjk@qt.io>
2023-10-02 13:27:20 +00:00
Tor Arne Vestbø
182d4540b3 lldb: Add summary provider basic debugging facility
Change-Id: I166ad0c2e7d4ed508b1f4a8eeaf5e1e2488a3b70
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-28 08:54:23 +00:00
Tor Arne Vestbø
7033bbf7e0 lldb: Set environment variable to detect when running lldb from Creator
Instead of relying on __name__ being 'lldbbridge', which can also
be the case if the lldbbridge.py script is imported into a plain
LLDB process, we can now look at the environment variable.

This also lets us break out early from __lldb_init_module
if the user has a `command script import llbdbridge.py`
in their .lldbinit, or is automatically loading the bridge
via the Qt Core debug script.

Change-Id: Id8168c692ef66ce50119b7426ca85c7bc99d9503
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-28 08:54:13 +00:00
Tor Arne Vestbø
4b29b43a2a lldb: Add summary providers using consistent module name
When the lldbbridge is imported from the debug_script.py in qtbase,
it's imported using the module name 'qt', to distinguish it from
when Qt Creator imports the bridge.

So when we add the synthetic child provider, we need to use the
'qt' module name. This fixes the warning:

  The provided class does not exist - please define
  it before attempting to use this synthetic provider

If for some reason the lldbbridge.py is imported into a LLDB session
directly, we mirror the 'lldbbrdige' module name to 'qt' as well,
so that the class reference still holds.

Change-Id: I531b10fd5e10eb0c2acd6014169a02ba3157c704
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-20 11:20:57 +00:00
Eike Ziller
a3ef2a6d00 Merge remote-tracking branch 'origin/11.0'
Conflicts:
	src/plugins/projectexplorer/miniprojecttargetselector.cpp

Change-Id: Ie831644eb1c69beed6791cbc67cbfb9309dcd351
2023-08-29 08:47:29 +02:00
Marcus Tillmanns
eb17f4c2bf Debugger: Improve libc++ std::string dumper
Use isLldb and isGdb instead of exception.
Uses name based lookup in case of gdb instead of try/except

Fixes: QTCREATORBUG-29526
Change-Id: I6c3aa94503a519331395bd4249c6bf6488c8333f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-28 11:41:08 +00:00
Orgad Shaneh
4ad3925da4 Merge remote-tracking branch 'origin/11.0'
Change-Id: I5cdff1f5db3fae89beef3d27316b21440541bb1c
2023-07-30 16:24:15 +03:00
Cristian Adam
e321b3d6fc Debugger: Allow usage of Python 2 based GDB versions
Amends 7a210c41b4

Fixes: QTCREATORBUG-29440
Change-Id: I5991f7954c4831b732ea2b391e5542fab96a308e
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-27 10:25:05 +00:00
Marcus Tillmanns
77edffe3cf Debugger: Support linux remote debugging with LLDB
Adds support for Linux remote debugging with lldb-server

Change-Id: I3ee08704a3116030111df75273a46a2e4888f98e
Reviewed-by: hjk <hjk@qt.io>
2023-07-06 14:22:50 +00:00
Eike Ziller
26e96bfad8 Merge remote-tracking branch 'origin/11.0'
Conflicts:
	src/plugins/debugger/debuggeritemmanager.cpp

Change-Id: I9d99d13feff9315f52eacbd84857c63cb69bf804
2023-07-03 10:24:09 +02:00
David Schulz
596cd204e1 Dumper: fix array 10000 format
Fixes: QTCREATORBUG-29196
Change-Id: I23ddb17ac3f378b6602057c1964ef5984b83e245
Reviewed-by: hjk <hjk@qt.io>
2023-06-30 07:47:27 +00:00
Eike Ziller
606be1f69f Merge remote-tracking branch 'origin/11.0' into work
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs

Change-Id: Ib4653a1ce75c7cce658f4bb843481de014d0fcf7
2023-06-26 12:12:58 +02:00
Marcus Tillmanns
456a019f2d Debugger: Don't spam app output
Only errors should be displayed in the App output.
Everything else is just noise.
To keep the information for debugging purpose we log it to the
Debugger Output View instead.

Fixes: QTCREATORBUG-27160
Change-Id: I37301edd2f6638e2b4152d1bf7b89a40c9c3c0af
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-26 07:40:58 +00:00
Marcus Tillmanns
31c6ff495a Debugger: Fix remote debugging macosx apps
Change-Id: I5328069ba9b82bb66dfa2c1e0d148a717d594a4b
Reviewed-by: hjk <hjk@qt.io>
2023-06-23 11:57:34 +00:00
hjk
1e7f68e296 Debugger: Fix Gdb CLI dumper output
Patch from hunk #2 in the report, hunk #1 was handled by 76260f8038.

Fixes: QTCREATORBUG-28659
Change-Id: I674b742869f8b834d039fbbfc599a3261d76b054
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-06-22 06:16:10 +00:00
David Schulz
c7b8ed520d Debugger: avoid recursive pointer type lookup
the std::nullptr_t gets reported as a pointer type with std::nullptr_t
as the target type. In order to avoid a recursive lookup check whether
the target type name is identical to the pointer type name.

Fixes: QTCREATORBUG-29291
Change-Id: I25373bf56b5538b9e5c14c34b9a5e501b5803fea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-19 17:18:18 +00:00
Marcus Tillmanns
7a210c41b4 Debugger: Add support for newest libcxx std::string
Fixes: QTCREATORBUG-29230
Change-Id: Ie3e0d0d56a1b07767ea702a03b2390b42a478376
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-19 12:32:14 +00:00
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