Commit Graph

1030 Commits

Author SHA1 Message Date
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
Alexandru Croitor
f612833d83 Debugger: Pretty print the name of a function when using lldb
This is achieved by calling "po" on an address value casted to a
simple function pointer type, regardless of the actual type of
the function pointer. lldb does not complain, and reports the
library where the function is defined, its name, and location
in the source code if available.

Change-Id: I23ccce62e33bcf213ccdcb55c9836d54333f3c86
Reviewed-by: hjk <hjk@qt.io>
2018-10-15 15:39:16 +00:00
hjk
cd3011520f Debugger: Fix qfloat16 dumper for LLDB 6.0 on Linux
Needs some hint that floats are involved.

Change-Id: Ie6871ce3b6bb7aaff27e6c763a6002a6d0a90d70
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-12 11:24:46 +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
ada0e43c93 Debugger: Fix use of external debug info for installer-based Qt
On Linux. Required installs are the gcc-built Qt libraries themselves,
the "Sources" and "Qt Debug Information Files" components.

Fixes: QTCREATORBUG-20693
Change-Id: I920efd641ce3ee4583741ea1db0bea18031adc51
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-24 13:37:24 +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
hjk
4cb0b3fa73 Debugger: Make enum class dumper test pass again for gdb
Change-Id: Iaded82ab13f30e7222eb14f548ac72d1c6502b7d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-06 13:41:51 +00:00
hjk
8de44d9281 Debugger: Make std::once dumper test pass again on Linux
Change-Id: I46ad9bb8ed3beb4aac23f5b3cca69f3ef0c92971
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-06 13:35:08 +00:00
Michael Weghorn
1ae96a9090 Debugger: Fix display of children in GDB's PlainDumper
The 'putSubItem' method expects an object of the
Value class as defined in 'dumper.py'.
Therefore, create such an object for the gdb.Value
when passing it into the method.

Task-number: QTCREATORBUG-21000
Change-Id: I5277f832ee2aae808824f3dcf728fdaa0e2a3c78
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-05 05:41:55 +00:00
Michael Weghorn
34840e8088 Improve displayed type for GDB's PlainDumper
Use the name attribute of the gdb.Type rather
than that of the pretty printer.

This e.g. displays 'std::vector<int>' rather than
just 'std::vector' for an int vector.

Change-Id: I53da01bb5ba67bcd8d7113beda6ff03e708d60f9
Reviewed-by: hjk <hjk@qt.io>
2018-08-30 12:39:05 +00:00
Orgad Shaneh
9ed36db854 Dumpers: Add a dumper for QPointer
It has an internal QWeakPointer<QObject>, which is not helpful. Cast to the
QPointer's template argument instead.

Change-Id: I9308c5eb9ea3867a682c4e4cba5d8041547981d1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-08-20 12:47:17 +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
db9837fa6c Merge remote-tracking branch 'origin/4.7'
Conflicts:
	src/plugins/clangtools/clangtoolruncontrol.cpp
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: Ib1e8abf066898b50c90fc1ccba4697fe983e8a8f
2018-08-15 13:53:28 +02:00
Christian Stenger
49a498c0a6 Debugger: Fix accessing member function
Amends 975f5886a6.

Change-Id: I0e8f5a9ab0ccf76fc095e0e05bfbdb838a7583d3
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-09 12:56:26 +00:00
David Schulz
975f5886a6 Debugger: fix cdb enum dumper
Change-Id: Iac407d98afd8f024a45d0f6550c8b3c00df0a515
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-09 08:30:37 +00:00
hjk
27cd7162e1 Debugger: Make LLDB instruction-wise stepping work with 3.8.1
Judging from the code it either never worked, or LLDB changed
syntax at some time. In either case, having it in a usable
state with current version is an improvement.

Change-Id: I88b15969bf28b92735d860544dedcbd1d9689765
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-07-24 12:45:01 +00:00
hjk
e2144db165 Debugger: Pass native gdb.Value to native gdb pretty printers
Task-number: QTCREATORBUG-20770
Change-Id: I6ea92faf0c9314c50da05356fa9004f87124111a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-17 09:10:03 +00:00
Christian Stenger
a7fba990f4 Debugger: Fix Qt namespace detection for gdb8
Task-number: QTCREATORBUG-19620
Change-Id: Ieb7a8bc8cfeb8ba4331436ef6652437c0971c356
Reviewed-by: hjk <hjk@qt.io>
2018-07-06 10:10:05 +00:00
Christian Stenger
65a4333f2c Dumper: Fix detection of Qt namespace
Task-number: QTCREATORBUG-19620
Change-Id: Icca654714b70c69522b51998be21cff80bc29fac
Reviewed-by: hjk <hjk@qt.io>
2018-07-02 10:17:48 +00:00
Christian Stenger
8b4dbfb8e1 Debugger: Fix member offsets in QFile
Change-Id: I8d806aabcf2c744165553f087831ce899db24d80
Reviewed-by: hjk <hjk@qt.io>
2018-05-22 08:16:07 +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
hjk
870a5c581a Debugger: Make libcxx's std::vector plottable
Task-number: QTCREATORBUG-20249
Change-Id: Idc17fcbda34273b4f29f0da0b01eddcd4f83c52d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-12 06:28:48 +00: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
d66e8b6ea0 Debugger: Remove some spurious '.report' content from dumper output
No real damage, the parser on the Creator side is apparently robust
enough. Still no need to add this.

