Commit Graph

1330 Commits

Author SHA1 Message Date
hjk
f529ec492c Debugger: Add dumper for qdump__boost__container__devector
From https://lists.qt-project.org/pipermail/qt-creator/2021-August/008922.html

Change-Id: I85fff706e7f90a8182a434316fed4b6a43958af6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-31 07:48:06 +00:00
Jean-Michaël Celerier
e0f539a068 Debugging helpers: support for boost::small_vector
Change-Id: Ided74fa2ebf3e4ae5258e22064bb105bd45710ac
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ihor Dutchak <ihor.youw@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-19 11:34:33 +00:00
hjk
0f3e4531c5 Debugger: Add separate display to QStringView dumper
And don't show the plain members anymore, unless explicitly asked.

Change-Id: I9854276c380d417fb9a98ae9c0dbae9356d42086
Done-with: Thiago Macieira
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-13 14:05:56 +00:00
hjk
ea13ade822 Debugger: Add QStringView dumper
Fixes: QTCREATORBUG-20918
Change-Id: Ib16ac37000d227e6af2bc6d6640136ba0a7333b1
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-03 13:07:56 +00:00
hjk
d76fab2685 Debugger: Add dumper for quint{16,32,64}_{be,le}
Change-Id: Ieaa27a98b829455b69de0f8051fee8cbc3fa78f0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-12-21 08:52:30 +00:00
Alessandro Portale
16ced8a7d6 Debugger: Describe right SBError for failed remote-android connection
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>
2021-12-16 07:23:36 +00:00
Anton Alimoff
d06183d9cc Add debug helper for std::variant
Change-Id: Ifb2f47203fb5c101be5b2180693e39ba07b90c2e
Reviewed-by: hjk <hjk@qt.io>
2021-11-18 09:03:31 +00:00
hjk
a8afa5c65c Debugger: Fix setting of Qt version fallback, again
Change-Id: I6b6cd448884800cb6d08dbdce15cb99f4ea8ba2b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-11-10 11:50:21 +00:00
Christian Stenger
4303e62c50 Dumper: Fix passing fallback Qt version
We nowadays have an additional token there.

Change-Id: I65e5a55792802ae2ab7da6f7c6d8d1b109bf55a0
Reviewed-by: hjk <hjk@qt.io>
2021-11-10 10:20:08 +00:00
Andre Hartmann
f9f26570c9 Debugger: Add even more std and Qt char and int types
Make more stdint, quint and char types known to the debugger.

Task-number: QTCREATORBUG-26501
Change-Id: I1e757af2a495142fa37fe2b7cefec56690adbf08
Reviewed-by: hjk <hjk@qt.io>
2021-11-09 13:30:37 +00:00
Andre Hartmann
78a1beb06e Debugger: Improve handling of stdint types
* Make (u)intX_t known as integral type
* Handle uint8_t[] the same way as char[] and unsigned char[]

Task-number: QTCREATORBUG-26501
Change-Id: I1eac21be198f8107f088e56daf435b5bb3217120
Reviewed-by: hjk <hjk@qt.io>
2021-10-29 13:12:02 +00:00
David Schulz
5a2b58550e Debugger: use Qt version from kit as fallback for dumper
Fixes: QTCREATORBUG-26456
Change-Id: If2cd664212b3fa07d7abaef7a1173f79716884bb
Reviewed-by: hjk <hjk@qt.io>
2021-10-25 12:06:18 +00:00
Christian Stenger
dde5a52693 Revert "Debugger: Drop support for backends relying on Python 2"
This reverts commit 43bcf91121.

GDB coming with MinGW shipped by Qt (e.g. 5.15  official) are still Python2 based.

Change-Id: Iad658de7a242345cc7f6081f26f0238071668a06
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-09-24 07:04:34 +00:00
hjk
43bcf91121 Debugger: Drop support for backends relying on Python 2
The last discussion of the topic was 18 months ago, and already back
then it seemed not widely used anymore. See
https://lists.qt-project.org/pipermail/qt-creator/2020-February/008382.html

Change-Id: I48c879ce918b7351b1120bd70892deb0330637f5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-09-09 12:35:22 +00:00
Ihor Dutchak
716efc964d Debugger: Add support boost::container vector/static_vector
Also fix boost::container::list.

