Commit Graph

327 Commits

Author SHA1 Message Date
hjk
f75a7fa036 Debugger: Support rvalue references in functions args with gdb
Change-Id: I5383ffa38f07e3f191619555a9e735c211b3dd8b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-10 11:33:46 +00:00
hjk
5a8b198b9a Debugger: Fix display of multidimensional C arrays
Fixes: QTCREATORBUG-19356
Fixes: QTCREATORBUG-20639
Fixes: QTCREATORBUG-21677
Change-Id: Ie28b51c6caf526e125234959cbf11503d0683dc7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-12-17 09:42:56 +00:00
hjk
81b6d4f637 Debugger: Robustify QEvent dumpers
There's no need to go through unknown enum sizes here, they are known.
Also, make it work for namespaced Qt. Avoid casts to typedefs.

Change-Id: I9c6fc44a03a0c245f05957306a129f6902f8cf85
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2018-12-12 09:27:20 +00:00
Christian Stenger
8a21555235 Dumper: Remove unreachable code
Change-Id: Ic0e6c0b9d3d2e4e3a3bf8a63cce41ae23e1084bd
Reviewed-by: hjk <hjk@qt.io>
2018-11-19 14:22:57 +00:00
Christian Stenger
84576d3098 Dumper: Fix displaying enums with LLDB
Prioritize displaying as enum if a type is known
to be an enum. Otherwise this would just end up
get displayed as string representation of its value.
Enable respective dumper tests.

Change-Id: I3e5406e14a68f02741b6144bb54528b72cc8192d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2018-11-19 14:22:45 +00:00
Christian Stenger
1787eef68f Dumper: Fix handling of bitfields for MinGW
Fixes: QTCREATORBUG-19742
Change-Id: I8723da875607e00a833cd5a1ccb748e7f8ed4314
Reviewed-by: hjk <hjk@qt.io>
2018-11-12 08:51:49 +00:00
Christian Stenger
ace6708b88 Debugger: Fix display of null references
Fixes: QTCREATORBUG-21210
Change-Id: I529f38aad9b93707e09ffdd28885e46c2cfd158c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-11-06 11:26:05 +00:00
Alexandru Croitor
89fe2681f7 [Debugger] Add dumpers for Python "PyObject"s
The dumper calls PyObject_Repr and shows the result of that as the
value of a PyObject.

It also adds three new sub fields to show the object class (type),
super class (base class), and the meta type (the type of the class
object).

Change-Id: I0612833321f6d2b50826588e775cfa12e1db28e4
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-19 11:17:36 +00:00
hjk
089b50f7d3 Debugger: Fix display of upper half of short unsigned ints
Change-Id: Ie15c66c02c15420436b26c65af3cee9a19634e5c
Fixes: QTCREATORBUG-21038
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-02 10:12:33 +00:00
hjk
c3433519a6 Debugger: Add an explicit QObjectConnectionList dumper
Mostly for sanity reasons when debugging the QObject dumper itself.

Change-Id: I7d6267625f091788e73b0b28695e9b99e33ab3e3
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-09-17 08:53:43 +00:00
Eike Ziller
9f60cdcdaa Merge remote-tracking branch 'origin/4.7'
Change-Id: I15962a85b0cc37c5a00e15ef7eac0445aad6c295
2018-08-20 09:05:18 +02:00
Orgad Shaneh
98b6fd26bf Dumper: Fix enum display in nested types
When used in SubItem, enums were displayed as
"value of type E at address <addr>".

Change-Id: Ieecfb791126c6f63f272817afc6c8d05f28b9242
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-16 06:42:21 +00:00
Michael Weghorn
ec5e70eeda Make pretty-printing GDB's LazyString work
Qt Creator failed to properly display GDB's LazyString.

The problem was that GDB's 'PlainDumper::__call__' passed a 'gdb.Type',
while 'DumperBase::putCharArrayHelper' called methods that are only
defined for the custom and more abstract 'Type' type defined in 'dumper.py'.

