Commit Graph

1050 Commits

Author SHA1 Message Date
hjk
2a67a86c2f Debugger: Add fallback when gdb.Value.cast() fails for typedefs
Fixes: QTCREATORBUG-18450
Change-Id: I9239beb7e1879a284e28a30579129fe487eb2dd2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-12-17 13:21:02 +00:00
David Schulz
18bee3a08f Debuger: Fix enum dumper (again)
Fixes: QTCREATORBUG-21726
Change-Id: I25f4a84d88a915247456ac8e12877d503ae0d49a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-12-17 12:55:18 +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
hjk
d4e79230d8 Debugger: Make LLDB startup failures more verbose
Fixes: QTCREATORBUG-19612
Change-Id: I7c8ebe3ec734265c8df8a684ccd6bb8991ea8390
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-12-11 12:08:06 +00:00
Orgad Shaneh
4cb4b7ba99 GDB: Fix address resolving for typedefed types
Reported upstream: https://sourceware.org/bugzilla/show_bug.cgi?id=23936

Fixes: QTCREATORBUG-21602
Change-Id: I0592679a6b5c4821175ef8e97e2206e0ac0be44d
Reviewed-by: hjk <hjk@qt.io>
2018-12-10 13:40:41 +00:00
Alexandru Croitor
18c6048099 Debugger: Fix thread switching when using lldb on macOS
The SetSelectedThreadByID method expects an integer, and not
a string.

Fixes: QTCREATORBUG-21563
Change-Id: Ibd5538a3214b73d7e87e66b59d6b9af0b93effeb
Reviewed-by: hjk <hjk@qt.io>
2018-11-27 11:00:40 +00:00
hjk
afe5699f8d Debugger: Show module in stack frames also for LLDB
Change-Id: I2b20b83bedf98a1b0eb17519fb4bec536e48dbaf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-22 13:25:24 +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
deef478b38 Dumper: Fix activating frame for lldb
...when being attached to core file.

Change-Id: I4f8364285d756bae53b4a14ca8feb74f7fdaacfb
Reviewed-by: hjk <hjk@qt.io>
2018-11-14 10:09:05 +00:00
David Schulz
12f4ff5e5b Debugger: Fix Qt version detection in the cdbbridge
broken by b2052561cc

Fixes: QTCREATORBUG-21446
Change-Id: I303bb943a3b39703a6c5898aab99b89d35d1d2d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-12 14:09:52 +00:00
hjk
402991498f Debugger: Fix assignment to QString etc with LLDB
Task-number: QTCREATORBUG-21353
Change-Id: Ie3655738c249240d9fbf17e054fc8f79a284efd4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-12 12:31:46 +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
hjk
3ca343dd90 Debugger: Remove some dead code in lldbbridge.py
Change-Id: I368252f7ca83f66962f9c1d0e1726a77320fc886
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2018-11-09 12:30:53 +00:00
Alexandru Croitor
e74366bbea [Debugger] Add dumpers for QEvent and QKeyEvent
QEvent dumper will now show an additional [type] field with the enum
name representing the event type (aka the value of QEvent::type()).
For example: 'QEvent::KeyPress (0x0006)'.

QKeyEvent dumper will now show a value similar to:
"Pressed 'F' (key:70 vKey:3 mods:Shift)" as the initial non-expanded
value.
A new additional field called [Qt::Key] will show the enum value
of the key pressed, for example: Qt::Key_F (0x0046)

Change-Id: Id91431d0e3d3adeb89d6b74ea341a335ff37efdc
Reviewed-by: hjk <hjk@qt.io>
2018-11-08 15:28:37 +00:00
Alexandru Croitor
de32a631c3 [Debugger] Fix bitfield values to show up correctly using lldbengine
The bitpos value returned by lldb is the bit offset relative to the
beginning of the type, there is no need to do an extra modulus
operation.

Adjust dumper test to add the previously failing case.

The failing case happens when the class containing the bitfield has
more members in front of the bitfield.

Change-Id: I93678f78e6799843558ec53342a0ed49cac74f48
Reviewed-by: hjk <hjk@qt.io>
2018-11-08 15:12:10 +00:00
hjk
c016c6737b Debugger: Fix LLDB start with complex command lines
Fixes: QTCREATORBUG-21433
Change-Id: I1a248272566eac7f5fd07a8346500d245b62fbfa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-08 14:21:21 +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
hjk
2556d4b44b Debugger: Implement disabling/enabling subbreakpoints with LLDB
Change-Id: Iaad8716b98d632e5a933b7f5b26549c7cb885ea7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-06 07:37:15 +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
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