Commit Graph

192 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
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
hjk
626086e9d1 Debugger: Fix expansion of std::string et al
The objects have been reported as 'having children', but
when asked for them nothing was produced, leading to an
endless loop (until the next 'step' command).

Change-Id: I3bbfe10a7ed980b27a5fca1edfe44dd8983b8f7b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-09 08:02:32 +00:00
hjk
7a618c38cf Debugger: Remove unused dumper.py function polishWatcher()
Change-Id: Ib85ac34b56971b1882d91bddf9abf1af5b0506f4
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-02 10:00:49 +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
a7dd2ed4ce Debugger: Reduce scope of usage of Python's importlib module
The module doesn't exist in Python 2.6, so we can't use it
unconditionally if 2.6 is to be supported again.

Task-number: QTCREATORBUG-15076
Change-Id: Ic91cdf451ce846d892cd914bf850a4fd4b18c488
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-09-24 06:43:01 +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
Eike Ziller
8eaaef96aa Merge remote-tracking branch 'origin/3.5'
Change-Id: I65968dd02ea6bdd15f304ae567dd0c02238e6949
2015-08-20 13:23:13 +02:00
hjk
76b5095687 Debugger: Also display subentries for pretty printed char arrays
While the formatted value is usually all that's wanted,
having access to the individual chars is handy at times.

Change-Id: I53b0d0ccfe4289b9b54a1caced4e0bd5ac66d9fc
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-08-13 14:18:22 +00:00
hjk
ef7a7a445b Debugger: Fix evaluated expressions containing quotes
Task-number: QTCREATORBUG-14364
Change-Id: Ia1fc1f341dad56c495b356464951a771dfccc50b
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-08-13 12:19:17 +00:00
hjk
eca5ccdd3e Debugger: Debugger protocol maintenance
- Move DisplayFormat from watchhandler.h to debuggerprotocol.h
- Add/update a few comments about the use of the protocol enums
- Make decodeData take a DebuggerEncoding instead of an int

Change-Id: I50bed70a5da2e94da46e894bf9136bc14c9a1b23
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-12 12:59:41 +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