As described at [1], GDB's 'LazyString.type' "holds the type that is
represented by the lazy string’s type. For a lazy string this is a pointer
or array type. To resolve this to the lazy string’s character type,
use the type’s target method."

In addition, 'gdb.Type' does not have a 'size()' method, just a 'sizeof'
member, s. [2].

Since all other uses of 'DumperBase::putCharArrayHelper' are passed
a "proper" type, extract the code common to the GDB case and all others
into a separate method and directly call this one for the GDB LazyString
case.

[1] https://sourceware.org/gdb/onlinedocs/gdb/Lazy-Strings-In-Python.html#Lazy-Strings-In-Python
[2] https://sourceware.org/gdb/onlinedocs/gdb/Types-In-Python.html#Types-In-Python

Task-number: QTCREATORBUG-20939
Change-Id: I16608668c9403b6d8e509dab17eb1788586f453e
Reviewed-by: hjk <hjk@qt.io>
2018-08-15 19:23:52 +00:00
Eike Ziller
428fcb476b Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/libs/utils/settingsaccessor.cpp
	src/plugins/autotest/autotestplugin.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.h

Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
2018-04-13 10:54:42 +02:00
Orgad Shaneh
28fa43e45b Dumper: Return correct address on extractPointer for arrays
Change-Id: I8e25cca4553a8b69703ac0ffa80231f97cdef980
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-03 06:47:32 +00:00
hjk
a8a23110bf Debugger: Fix enum dumper
Make the hex display work with LLDB, fix GDB and LLDB test.

Change-Id: I529b5cdc908dbcba7270bc4574fa59a012fcacad
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-22 08:45:57 +00:00
hjk
80f98a7fb9 Debugger: Make QList as movable
Apparently changed in qtbase dafa3618d23.

Task-number: QTCREATORBUG-19812
Change-Id: I70f543c71cc2147cbd5ab33a070e1a35049f46a8
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-20 07:13:12 +00:00
Christian Stenger
b0cbed9a17 Dumper: Do not use enumHexDisplay unconditionally
This function is available only for GDB. When using CDB or LLDB
this ends up in an exception.

Change-Id: Ie1835c1b95cac99e3f996077f6a3d80b5591c145
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-11-27 12:48:26 +00:00
David Schulz
e6b7d35bb0 Debugger: Fix enum dumper for cdb and lldb
Change-Id: Ieea120c00553ebe88c2daca0756a1eadba5991a3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-07 14:55:13 +00:00
Eike Ziller
3d9cf954e2 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	src/plugins/debugger/debuggerdialogs.cpp
	src/plugins/debugger/gdb/remotegdbserveradapter.cpp

Change-Id: I1ae77869887a8d9ef2a33439f2733315db9e0cf0
2017-09-19 12:10:26 +02:00
Orgad Shaneh
2760b9fc67 Dumper: Dump CHAR/WCHAR arrays as strings
Change-Id: I78bdb181e27cc858356c9026fc960135b54cdcbb
Reviewed-by: hjk <hjk@qt.io>
2017-09-18 11:43:51 +00:00
hjk
8cb944f4ff Debugger: Display summaries for CoreFoundation types
Uses lldb's GetSummary() method to display values for CoreFoundation
string-like variables.

Task-number: QTCREATORBUG-18638
Change-Id: Icca6d9cf7b328c80b44eebe597259f38aba1c3ef
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-08-21 10:35:06 +00:00
Eike Ziller
1feb5c604d Merge remote-tracking branch 'origin/4.4'
Change-Id: I02e54f45d233b89ddaee9c87da9b9af2a56374b8
2017-07-21 10:08:05 +02:00
hjk
1d682f2144 Debugger: Don't hard-fail on missing Python json module
Only needed for native combined debugging.

Task-number: QTCREATORBUG-18577
Change-Id: I7c5d877b9601e77ab8de251305db829a07675f8d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-20 11:23:32 +00:00
Thiago Macieira
d6b6a88753 Debugger: print QFlags and bitfields as hex
It's a lot more useful to see in Qt Creator:
  QAbstractFileEngine::FlagsMask (0xff00000)

