Commit Graph

272 Commits

Author SHA1 Message Date
hjk
e94c87f1a7 Debugger: More quote cosmetics
That's a follow-up to 88e79e16a6a91

Change-Id: I19725bca1c547bd961094f2d00e85e170b2be33e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-11 12:56:48 +00:00
hjk
ae4d3c52e6 Debugger: Sanitize report of timings
Use Python's list and dict output directly, instead of
a manually stringified version thereof. Also, report
milliseconds instead of microseconds.

Change-Id: Ibcbdea732e7ecc58fd672bc5da794832215865b4
Reviewed-by: hjk <hjk@qt.io>
2016-11-10 20:14:25 +00:00
hjk
5fb2dc6e47 Debugger: Some dumper code cosmetics
Mostly quotes, remove some unneeded comments, ...

Change-Id: Ie3f410ac84e6cfe48e7971af948326abc21f2554
Reviewed-by: hjk <hjk@qt.io>
2016-11-10 19:59:47 +00:00
hjk
75be7de6f4 Debugger: Make dynamic type lookup more robust
... in builds without debug information.

Change-Id: I3842736aebe5b7c6b46d0ea1eec540dc3c088920
Reviewed-by: hjk <hjk@qt.io>
2016-11-10 19:22:25 +00:00
hjk
9040c4081e Debugger: Use less GDB inferior calls in normal field extraction
They are not usable in core files.

Change-Id: I2134b61f27c27862c12a679d0acf7bebc9fcc7a2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2016-11-10 16:20:37 +00:00
hjk
6f1bd8bbdb Debugger: Consolidate name handling of anonymous structs
Change-Id: I44acfdccb5cad02c95270490e319caca334c8a4b
Reviewed-by: hjk <hjk@qt.io>
2016-11-04 21:21:26 +00:00
hjk
5276f35ae3 Debugger: Move base class numbering to generic code
Change-Id: I046a587f9fbf2a6345f3c0432a1b5937069a9304
Reviewed-by: hjk <hjk@qt.io>
2016-11-04 20:47:09 +00:00
hjk
1574f9cfca Debugger: Remove 'const' from more types again
Change-Id: I95e02a462e3b7614342e1515c96290a954d27dca
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-02 16:17:53 +00:00
hjk
8bf8b5f61f Debugger: Make dumpers work for Qt 4 again
Change-Id: I78ac75161508eb6889d1a8a5d04df2860804b907
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-02 13:01:47 +00:00
hjk
b0da1e3ce4 Debugger: Fix display of vtable entries
Task-number: QTCREATORBUG-17050
Change-Id: I17fc245a8a766f3a450c0bea966aab69ca9eb5b9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-02 12:24:50 +00:00
hjk
77db31db3b Debugger: Use native field accessors again
This is a partial revert of the type id change (bd2653fb) to get
the case of virtual bases work again, as it falls back to native
field accesses everywhere we have native types.

This is likely to be a performance regression with CDB/Python,
but since this combination is experimental and not used by
default in 4.2 getting GDB/LLDB right is more important.

Medium term we might want to have a more fine-grained approach
to use of type ids (e.g. use native field accesses on a case-by
-case base only for type with virtual inheritance)

Change-Id: I239111e6ce5f3365b750068bfc4dafb12be1d53c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-02 10:36:06 +00:00
hjk
bd2653fbaa Debugger: Introduce and use type ids instead of type in dumpers
Change-Id: I569d13d4f5d66cf1606b2b5d047b415659de539b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-10-28 08:11:38 +00:00
hjk
cb7fb51313 Debugger: Fix QML extra stack loading for GDB
Change-Id: I702bb8f183e93fe25857115225fa55607ffb1674
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-10-12 07:04:56 +00:00
hjk
6b2665a180 Debugger: Consolidate dumper state setting
Move all the currentFoo initialization to DumperBase

Change-Id: I0a59715fe1550f466e78cbf678622dd8dfe1783c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-10-07 13:04:30 +00:00
David Schulz
a83d539551 Cdb: Introduce interface for python dumpers
Change-Id: I0ef2fd8a44232d65b0d772fd6c65230266d586a8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-10-07 06:40:20 +00:00
hjk
6913f90384 Debugger: Ditch Dumper.stripClassTag
It doesn't seem to be needed anymore, and if it were, it'd be the
task of the back-end specific fromNativeType() functions to sanitize
type names.

Change-Id: I7c6af40aeacb2dbaaf73143e9fdcc1d866bf3f3d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-10-04 12:53:52 +00:00
hjk
418d56b917 Debugger: Robustify nativeDynamicTypeName in gdbbridge
Determining dynamic type is a best-effort business that
tends to fail in setups without debug information.

