The type cache has been split into smaller caches for individual
aspects. Type ids are now integral, not strings.
In addition, there is new supporting code for logging, timing and
profiling
Change-Id: I6db72a149650d42aecf8b899869c542b1303d43b
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
From https://issuetracker.google.com/issues/240007217#comment17
"Some a background on the technical aspect of SEGVs:
Android Runtime (ART) uses SEGV for various internal purposes (it
triggers a SEGV and handles it without crashing the app, the app doesn't
know it happened). When the native debugger is connected, the debugger
must intercept all SEGV signals.
When running the debugger on Android API level 27 and newer, we make the
debugger skip these SEGV signals (i.e., forward them to be handled by
ART), because we know how to handle real SEGV signals inside ART. For
older Android versions (26 or older), we did not have this support, so
the debugger stops at every SEGV (i.e., it cannot know if the signal is
a real crash or an ART-internal thing)."
Arguably, this should be caught by the LLDB Android platform bits, but...
Task-number: QTCREATORBUG-30759
Task-number: QTCREATORBUG-29928
Task-number: QTCREATORBUG-30080
Change-Id: I8cabe4a0675c596a9617520aff0d62ad11321f0e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Setting the breakpoint actually worked, but it was reported back
using a wrong address, so it never went "red" in the disassembler view.
Change-Id: I4c2bd808705dfe793c0febf29b3e78b318dbae00
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
When working with statically linked Qt qVersion may not be available.
In that case Qt uses the qtHookData which has type of quintptr.
This type is subject to SyntheticChildrenProvider because lldb
hooks are set up via a regular expression.
When SyntheticChildrenProvider is instantiated, it tries to fetch
Qt version, which causes another instantiation which again recurses.
The fix is to bypass SyntheticChildrenProvider via GetNonSyntheticValue.
Change-Id: Id00cdb3d0a0895bb02e4b3e4504c574d89be2ed0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Since frame 0 points to the Windows DebugBreak function it does not hold
any usable locals, so we have to pass the correct frame to the
lldbbridge test infrastructure in order to get usable data.
Change-Id: I2595be87a718d73fda3429017efd564e5d0ed9be
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit will enable running of tst_dumpers on Windows using a MSVC
setup and lldb.exe as debugger.
Change-Id: I17611cc90ba2a04ec21aae11af16f1d0ff8e894f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
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>
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>
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>
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>
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>
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>
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>
lldb's FindFirstType() expects template types to have specific
whitespaces set. QMetaType's "name" parameter does not contain
the necessary whitespaces.
This solves that by changing e.g.: "T<A,B<C,D>>"" to "T<A, B<C, D> >".
Change-Id: I7505db96b01d433408af1942cd81e50094833c06
Reviewed-by: hjk <hjk@qt.io>
It is the result of the previously attempted SBPlatform.ConnectRemote()
which we want to see in the logs if the connection fails.
Change-Id: Iec2760257eb8bb8c6b1df8aa3a5c010302966c8f
Reviewed-by: hjk <hjk@qt.io>
Before this change I was seeing all strings as
`<failed to decode '...' as 'utf16'>` when using LLDB bundled with CLion.
This error is misleading since the actual exception raised from the python
code was `'str' object has no attribute 'decode'`. To fix this, I updated
the hexdecode() method on Dumper to accept an optional encoding argument
and use that instead of the python2 str.decode().
Change-Id: Ic3afc786c42fd7384d9dc3117f0871837076c2ba
Reviewed-by: hjk <hjk@qt.io>
..if loading the qml stack failed, e.g. when using a Qt
without debug information.
Task-number: QTCREATORBUG-25554
Change-Id: Ibe2a051f4dc0a9d3c15a63f663f5934a476d6fc4
Reviewed-by: hjk <hjk@qt.io>
Although already tried to lookup a native type with an
lldb internal mechanism we still tried to do it "manually"
again.
This secondary approach was needed at some point when lldb
had no integrated way to lookup a type inside all modules.
Lookups done manually will not provide a better result than
the lldb internal one.
The error output generated with this blocks debugging which
makes QC unusable at this state.
So, remove the secondary lookup completely.
Fixes: QTCREATORBUG-25185
Fixes: QTCREATORBUG-25217
Change-Id: Ibd8a125a89633c611bf750e0f1759c639717e1d2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Previously, the starting inferior was sent a SIGSTOP to avoid
progress before the debugger could attach.
However, these signals are then also visible in the debugger and
need to be ignored as part of the startup handling in Creator.
The waiting effect can be achieved less intrusively by waiting
on a pipe read between fork() and exec().
Task-number: QTCREATORBUG-25073
Task-number: QTCREATORBUG-25082
Task-number: QTCREATORBUG-25227
Change-Id: Ie70b9eb5ea865f85411c26b0dbf377a019fec8d5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Looking up function signatures ends up in massive
stderr output which blocks the debugger for ages, so omit
them as long we are not sure where they originate.
Task-number: QTCREATORBUG-25185
Task-number: QTCREATORBUG-25217
Change-Id: I9b022d2194a6cb61651ee0648be526fc94a02da9
Reviewed-by: hjk <hjk@qt.io>
Case like 'template<typename T> using TVector = std::vector<T>'
end up only as 'TVector' in the debug info. This is unsuitable
as an id in our type info caching as this would only allow one
type layout for all specializations, which is not the case for
e.g. std::vector<bool>.
The solution is to mangle the target type into the id, as already
done for GDB.
This makes the Typedef2 dumper test pass.
Change-Id: I11538bbf6431f61a11c18366a2a2b4911cdc2e0e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This fixes the Internal2, EnumFlags and EnumInClass tests on Linux.
The values lose now the previously hand-crafted Class:: prefixes,
but the context is clear from the type column, and it's what LLDB
developers (and potentially users) consider normal.
Change-Id: I09e41f7b4fb4f078ef3f535fe650d06e7c2a0331
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>