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>
This was used uninitialized in some put call from lldbridge's
disassembler.
Change-Id: I5a3ecf075dfd4a6c4e8a483f9f8172e295329ad0
Reviewed-by: David Schulz <david.schulz@qt.io>
There are indications that the std::__1:: namespace cannot be relied
upon anymore.
Task-number: QTCREATORBUG-25061
Change-Id: I54d8d2fc757b1cfc9b27f00660f2814d745f2bc6
Reviewed-by: David Schulz <david.schulz@qt.io>
introduced by 9b8493314dd77f3e96b353187816bb7ef4dedbb5 from qtbase
This change does not address all usages of super data in the dumper, but
enables dumping children.
Task-number: QTCREATORBUG-24098
Change-Id: I813dacfa719dd6ca367e305fadcc8f2b8ee45425
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Strangely enough, this issue did not trigger with GDB for either
Python 3 or 2.
Change-Id: I0e5cf7ce0a8605f105bff549634aa014ef1f8403
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
To compensate for a potential 'Foo*' vs 'Foo *' difference in
debug info.
Change-Id: I90e822f89bc13bdf7ffed30ee12a984a659aa38f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Looks like we need to continue with this crutch for MinGW.
This partiall reverts commit 1074c2ffce.
Change-Id: I89d32f31281c3ef720bbc2a21d5a99bfd0066ba3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
(cherry picked from commit ffe3c56670)
Looks like we need to continue with this crutch for MinGW.
This partiall reverts commit 1074c2ffce.
Change-Id: I89d32f31281c3ef720bbc2a21d5a99bfd0066ba3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Only used for checks, do that within the function.
Change-Id: I4cc302864a9d3f8edac6f6364dfdac33b548e60a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This is one of the roadblocks for the current failing Qt 6 QVariant
dumper for self-registered types.
Change-Id: I304ce8e8aa3dfc5b3694b65198fbac4f42de6d4b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This makes the use of '@' prefixes in split('{@QString}'...) etc
mandatory, thereby removing the guessing on whether namespaces apply
or not on the dumper 'core' side, and removes the guessing on
whether dropping the '@' 'works' on the individual dumper implementation
side.
Amends 1074c2ffce.
Change-Id: I44611eb09557638dec12d2e2f78cdaeac0bbd449
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This makes meta method and property names visible again.
Task-number: QTCREATORBUG-24098
Change-Id: I2e0522396a5e91be43ae6b850217b9153b29a962
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Also rename it to vectorData, in line with byteArrayData and stringData
Change-Id: I91a4ddba272fcada3e451680ba5a5a756f7a976e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This was incomplete, can conceptionally not be complete, and most
of the sizes were wrong for Qt 6.
Change-Id: Id107b30dd6707b280c18a5d2065a4ec9c39fb035
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
It's generic, and operating on QArrayData (-subclasses).
Change-Id: Ieedc0f1e3f573aeeb422eb9516d4634e6e0da4b9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This fixes the QUrl dumper.
Task-number: QTCREATORBUG-24098
Change-Id: I2dbc2f477c33bc0c7337e8a925dd0a35d15aa31f
Reviewed-by: David Schulz <david.schulz@qt.io>
Move the version dependency into the dumper base instead.
This also fixes the QFileInfo display, but not yet QFile.
Change-Id: Ia2cb75b2a74cbbd4bb2d6ede2178d96792883912
Reviewed-by: David Schulz <david.schulz@qt.io>
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>
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>
This avoids creating individual child items when expanding a QString.
Change-Id: I49382dcf947ee7ac0470415a71ab05ede5f71b29
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
The lookup for qdump function was done by "struct Foo" instead of just
"Foo".
Change-Id: I325d00910a0c13c5e67692737033531e18392247
Reviewed-by: hjk <hjk@qt.io>
'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>
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>