Change-Id: Iaa2ff09defc6f90c3f6eb1f7b333f9e5ccc16b65
Reviewed-by: hjk <hjk@qt.io>
2021-09-09 07:18:34 +00:00
Orgad Shaneh
7a7dc86716 GDB: Fix missing token on some responses
COOKIE FOR TOKEN 0 ALREADY EATEN (InferiorStopOk). TWO RESPONSES FOR ONE
COMMAND?

Change-Id: I569a9715f073f3fbba71045f14fa30a06cd434e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-09-06 12:48:11 +00:00
Alex Richardson
ebc229a25b Debugger: fix QString printing in LLDB with python3
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>
2021-08-16 09:34:28 +00:00
hjk
adf70fd8f2 Debugger: Don't add empty path components to solib-search-path
Change-Id: I417e5193749dae44d189fc0189a92899d738976b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 07:18:43 +00:00
hjk
185ceda8f1 Debugger: Make user defined gdb-style dumper work with arrays
Change-Id: I1667061eacf78a6fa4df567ea033e7bb5269da2c
Done-by: Bruno Vasselle
Fixes: QTCREATORBUG-26027
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-29 07:25:59 +00:00
hjk
1fef4085bf Debugger: Support CLion based LLDB
Change-Id: Ie044def8c243a62734cc77a9eab29cbb1fa81e66
Done-by: Igor Lifanov
Task-number: QTCREATORBUG-14539
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-25 06:13:03 +00:00
hjk
55f3d566a0 Debugger: Use more sensible import defaults for personaltypes.py
Fixes: QTCREATORBUG-25898
Change-Id: I6fbaaf0c219299ff157446376959e305693a9902
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 09:52:17 +00:00
hjk
84b8930c27 Debugger: Display elision for long Utils::FilePath instances
Change-Id: Ifb89ad1af1a41dff87d9debbb72423288c59d632
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-09 12:00:05 +00:00
hjk
925c49a1f1 Debugger: Adapt Utils::FilePath dumper to recent change
Change-Id: I0c21fe0bc795a24ce6b61d739f221f28cefc6df2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-25 08:30:46 +00:00
Christian Stenger
03624f9a68 Debugger: Do not omit original stack
..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>
2021-05-07 04:21:21 +00:00
hjk
75ededf4a9 Debugger: Implement "Load QML Stack" feature for LLDB
Fixes: QTCREATORBUG-25554
Change-Id: Ieafa22581c294d9b993efe077354750a8f986424
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-06 14:07:12 +00:00
Michael Weghorn
fd9ca07a11 Debugger: Import GDB pretty printers for new objfiles
Previously, if enabled in the configuration, system
GDB pretty printers were loaded only once for all
objfiles present at the point in time when the loading
happened, which meant that GDB pretty printers for
objfiles loaded later were not taken into account
and thus unavailable if they were defined in the
corresponding autoload scripts for the objfiles.

In order to make use of those as well, remember whether
loading of system GDB pretty printer is enabled, and if so,
evaluate the pretty printers set at the new objfiles
in the handler for GDB's new_objfile event.

Extract the functionality for handling one objfile's
pretty_printers to a separate function
'importPlainDumpersForObj' to avoid code duplication.

