Commit Graph

204 Commits

Author SHA1 Message Date
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
b0d6e0b374 Debugger: More V4 related dumper
Change-Id: Ifd2c5748996ce71bf4b8844ff270c41ba4a9c41f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-28 10:08:43 +00:00
hjk
cbcc556614 Debugger: Make the 'use last value for short display' trick permanent
Change-Id: I4c8b50751ed4ad605bbd02287147a904d8aec58b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-28 08:48:43 +00:00
hjk
a2c83874d3 Debugger: Some dumper improvements for QV4 types
Start displaying QV4::Value again for numeric values
and QJSValue for ints, doubles and strings.

Change-Id: I18ce226c21168087ce280cb05aa0e250bd3187d9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-09-27 15:20:25 +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
cc8414ff1f Debugger: Add a few dumpers for OpenCV related structures
Mainly as test ground to show of matrix display later.

Change-Id: I49e6d06bf7203532e384cc3215483512089bfcf5
Reviewed-by: hjk <hjk@qt.io>
2016-09-23 10:20:42 +00:00
hjk
e4a5f5fa34 Debugger: Make map item display more compact
This adds more information to the top-level item
in map and hash entries.

Change-Id: Id43689fd0b968142ff2e9d06c58687a92b5b17c7
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-09-22 10:34:05 +00:00
hjk
67cf72e377 Debugger: Consolidate some almost common code
The remaining differences were not relevant anymore.

Change-Id: I4db80e8dde4c394267527828a2265aee619acec2
Reviewed-by: hjk <hjk@qt.io>
2016-09-21 10:21:50 +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
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
53f6e6b8a9 Debugger: Add display of captures to QRegExp dumper
Change-Id: I345c72091002fad16af4549332bb7d8a1fb88155
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-14 13:53:07 +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
56548a13bb Debugger: Fix metaObject extraction logic
A variable name mixup, potentially leading to endless loops.

Change-Id: I43f430ec89a8230da665fbfcef8d7f1491b0e2c0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-05 13:01:21 +00:00
hjk
36875ad4f3 Debugger: Move rarely interesting [extraData] out of sight
Together with [metaObject] and [connectionLists]. This also
saves a few cycles in the main code path.

Change-Id: I8460267f04a0c1d63ab0f991450863669cc760e8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-01 13:21:42 +00:00
hjk
d5d449e421 Debugger: Fix display of dynamic properties
While the properties were dumped properly, only the number of
static properties was shown.

Change-Id: I3ccd98478e62d99849f5012121d2ff2bda500319
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-01 11:46:44 +00:00
hjk
d1109c50e0 Debugger: Deactivate metaObject extraction by inferior call
This seems to have side-effects on memory contents. Right now it is
unclear what happens exactly, so revert for 4.1rc.

Change-Id: I7b1b8e376ac84b6656b1abdae720d7bead1c0b89
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-01 10:45:47 +00:00
hjk
4c4698917e Debugger: Robustify QObject detection
Change-Id: I24aa26134e674725c84f511ac610dc06a76a775d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-01 10:45:33 +00:00
hjk
7b1a1305db Debugger: Use '[d]' for artificial QObjectPrivate member
Derived classes might have a real 'd' member. '[d]' on the other hand
is not a valid identifier and also fits into the '[children]',
'[parent]' etc scheme.

Change-Id: I60650a032c49caef1bf5553ebaae8d6b7d219d44
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-01 10:18:12 +00: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
hjk
a12420c995 Debugger: Improve QMetaObject dumper
Change-Id: I690e95f5f4651331f6b2407636253770a9bb92a0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-07-13 15:57:37 +00:00
Eike Ziller
6efd8e33e2 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: I6217662f0c51d04a83f7a85dc5d7c7f25e78e09a
2016-05-13 16:24:37 +02:00
hjk
0ce54ce1e4 Debugger: Guard QObject property extraction against failures
Nowadays, the [property] section contains only "top level" properties,
inherited ones are available through by expanding the base class.

Task-number: QTCREATORBUG-15798
Change-Id: I40475500a2d20f27145a47fa7ed1e61d4a592c10
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-12 11:25:04 +00:00
Eike Ziller
8a77eacf8d Merge remote-tracking branch 'origin/4.0'
Change-Id: Ied609608f6b12aa923c67777bc5a273c4d8fbcbb
2016-04-15 10:07:55 +02:00
hjk
be91d50e43 Debugger: Replace DebuggerDisplay enum by strings
Easier to coordinate between dumpers and watchhandler