Change-Id: Id24fc70ac15cf2957ed1c91d5782b8a7c0677bf2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-29 05:53:26 +00:00
hjk
412d7b2255 Debugger: Consolidate special type lookups in *bridge.py
Change-Id: If5f255a32f1cfde925345f4a33e6fa4de01d10d2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-28 11:37:30 +00:00
hjk
cce9159c3a Debugger: Remove now unused gdbbridge.py readCString()
Change-Id: Icbde42b9a8251550fc30eb0d24a6c812edd85431
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-28 11:37:22 +00:00
hjk
c5ee2737b1 Debugger: Unify *Dumper.childRange()
Change-Id: I58cc225efeeabe6b97cb0228b89fb4ac127ce6c9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-28 10:40:37 +00:00
hjk
27f473ab00 Debugger: Unify the dumper reload code
Instead, push backend differences into a more generic reportResult()
function.

Change-Id: I6bc34580e915b830e592680022b3499ae5eb1e57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-28 10:40:27 +00:00
hjk
5efa84830b Debugger: Remove use of native values in dumper.py
Lowers the barrier for other debugger backends.

Change-Id: I09e0ad09548b6b4220175245cc0d845ac5aa29d0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-09-26 14:07:00 +00:00
hjk
c7305abf26 Debugger: Simplify qtHookData access in dumper
Change-Id: I14b7ecb5fbe1e6b2a2c587aa7dcb5ef18e3cb9f3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-26 09:14:06 +00:00
hjk
4d47a68425 Debugger: Fix native type field lookups for typedefed structures
Change-Id: Ibd120ce43771c35b23b51bfc598ee5f32ee7af75
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-21 13:05:56 +00:00
hjk
6ac8a445e5 Debugger: Remove some now-unused code
Change-Id: I389b827030ab241ecc0b1875d9743faac517bd49
Reviewed-by: hjk <hjk@qt.io>
2016-09-21 10:15:15 +00:00
hjk
b4251d6d24 Debugger: Consolidate code to enumerate shadowed variables
... in {ll,g}dbbridge.py and fix expansion of shadowed items.

Change-Id: Ide0c426416f2df85470fe851f265cf4835395680
Reviewed-by: hjk <hjk@qt.io>
2016-09-21 10:13:12 +00:00
hjk
e2c45012d6 Debugger: Streamline type code handling
GDB and LLDB share some ideas but are not identical. Map them
both to what we need in the end. This also reduces the size
of the Type class interface as a step towards more type info
caching.

Change-Id: I43e60c4e5736ac15a5c776832ffb8e6939f45e45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-20 09:22:34 +00:00
hjk
f1a85e1441 Debugger: Reduce reliance on implicit conversions
Easier maintenance if code is typesafe. Whatever that means in Python.

Change-Id: I450e5d42bcfdb30d607dd878353d037ba18fe6d9
Reviewed-by: hjk <hjk@qt.io>
2016-09-19 07:34:47 +00:00
hjk
080d2dad65 Debugger: Show enum symbolic names also with GDB 7.4
gdb.Type.name is not available there, but str() works.

Change-Id: I61c3018e728e634509d4028f624dc1213c62a290
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-16 12:44:23 +00:00
hjk
1a9919a208 Debugger: Reduce number of function calls in QLocale display
Change-Id: Ib186dafbee148b9c4aaf69124a3642404e16c002
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-16 11:22:17 +00:00
hjk
0761f32938 Debugger: Remove indexing by array index in dumpers
Parents know what to do nowadays.

Change-Id: I28c6e8577ef478f9c94b0793704536b5c6c6e036
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-16 06:52:03 +00:00
hjk
e1ff0a1823 Debugger: Remove last traces of Dumper.is32bit()
Change-Id: Icb3b3bd472361816965b60b9f3cd0771aa4b99fe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-14 12:59:30 +00:00
hjk
2244e2b26c Debugger: Use direct memory instead of member access
This introduces a dumper types abstraction layer with classes
Dumper.{Value,Type,Field} wrapping either gdb.{Value,Type,Field}
or lldb.{SBValue,SBType,SBField} and uses it to move
to more direct memory accesses in the dumper implementation.

This way we can use duck typing for artificial intermediate
objects eliminating the need for {gdb.Value,lldb.SBValue}.cast()
in some case which are flaky in general and typically not
available in release builds.

As consequence QRegion and QVariant dumper work without debug
info now.

Change-Id: Iea2411175ef67f2bf651ee7eaade9879ed5ceba1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-14 12:38:45 +00:00
hjk
00a8573502 Debugger: Fix use of GDB's own pretty printers
... with newer versions of GDB.

Looks like their internal behavior changed (again...)

Task-number: QTCREATORBUG-16758
Change-Id: Ic3a092091bac73df92a3a9f33ab863e4b6ece9b4
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-08-26 19:30:12 +00:00
Oswald Buddenhagen
034cff4693 Merge remote-tracking branch 'origin/4.0' into 4.1
Change-Id: I71d3064a5f65ec658a7ecf248bdce0a3aeea89f4
2016-07-27 12:45:54 +02:00
hjk
539e33da02 Debugger: Improve QObject related dumpers in release builds
Make QMeta* dumper work without debug info.
Show QObject parent and children list in this case.