Note: For this to actually work, it is required that the
objfile passed to the registered GDB new_objfile handler
actually has the pretty printers set at this stage.
This was only recently implemented on GDB side, in
GDB commit 2c473def12b08100e6b56261f01112db7f6aeab5
("gdb: do autoload before notifying Python side in
new_objfile event", 2021-04-27, [1]).
Therefore, this currently only works with the current
development version of GDB built from its git master
branch, not with any already released GDB versions.
(When older GDB versions are used, this will just behave
as it used to, and the corresponding GDB pretty-printers
will not be used.)

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=2c473def12b08100e6b56261f01112db7f6aeab5

Fixes: QTCREATORBUG-25339
Change-Id: Ibc0ab16fbb75184fa199c0709bfc73954f04c193
Reviewed-by: hjk <hjk@qt.io>
2021-05-04 13:30:51 +00:00
David Schulz
4f9ed8d620 Dumper: Fix qobject name dumping for Qt 5 again
Amends: e05fe66f4b

Change-Id: I244017a63216a6bbc89d9f211eec7d7def27beb4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-14 09:28:45 +00:00
David Schulz
35b190834c Debugger: fix stringdata offset in metadata
Change-Id: I94899346c8193218133f80aa2716a6e5d44093e2
Reviewed-by: hjk <hjk@qt.io>
2021-03-24 09:55:52 +00:00
David Schulz
e05fe66f4b Debugger: Fix qobject name dumping for Qt 6
Change-Id: I146aa3d0b9d0f66a56a5fb1595f64297e15ebab8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-03-24 08:29:30 +00:00
David Schulz
2177eeb7cd Debugger: Fix QJSValue dumper for qt6
Change-Id: Id0a6796d3a4efca71a7f7474b2143281dc3322f0
Reviewed-by: hjk <hjk@qt.io>
2021-03-23 08:56:59 +00:00
David Schulz
4100b98d70 Debugger: Fix dumper tests for QVariant
Change-Id: I39953e14d3f1a15802b6acfc80a23005e304ee43
Reviewed-by: hjk <hjk@qt.io>
2021-03-23 08:56:46 +00:00
David Schulz
30ec121654 Debugger: Fix QObject dynamic property dumper
Change-Id: I120161f65a180f6facec0a5def2414ff128b31f9
Reviewed-by: hjk <hjk@qt.io>
2021-03-23 06:20:57 +00:00
Eike Ziller
834b6c2da1 Merge remote-tracking branch 'origin/4.14' into 4.15
Change-Id: I9b4f24456b94381fb7427d60bd683069edf31360
2021-03-09 12:44:12 +01:00
Christian Stenger
33cafa0dcf LLDB: Drop secondary lookup of native types
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>
2021-03-09 08:06:47 +00:00
hjk
89646aadce Utils: Don't raise SIGSTOP in the process stub
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>
2021-03-09 08:06:21 +00:00
Eike Ziller
fee671dfbe Merge remote-tracking branch 'origin/4.14' into 4.15
Change-Id: Ifbfb495fff50b5bb27a12b204653cf1697820913
2021-03-05 17:18:43 +01:00
hjk
b4de69795f Debugger: Mark elision of long QUrls in Locals and Expressions
Fixes: QTCREATORBUG-25404
Change-Id: Ieee42f9239c9ffe88da03765678e1d2c4b6bb11d
Reviewed-by: David Schulz <david.schulz@qt.io>
(cherry picked from commit 6df27ccbe7)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-03 08:25:25 +00:00
Christian Stenger
bf0154e50f LLDB: Do not print warnings to Locals
Change-Id: I552f75ebbb57c4af30582aa764fec75aa08df340
Reviewed-by: hjk <hjk@qt.io>
2021-03-01 15:13:00 +00:00
Christian Stenger
88ef74d0f9 LLDB: Fixup filtering out function signatures
Amends 2f67d75ca4.

Task-number: QTCREATORBUG-25185
Task-number: QTCREATORBUG-25217
Change-Id: Ic22d67d742273f9a8944c64df4c8a0647c4157f4
Reviewed-by: hjk <hjk@qt.io>
2021-03-01 15:12:54 +00:00
Eike Ziller
c55e59cb77 Merge remote-tracking branch 'origin/4.14'
Change-Id: Ib9512b4fc5e17b04ca4be79fc315e79a52d06497
2021-02-22 12:19:58 +01:00
Michael Weghorn
f4dc3fd5c5 Debugger: Prepend '*'s for autodereferenced pointers
If automatic dereferencing of pointers is enabled, the
"Value" and "Type" columns for pointers hold the values for
the dereferenced pointers.

In order to have a consistent behavior for the "Name" column
as well, prepend '*'s to indicate that the variable/expression
has actually been dereferenced.
Add parantheses around the original expression if it doesn't
match a simple regex for variable names, to avoid that the
leading '*' changes the meaning of the expression
(so e.g. a dereferenced 'somepointer + 1' is displayed
as  '*(somepointer + 1)' rather than '*somepointer + 1').

This introduces a new 'autoderefcount' field to propagate the
information how many levels of dereferencing have taken
place from the Python to the C++ side, which is then
used to add the leading '*'s for the display name.

Fixes: QTCREATORBUG-20907
Change-Id: Ia9a41cb42e25ba72a6d980a765dbe2b454deb8c8
Reviewed-by: hjk <hjk@qt.io>
2021-02-22 09:36:45 +00:00
Christian Stenger
2f67d75ca4 Debugger: Avoid looking up function signatures
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>
2021-02-22 06:21:39 +00:00
Michael Weghorn
2d8dff4a8a Debugger: Avoid exception with GDB 10 to fix running dumper tests
Since GDB commit 1ba1ac88011703abcd0271e4f5d00927dc69a09a [1]
("gdb: Enable stdin on exception in execute_gdb_command",
committed 2020-01-24), stdin for GDB is re-enabled whenever
an exception is caught during 'gdb.execute()'.

When running the dumper tests for GDB, such an exception
was thrown when loading the qtcore library, resulting
in the GDB commands after the 'run' command (s.
'tst_Dumpers::dumper') to be be handled by GDB prematurely
when loading the library instead of when reaching the
end of the test program.

This resulted in the dumper tests failing with output like

    29: (gdb)
    29: &"up 0\n"
    29: &"No stack.\n"
    29: ^error,msg="No stack."
    29: (gdb)
    29: &"python theDumper.fetchVariables({'token':2,'fancy':1,'forcens':1,'autoderef':1,'dyntype':1,'passexceptions':1,'testing':1,'qobjectnames':1,'expanded':['local']})\n"
    29: &"Traceback (most recent call last):\n"
    29: &"  File \"<string>\", line 1, in <module>\n"
    29: &"  File \".../qt-creator/share/qtcreator/debugger/gdbbridge.py\", line 711, in fetchVariables\n"
    29: &"    variables = self.listLocals(partialName)\n"
    29: &"  File \".../qt-creator/share/qtcreator/debugger/gdbbridge.py\", line 597, in listLocals\n"
    29: &"    frame = gdb.selected_frame()\n"
    29: &"gdb.error: No frame is currently selected.\n"
    29: &"Error while executing Python code.\n"
    29: ^error,msg="Error while executing Python code."

Avoid the exception by first trying to 'gdb.execute' the
command that works for GDB 8+ and fall back to the command
for earlier GDB versions, i.e. reverse the order. That
should be fine for all GDB versions, given the commit
mentioned above is only contained from GDB 10 on.

While at it, move the assignment to 'cmd' into the
corresponding 'try' blocks to make the context a bit
clearer.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=1ba1ac88011703abcd0271e4f5d00927dc69a09a

Change-Id: I2d1bb52a777801e6bd77a5eda581a2fd5dd3a18f
Reviewed-by: hjk <hjk@qt.io>
2021-02-19 08:14:31 +00:00
hjk
977b999248 Debugger: Initialize DumperBase.output
This was used uninitialized in some put call from lldbridge's
disassembler.

Change-Id: I5a3ecf075dfd4a6c4e8a483f9f8172e295329ad0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-02 14:07:01 +00:00
Mattias Johansson
2081038953 Add gdb tracepoint support for Linux
Change-Id: Id2e46bae576a730f8c1b64a247aeed12e6d721af
Reviewed-by: hjk <hjk@qt.io>
2021-02-02 07:36:07 +00:00
David Schulz
785932f0f1 Debugger: improve std::unordered_map dumper for cdb
and fix dumper tests

Change-Id: I1debd25a835aba28d77e5605dc49a5ea01221995
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-29 10:59:23 +00:00
hjk
3ffc7271e5 Debugger: Improve std::pair dumper display
And add a QPair dumper doing the same.

Task-number: QTCREATORBUG-25251
Change-Id: Iacff1889c08f7f60ec39d5d5b2b12439b8f8f5d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-21 11:55:07 +00:00
hjk
c2e3e0419d Debugger: Prepare delayed type creation for DumperBase.Values
Change-Id: I283bcdec178e0a860bef71753cd29cc283a58391
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-21 11:21:01 +00:00
Eike Ziller
16d25a3cc8 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/qmldesigner/assetexporterplugin/componentexporter.cpp

Change-Id: If742bcd843cf75cf55e07b489ecb7211f0cd9058
2021-01-18 11:50:32 +01:00
David Schulz
b7758eebb2 Dumper: Fix std dumper for release builds
for std::map, std::set and std::list

Fixes: QTCREATORBUG-24901
Change-Id: Ibfb196b17b7270729b052ed27dd51786cb2f8db8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-14 08:49:07 +00:00