Commit Graph

210 Commits

Author SHA1 Message Date
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
David Fries
ac8626aa78 avoid None.replace in fromNativePath
This is with gdb 7.4.1 linked with python 2.7.3

Change-Id: Idf921afd37d72056874c7179c899f62f791f9282
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-12-03 15:31:43 +00:00
hjk
9d6c63d4d2 Debugger: Move the 'break on qFatal' implementation to gdbbridge
Easier to create invisible breakpoints there.

Task-number: QTCREATORBUG-15276
Change-Id: I76ffa45f9f0de5ffbc3b82a7ef9a4ddcdfff62eb
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-05 09:42:03 +00:00
hjk
601f6fd819 Debugger: Rename GdbEngine::{stackListFrames->fetchStack}
Same as LLDB now.

Change-Id: I8a59a977fe45e7f523eae59cbb4cd24b78ad8e7b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-02 10:19:05 +00:00
hjk
d5101b5d91 Debugger: Standardize on all-lowercase for protocol options
CamelCase might be more Qt-ish, but the backends tend to use
lowercase only.

Change-Id: I04b9b7305b54226f27b70151115050c4816f911f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-02 10:18:50 +00:00
hjk
b8ae9fd46d Debugger: Adjust native mixed debugging after upstream changes
Change-Id: I4d137fadd0de2aa346f2f49932faac4ee9ed41e7
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-19 12:40:29 +00:00
hjk
ec2e01faec Debugger: Make basic native-mixed debugging work with LLDB
Change-Id: I4d55c6a486d5adbccaa93eaa1ee461238fecfea3
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-13 06:49:00 +00:00
hjk
525c33f999 Debugger: Infrastructure for reworked native mixed debugging
- Remove old experimental native mixed approach.
- Move some common stack parsing to Stackhandler.
- Mark gdbbridge.py debug output explicitly to remove it
  from actual reponse handling

New native mixed needs QtDeclarative changes and
QTC_DEBUGGER_NATIVE_MIXED=1 for now.

Change-Id: I09eed1da51cea878636d36756015b7bfaed34203
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-09 05:19:45 +00:00
hjk
ea39476ef2 Debugger: Do not try to treat labels as variables
They produce no values later anyway and are slow to process.
With this patch, stepping in VME::run from qv4vme_moth.cpp
takes about 1s instead of more than 40s previously.

Change-Id: I5c96966612bdb7c0120d9ebb545d6e8483cbf843
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-08 14:20:59 +00:00
Eike Ziller
0ba4781bfc Merge remote-tracking branch 'origin/3.5'
Change-Id: I889b93611d1762121548fb71d1d3493e4adba313
2015-09-25 10:35:42 +02:00
hjk
f229f0dbe5 Debugger: Disable CLI use of gdbbridge.py
The detection seems to go wrong in some cases on RHEL which
are not reproducible locally.

Since the feature is not important for Qt Creator's own use,
disabling is safer than attempting to guess better.

Change-Id: I95fd56985d61b604a285e7573f8775b902bcc68c
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-09-25 07:12:30 +00:00
hjk
3ee97ef8ab Debugger: Use the usual callback mechanism for LLDB, too
... instead of the custom mechanisms to funnel breakpoint ids, cookies
and similar through individual bridge functions.

Change-Id: I2b6e906078eefdbcd4ffa166dc1881a1d0f7fb51
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-09-11 07:58:02 +00:00
hjk
1b417fd78c Debugger: Use qtHookData to extract Qt version when possible
This avoids inferior calls, i.e. is faster and more robust.

Task-number: QTCREATORBUG-14350
Change-Id: I9f21eda6e2e3950eaaca90a35afb885e76e789d8
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-13 14:03:00 +00:00