Than
  QAbstractFileEngine::FlagsMask (267386880)

Change-Id: I8d96dea9955d4c749b99fffd14cd690574b433e5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-07-11 23:57:19 +00:00
Christian Stenger
2cacf24b18 Dumper: Fix exception when accessing empty items
This also fixes accessing 'this' when located inside a
different thread.

Task-number: QTCREATORBUG-18466
Change-Id: Ib90cc23c65c033a234d3f7cf9b1ba76abff719e2
Reviewed-by: hjk <hjk@qt.io>
2017-07-07 09:38:10 +00:00
Orgad Shaneh
25f5710df2 Dumper: Use correct integer value for enums
In case of an enum bitfield

Change-Id: I1e7756d5dffb4d81030795c495f2474a77c50452
Reviewed-by: hjk <hjk@qt.io>
2017-06-20 16:26:57 +00:00
hjk
b129cebccc Debugger: Fix manual splitting of complex template parameter types
Parsing has to stop at the first < (coming from the end).
foo::span<int>::bar<double> has a parameter 'double', not 'intdouble'.

Change-Id: Ied142d5e75a7587d6c0efd3b51608b199b999e93
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-19 09:24:38 +00:00
Orgad Shaneh
3eb36b556f Dumper: Add bitfield value in debugging message
Change-Id: I353e85b5b6999f85e93eed18ac0cf414c1c46066
Reviewed-by: hjk <hjk@qt.io>
2017-06-13 05:53:27 +00:00
Orgad Shaneh
a9145e67ba Debugger: Prettify values for enum bitfields
Change-Id: I55329bba1864c9ebbbcb3b3bf1b940346507f8cd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-12 10:40:46 +00:00
Orgad Shaneh
89057b552b Merge remote-tracking branch 'origin/4.3'
Change-Id: I56004e3ec9dc9d92d33bdae438c4f7e069eccc45
2017-06-02 15:13:51 +03:00
Orgad Shaneh
37b415379d Dumper: Introduce Value.__sub__
Change-Id: I27bf57e614630ac7b5bedb7f07e487676443f513
Reviewed-by: hjk <hjk@qt.io>
2017-05-29 10:37:37 +00:00
Orgad Shaneh
8430da3bf7 Merge remote-tracking branch 'origin/4.3' into master
Change-Id: I01ab8c85ea3372b6dce4142ddb9cf92d903ffca6
2017-05-23 23:41:40 +03:00
Tor Arne Vestbø
5bc796094a Allow custom handling of python Dumper warnings/exceptions
Change-Id: I04108a09c317675d597bb6d0d58331c70ce02fb9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-16 12:38:16 +00:00
hjk
99ac955664 Debugger: Fix display of pointers as arrays
Task-number: QTCREATORBUG-18204
Task-number: QTCREATORBUG-17803
Change-Id: I4efe359c206b53ef773127cf29107d3cce720819
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-16 11:55:58 +00:00
Eike Ziller
64b19af7dd Merge remote-tracking branch 'origin/4.3'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: I6d89ea588de955f5d878500b59285d3adde6c77d
2017-05-15 15:31:55 +02:00
Orgad Shaneh
f603a115d0 Dumper: Put object address for pointer also when it is not dereferenced
int main()
{
    int foo = 42;
    void *bar = &foo; // bar has no object address
    return 0;
}

Change-Id: I917c2976bd618c096bfd704abff8b3538e38a0d3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-12 08:04:21 +00:00
Eike Ziller
6e8ee7479e Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/plugins/debugger/cdb/cdbengine.cpp

Change-Id: Ib9aeccc4162c43e9ee3d85847d96678045625dd0
2017-05-09 15:07:30 +02:00
Orgad Shaneh
11dd4ab75c Debugger: Fix swapped object/original addresses
Task-number: QTCREATORBUG-17938
Change-Id: I71773893c2dde784c5d3f4c63e7efbbdad13916c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-09 08:28:12 +00:00
Orgad Shaneh
279192f17a Dumpers: Fix operator + for pointers
Add an extensive unit test to prevent future regression.