Change-Id: I8329a55c44f866070fb3df48c3a22000ee33e848
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-23 13:03:35 +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
42e224eb4b Debugger: Fix attaching to core for LLDB
Task-number: QTCREATORBUG-18722
Change-Id: I4579fff9725f4a7578642080a010ca54b221969b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-02-08 06:05:16 +00:00
David Schulz
6c507beb1e Debugger: add dumper for Kit and ToolChain
Change-Id: I48b5f686aa268a554922b495b416724ddc8973f2
Reviewed-by: hjk <hjk@qt.io>
2018-02-02 14:39:27 +00:00
hjk
58f457f405 Debugger: Also extract Qt namespaces for libinfixed Qt build
GDB-only for now.

Task-number: QTCREATORBUG-19620
Change-Id: I2ca3a927623ec0df742fed65048e8a3bcfa5cee2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-22 13:59:42 +00:00
hjk
0cce7a82fe Debugger: Add some simple dumper for std::function
Linux/gdb only, pretty print the cases of default constructed objects
and real function pointers.

Task-number: QTCREATORBUG-19410
Change-Id: I08332af649bda861d9f53c0e0feb1f37db72b875
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-05 07:20:26 +00:00
Oswald Buddenhagen
777ca8e655 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp

Change-Id: I94647f59d7a9df48168ac066555afe80f5f9b91f
2017-12-21 13:20:24 +01:00
David Schulz
b2052561cc Debugger: improve evaluate expression with cdb
Replace Evaluate with AddSymbol and create a PyValue representing
that expression

Change-Id: Ibb8ab70c41df81e9d7d683b633a070caa03036d3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-20 09:32:18 +00:00
hjk
79ba461a46 Debugger: Suppress variables from unrelated scopes
Change-Id: Ib7ae6c2af37a2cdb7dfd63d0622e68b55f7a778d
Task-number: QTCREATORBUG-19445
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-14 13:40:08 +00:00
hjk
83c13ff191 Debugger: Combine the InferiorShutdown{Ok,Failed} states
... into a InferiorShutdownFinished.

Change-Id: Icb5394f38f52f7cf300dc83f4eb8f2f0777bbcba
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-14 11:26:52 +00:00
hjk
585b2c62d5 Debugger: Combine the EngineShutdown{Ok,Failed} states
... into a EngineShutdownFinished. They were never handled differently,
and the only option is to proceed to DebuggerFinished anyway. So
simplify the state machine a bit.

Change-Id: Ied3be86fff6750abca578dc6788e4be1d895692b
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-14 09:42:44 +00:00
Christian Stenger
1d2049bffc Dumper: Fix typo
Change-Id: I2d7bbe88c4d1552dba505003020c86a406821f72
Reviewed-by: hjk <hjk@qt.io>
2017-12-13 05:43:35 +00:00
Eike Ziller
e2baa116ca Merge remote-tracking branch 'origin/4.5'
Change-Id: I86852d289c22210a0439e8e297819dc7276a96de
2017-11-29 09:56:22 +01: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
Eike Ziller
b05637131c Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp

Change-Id: I726babe61e28db14d06a6a1a5c570e148745b458
2017-11-09 14:32:00 +01: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
Orgad Shaneh
a6cda6dbe0 Merge remote-tracking branch 'origin/4.5'
Change-Id: I16e3bb9ee3a1e6dc6edf7a65f8a137a25cda4fe3
2017-11-05 16:49:17 +02:00
Tor Arne Vestbø
357caf3b44 Allow LLDB pretty printer to skip resolving type across all modules
The lookup is quite slow, and will hang the lldb debugger,
causing Xcode to hang too.

Change-Id: Ic6579a5de9404c0040d3d304169f18109f61d2ac
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-03 13:40:16 +00:00
Orgad Shaneh
d6ff82a244 Dumpers: Fix CPlusPlus::IntegerType dumper
Change-Id: Ia21caf874f927428c27f6ad21da031b3a32146ea
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-02 14:04:44 +00:00
hjk
58c329cd03 Debugger: Re-introduce namespace detection for Qt 4
It's apparently still in use.

Change-Id: I89d04c6b3afff8014334e3543c3f3b77bf52d130
Task-number: QTCREATORBUG-19135
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-23 09:51:45 +00:00
hjk
5b2a46e3a0 Debugger: Fix typo in namespace extraction debugging code
Change-Id: I24e70a25105b9fbef625ca633ebdf715749f10f3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-23 07:23:51 +00:00
Eike Ziller
cfdea6b9c2 Merge remote-tracking branch 'origin/4.4'
Change-Id: I7bf72444b19db20fcc7dc2c9d1f02ec2b30b658f
2017-09-25 11:00:25 +02:00
Filipe Azevedo
846d89811a Fix unstoppable debugger
For some reason sometimes a user stop request with lldb can trigger
a spontaneous stop, avoiding the debugger to stop correctly.
This change fix the issue by emitting the correct states from
lldbbridge.py.

Change-Id: Ib8a2f4875824f4fff426b2d5e0fc4a79ce48c68e
Reviewed-by: hjk <hjk@qt.io>
2017-09-20 09:49:53 +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