Commit Graph

196 Commits

Author SHA1 Message Date
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
hjk
d7c5ee7edd Debugger: Fix display selection of char arrays
... by re-using the logic we had for std::string already.

A plain char[] value did not react to Change Display Format,
Latin1 was used unconditionally.

Also rename putStdStringHelper to putCharArrayHelper.

Change-Id: I01fdf796ff49a4c99ead7b9b46274684e18e962b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-12 08:07:08 +00:00
Orgad Shaneh
221ab36025 Debugger: Fix expansion of anon nested types
AttributeError: 'NoneType' object has no attribute 'startswith'

Change-Id: Ieb08c33cce06ad484de856b249ab4723b01d520e
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-28 04:58:55 +00:00
hjk
d327a11030 Debugger: Sort vtable before data members
... when listing members of a struct in the Locals and
Expressions view.

Task-number: QTCREATORBUG-14767
Change-Id: I5089dd3bcba40ab335be164c5de2f2d70c3ed4f4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-07-21 14:59:44 +00:00
hjk
9130cdfc05 Debugger: Use special values for translatable strings
... when passing data from the dumpers to the GUI. This reduces
the need to guess whether a value contains a translatable string.

Change-Id: I5e2210b8d028bd71f0087a2ba5c7c5b04331b882
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-21 10:59:51 +00:00
hjk
6d8dfe03de Debugger: Move typeCache from DumperBase to (Gdb)Dumper
It's an implementation detail of the gdb side (and would not
be there if gdb.lookup_type were faster)

Change-Id: I135c32a1c9132ab771c8fab5abfd04fbb308891e
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-10 10:45:33 +00:00
hjk
c691cca48d Debugger: Always sort base classes first when showing a structure
Simply relying on '[' < any_letter is not good enough in the
presence of uppercase identifiers.

Task-number: QTCREATORBUG-14637
Change-Id: Ib0e305c0b86f3b117c07de18cde00b14f424a7c4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-07-06 08:56:11 +00:00
hjk
fdde69a5a5 Debugger: Add dumper for various QJson* classes
Needed to debug the QmlDebugger.

Change-Id: Ia0b50dac2146fcc81990b78eb8de30c8e763bba2
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-02 06:58:04 +00:00
hjk
f886c70199 Debugger: Be more robust in case of unexpected non-ASCII output
Also correct typo in function name.

Task-number: QTCREATORBUG-14629
Change-Id: I193efc3a002f83b0091f93e087f2feb19dc4f5c1
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-25 11:37:18 +00:00
hjk
60eacb7790 Debugger: Allow hex values to be passed for qmlcontext addresses
Change-Id: I327f40f872a2399befdbccf78e5b364ecaf86aee
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-15 06:38:01 +00:00
Orgad Shaneh
5fe0682fa6 Dumper: Fix exception with Python3
Occurred when I tried to expand an object that contains 2
unnamed unions (CPlusPlus::Token)

	File "gdbbridge.py", line 1113, in putItem\n    self.putFields(value)\n'
	File "gdbbridge.py", line 1150, in putFields\n    fields.sort(key = lambda field:\n'
	'TypeError: unorderable types: str() < NoneType()\n'

Change-Id: Ica38750435ae851b52d87dc6fcc59118d3f1d8ee
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-12 04:42:59 +00:00
hjk
7c8d20ded7 Debugger: Pass request to sort struct members to {gdb,lldb}bridge.py
The request will be honored when creating the values
instead of re-sorting in the frontend.

Change-Id: I0ea13bd9b0700a4d2ae4f0b355c56ddd37557398
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-11 08:40:51 +00:00
Ray Donnelly
f5dcc93b7e Debugger: Handle case of os.path.sep being '/'
On MSYS2, if QtCreator is launched from one of the msys2 shells
then the MSYSTEM env. var is set and our Pythons set os.sep and
os.path.sep to '/' so that it aligns with the default separator
of those shells.

fromNativePath(str) then fails to convert '\' seprators embedded
in binaries since str.replace('/', '/') is a noop. The operation
we want here is to convert all '\' to '/' anyway so this is more
explicit regardless of any opinions on our choice to dynamically
vary os.sep and os.path.sep

Change-Id: I76c05b188abca41c6a1b516c68b584e0c06e7235
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-05-11 11:23:11 +00:00
hjk
e855de4037 Debugger: Fix GDB hanging
This partially reverts commit e33da6a6b3.
GDB seems to hang while executing str(some_pointer) in some setups.

Task-number: QTCREATORBUG-14374
Change-Id: Ia678533b9122e505b21ef6659d404239995ddb81
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-05-06 06:19:00 +00:00
hjk
89661af04e Debugger: Fix one call to check(False)
Not much harm done, the code was meant to raise an exception anyway...

Change-Id: I81db4081b4ca583e46a826aaee2fc8fa3f186a11
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-15 11:37:35 +00:00