QObject properties are not visible, and neither actual type
of QObject children.

Change-Id: I05417a7d78084234403a964f683db6867b6686f0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-22 08:22:03 +00:00
hjk
26fa769bab Debugger: Add dumper for QMeta{Enum,Method,Property}
Task-number: QTCREATORBUG-16593
Change-Id: Iaa710660d8ef69459596f93831cf8467913f0468
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2016-07-15 10:44:03 +00:00
Oswald Buddenhagen
69c8b9271c fix qt namespace retrieval when an early break happened
the logic to retrigger the namespace retrieval was broken, so if it was
triggered for some reason before qt was "sufficiently available", the
bad/failed guess would persist.

Change-Id: I90e02247142814bdc3f6d5cddfc0c2fe37665a3e
Done-with: hjk
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-07-05 14:58:52 +00:00
hjk
b198d482cf Debugger: Robustify Qt version extraction
Task-number: QTCREATORBUG-15497
Change-Id: I61b52d23e0acf69e2030f8dca2691fbaa6b309ca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-07 05:33:13 +00:00
hjk
e108d6fe48 Debugger: Fix transport of negative signed chars
Change-Id: I9b25d4b8e4b68d9cef674581d1a42eb75e21ec56
Task-number: QTCREATORBUG-16353
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-05-31 12:12:33 +00:00
hjk
98214c5a0f Debugger: Robustify disabling of system pretty printers
There seems to be systems producing non-ASCII error messages when
running this in directories with non-ASCII characters. Since we
won't be able to workaround, silence the error to not disturb
further operation.

Change-Id: I527ce10c062273d2f4928f2a8fab79b704de067b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-24 11:50:45 +00:00
hjk
e73a9c1b0d Debugger: Always sort local variables alphabetically.
It was there for GDB at a time, but never for the other backends.
Fix the GDB regression and make the sorting consistent across
backends.

Task-number: QTCREATORBUG-15296
Change-Id: If728c65f0c8ca4a8378c7cf5e53f1dadbfb72b29
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-11 09:35:07 +00:00
hjk
e9b1e493c2 Debugger: Move struct sorting logic to generic parser
Backends only have to specify whether an object members are sortable
in principle (e.g. all structs), and some numeric 'sortgroup' value
for member items (higher values are always sorted on top).

Change-Id: I10ce94580374fed48a35f058a575a1408d6801af
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-08 10:22:31 +00:00
hjk
c371166904 Debugger: Fix import of system GDB pretty printer
Task-number: QTCREATORBUG-15923
Change-Id: I9b8d343f39dd34c33eff05c369bbceb7a581c995
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-23 08:56:43 +00:00
Tobias Hunger
54d64971d8 Update License according to aggrement with Free Qt Foundation
* Update license of files loaded in debugger
* Make sure all files have a license header

Change-Id: I612885652bcae0a4b7a88ae5184ef661aee25006
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-01-18 10:41:20 +00:00
hjk
3c37941829 Debugger: Make accessing value of invalid pointers more robust
LLDB on Linux did not like a plain toInteger() in some cases.

Change-Id: I4fb640df52218a3df04f3ce5092eb5fbc8b5acd5
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-06 12:00:53 +00:00
hjk
7de7eb6bca Debugger: Work on WatchModel performance
Don't instantiate repeating boilerplate item data in some
cases (such as large arrays).

This makes it necessary to access parent WatchItems in
a lot more cases than before and needs another separation of
WatchItem/WatchModel code to keep the dumper autotests
in a functional state.

For a plain std::vector<int> with 1 mio items this reduces
 extraction time from more than 2 minutes to about 3 seconds.

Change-Id: I175c5f6ee90434a6e85342d8bb71bd10a04dd271
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-01-06 09:59:11 +00:00
hjk
c2bf384ac2 Debugger: Split DebuggerEncoding enum
... into a string specifying a kind of encoding (utf8, latin1),
an optional bytesize (2-byte integers, 4-byte integers) and a
flag whether the displayed value should get "..." around it.

Scales better than adding an enum value for each new combination.

Change-Id: Iffcb1e2f148f12da96e165559a976bd34026c649
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-12-21 07:32:14 +00:00
hjk
6a71c63186 Debugger: Make display of QObject names optional
... and switch it off by default. The feature has indeterministic
performance impact and lost quite a bit of its utility since GDB
learned to extract dynamic object types most of the times.

Change-Id: I22cccb03ba67f9ff6ad757bbc06eb372d84bbffe
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-12-17 14:58:23 +00:00
hjk
2714a7e981 Debugger: Remove spurious quotes in gdbbridge.py output
Breaks the parsing and might trigger an endless loop.

Task-number: QTCREATORBUG-15352
Change-Id: I832d26441d8be3339b4de6d59a33c97f1d7124c5
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-12-07 08:17:01 +00:00