Change-Id: Ide191a5786dc04ef22c3e9c8b0bec39f8f8c0f1d
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-12 15:37:28 +00:00
hjk
3a7ce3f5be Debugger: Restrict array dumping to 1 mio elements by default
Individual dumpers can override. User accessible gui to be done...

Change-Id: Idf81dab11f810b43fc6721cbb37d12a1365a8634
Task-number: QTCREATORBUG-16021
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-12 12:08:39 +00:00
Eike Ziller
5c87432260 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp

Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
2016-04-12 11:34:46 +02:00
hjk
744d78d431 Debugger: Change default encoding for char * to UTF-8 in display
Task-number: QTCREATORBUG-16029
Change-Id: Idf14ec54a53bd71b15196aedc7fc5e40b7bb6b5d
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
2016-04-11 10:45:44 +00:00
hjk
e56e6b0ca9 Debugger: Handle wchar_t* equally special as char*
Task-number: QTCREATORBUG-16034
Change-Id: Ic1aed8cef2d8eea9ceaf4123b0b0b7da08e6c86b
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-11 10:45:39 +00:00
hjk
607171ad83 Debugger: Allow use of regular expressions for dumpers
The pattern is given as (unused) default value of a third
parameter of the dump__* functions.

Change-Id: Ia9092427c240f2198acd00267cd136a3becc71b6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-07 10:16:26 +00:00
hjk
5daeb5da01 Debugger: Fix LLDB operations with XCode 7.3's lldb-350.0.21.3
The output of lldb changed. Adapt our use.

Task-number: QTCREATORBUG-15965
Task-number: QTCREATORBUG-15945
Task-number: QTCREATORBUG-15949
Change-Id: Ic78593c1a7c4ae69ecf23e381cd2f23441b4829b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-06 06:08:45 +00:00
Orgad Shaneh
05c1d8ef55 Debugger: Provide addresses for formatted pointers
Pointers often don't have an address at all, or have the pointer's
address instaed of the target address.

For example:
int main()
{
  char str[11] = "HelloWorld";
  char *s1 = str; // s1 shows its own address
}

Change-Id: I2436578c073a00a3fec9411ef7ec82ae4e63a8b0
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-03-22 15:56:54 +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
Eike Ziller
4255493881 Merge remote-tracking branch 'origin/3.6'
Change-Id: Ia5e169a276e21db59b4b26a1ed3f253bff9e2ab9
2016-01-14 09:32:17 +01:00
Orgad Shaneh
8c0f663118 Dumper: Fallback to 100 items when array size cannot be determined
Can happen when an array is declared as `extern Struct arr[];`

Change-Id: I7e9e0a5e73799dc29bfe6a71ad60d3d51a709cef
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-01-11 13:32:48 +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
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
6dcdba92f3 Debugger: Show a warning if Python < 2.7 is used
Execution will continue for now, but not for long.

Change-Id: I1abc57e6375e5ec4d24c7299f68f59c5bb06f3c9
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-12-16 12:02:26 +00:00
hjk
d01a5ff2aa Debugger: Speed up display of large static arrays with simple data
This addresses QTCREATORBUG-15426 for the case of well-known simple
types (int, float, ...). Retrieving 1 mio ints takes now ~15s instead
of ~140s.

Task-number: QTCREATORBUG-15426
Change-Id: Ifb7c957d60504e23147d499d8bb9bbd41c5a53ba
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-12-10 11:23:24 +00:00
hjk
4099cef35d Debugger: Better fallback for resolving function local struct types
Function-local struct definitions produces types 'names' like
'QList<main(int, char**)::SomeStruct>'. Remove the part up to
the '::' and rely on local lookup.

Task-number: QTCREATORBUG-15400
Change-Id: Ic73005f294c5f62c504b2d7ded4dd2716d88f2e4
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-12-09 07:37:03 +00:00
Orgad Shaneh
01b50d2fc3 Fix invalid long address printing
Task-number: QTCREATORBUG-15326
Change-Id: I90b73e757c0ad3fc16ef587e6b4359e6bcb843ea
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-20 07:51:14 +00:00
hjk
e6454be43f Debugger: Fix QObject dynamic property dumper for Qt 5.7
Property values are stored now using a QVector, not a QList.

Change-Id: Ifc8d6b856d2aff5ce4565c43111132f2a73460df
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-09 13:49:34 +00:00
hjk
f81dca4b38 Debugger: Relax reference counter sanity check
With C++11 we use std::atomic in the ref counter, giving yet
another possibility of structure member names. Instead of
trying to keep up with that, access the binary data directly.

Change-Id: Iabea831689f58f83150287218bb015c824e888ca
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-09 08:44:58 +00:00