Change-Id: I38b74f9b4f5893285e9afff2ddecaaad106f4114
Reviewed-by: hjk <hjk@qt.io>
2017-05-08 06:58:48 +00:00
Eike Ziller
105b69836c Merge remote-tracking branch 'origin/4.3'
Conflicts:
	tests/auto/debugger/tst_dumpers.cpp

Change-Id: Id8b53b000f94a1b5ab923db79f67bad3276d09dc
2017-05-04 10:03:50 +02:00
hjk
81d9315587 Debugger: Add a boost::variant dumper
This requires making template argument extraction a bit more robust

GCC 5.4.1 created debug info only reports the first argument for
boost::variant<int, bool>:

    #include <boost/variant/variant.hpp
    int main() { boost::variant<int, float> v = 1; return 0; }

    py print(gdb.parse_and_eval('v').type)

      -> boost::variant<int, float>

    py print(gdb.parse_and_eval('v').type.template_argument(0))

      -> int

    py print(gdb.parse_and_eval('v').type.template_argument(1))

       -> Traceback (most recent call last):
          File \"<string>\", line 1, in <module>
          RuntimeError: No argument 1 in template.
          Error while executing Python code.

Change-Id: Iedca8b073078c93449ab61bb2cab05d6cd9803ba
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-26 09:23:18 +00:00
hjk
c5d37af0e0 Debugger: Some support for 'long double'
Task-number: QTCREATORBUG-18023
Change-Id: I06783541668b95711cb5a45bf689c43b348ff624
Reviewed-by: hjk <hjk@qt.io>
2017-04-25 15:00:59 +00:00
hjk
5784a96596 Debugger: Extract printing of dereferenced pointers into method
It's used twice, always for 'this', and whenever asked for by the
user's 'Dereference Pointers Automatically' choice, but needs to
be done at different times.

Change-Id: I4dc7340d0a4cb3eb0c7ff17d59e39be0e3870aa0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-25 10:24:50 +00:00
hjk
53ff0e1ca1 Debugger: Add a workaround for bad gcc debug info generation
Gcc does not write out full type names with 'using template ...', see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80466

This is in most cases harmless for Creator as dumpers are triggered
independently of template arguments. However, if the dumper takes
different code path based on the template argument type, as is
e.g. needed for std::vector<bool>, wrong results are produced,
as the type cache only used the template base name as type id.

Work around by mangling the id of the un-typedef-ed type into
the type id of a typedef, which, in case of templates contain
the full parameter list.

Change-Id: I63c59cccdc186b09ff780e9dfd57b0ad668ae98f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-20 09:15:59 +00:00
David Schulz
c00bb1dcfb Debugger: Pass uninitialized variables to the python dumpers
Reduces accessing uninitialized memory

Change-Id: I025e9070b9b17a806237619b484cb27230e7f494
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-10 07:03:23 +00:00
hjk
79c3c4e5e5 Debugger: Remove unused Dumper.Type.field function
Change-Id: Ib7b1576d2b71b0e5f1648b51a4298b44581b1c2e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-05 05:45:31 +00:00
David Schulz
16b3235003 Debugger: Catch memory read exceptions in getJumpAddress
Throwing an exception in these cases is not uncommon and should
be handled properly.

Change-Id: I8d4377bf26a4e31971da724904dd5ea5f01a95e1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-04 08:23:30 +00:00
David Schulz
86edeb9722 Debugger: Use native value for pointer dereference
Change-Id: Ibde6ff382e7adc0c196837c9eba04391c0a2c3a0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-28 09:22:28 +00:00
Orgad Shaneh
91e9ba7ede Dumper: Remove unused function
Change-Id: Ibc8cf420170b084c05fdaf1d6a7b26594bcb3f24
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-21 14:57:29 +00:00