Commit Graph

461 Commits

Author SHA1 Message Date
hjk
c944d08702 Debugger: Make {boost,std}::shared_ptr display more compact
After debugging through a code base that makes extensive use
of shared pointers (LLDB...) I came to the conclusion that the
display of weak and strong counts is pretty much useless and
it would be better to avoid that level in the display.

Change-Id: Ie03b05fff4f7f5b7dced2e656b404e8e7938cc25
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-01 07:50:23 +00:00
hjk
53022f01fd Debugger: Add dumper for std::once_flag
Change-Id: I8b5166fc0e7d54676b84a1b0d45c6a2793c2a37c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-01 07:09:00 +00:00
hjk
3193321532 Debugger: Add a dumper for std::weak_ptr
Change-Id: I253b6d8069ecf36618aa40038da6820f52eb38df
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-30 13:37:46 +00:00
hjk
eefe4fb7f7 Debugger: Add a dumper test for shared_ptr<ThingWithVTable>
... and fix lldbbridge to pass it.

Change-Id: I2c20cfafe5d7695d4359521cbfcbdc235dacbc82
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-25 11:57:24 +00:00
hjk
5a914b55fc Debugger: Use int instead of bool in test code that can be C
Change-Id: I91fa6e97d4fbffef14a64c2203710923a13d7479
Reviewed-by: hjk <hjk@qt.io>
2016-11-24 17:11:16 +00:00
hjk
99097d011e Debugger: Skip dumper tests automatically depending on build environment
Change-Id: I2df98c283de180f72f2f214637223a7c2f63114c
Reviewed-by: hjk <hjk@qt.io>
2016-11-24 16:25:08 +00:00
hjk
9d7a1fcb0f Debugger: Add a QStandardItem dumper
Change-Id: I503b17e1f36158a774dcf096b19ba628f0cc0205
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-24 09:51:40 +00:00
hjk
e9f0f37070 Debugger: Robustify QRegExp dumper
The capturesTexts cache may or may not be warm, and
we may or may not be able to warm it. Make the dumper
work in as much cases as possible.

Change-Id: I9d9e0ec0c6a1bcf7288352c2834fedd42071d068
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-23 11:23:04 +00:00
hjk
584a8c2afe Debugger: Remove some old and unused test code
The functionality tested is used in other tested places.

Change-Id: I62883e81dab9f26ac63e1f45f039571ca1f6a32e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-21 13:44:20 +00:00
hjk
ba87a5dace Debugger: Make QFiniteStack dumper work on macOS
qfinitestack_p.h is not self-contained, #include <stdlib.h>
manually to get access to malloc().

Change-Id: I628e5e2a872d361bb7b246ec7333efb3c94dae98
Reviewed-by: hjk <hjk@qt.io>
2016-11-18 16:30:30 +00:00
hjk
96b907a1e8 Debugger: Fix QFiniteStack dumper and add missing auto test
Change-Id: If5f242f8d5184a0f2c62f6211f2ba89cda0cac07
Reviewed-by: hjk <hjk@qt.io>
2016-11-18 13:32:05 +00:00
hjk
82818cb90b Debugger: Improve QAtomicPointer dumper
More compact display and arbitrary inner types.

Change-Id: I68bc1f5cc88f51e993e6e8a91556d9d745a2574a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-16 13:34:04 +00:00
hjk
f0115b6664 Debugger: Disable some of the LLDB inheritance dumper
Both LLDB 3.8/Linux and 360.x/Mac cannot display the contents
of a virtual base class when accessed to a 'secondary' path.
The problem is with LLDB itself, so don't expect Creator tests
to pass in those cases.

Change-Id: I25b005d66fa9f64766a4cc0aaaa2c865b6df8c5f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-16 10:05:42 +00:00
hjk
5b058ebb34 Debugger: Make QRegExp dumper test pass on Mac
We need DYLD_IMAGE_SUFFIX=_debug for the captures()
cache warming call to succeed even if the actual access
is by offset only.

Change-Id: I24a90b4c4187459904f14a664b992a5bba9a20eb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-16 08:37:18 +00:00
hjk
8f2f614f22 Debugger: Force #include <boost/version.hpp> in boost dumper tests
We might end up with undefined boost version otherwise.

Change-Id: Ibcdc70cbce8aad42947ce4760df0208d5ebe83f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-14 11:15:04 +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
77bd581f49 Debugger: Re-enable access to dumper.Value by integral index
Task-number: QTCREATORBUG-17220
Change-Id: I63632a90e2518151b3bf20b1241c24f9808ec39c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-10 07:02:58 +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
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
David Schulz
15de32d1cd Debugger: Replace "__int64" with "int64" when looking up types
Change-Id: I110dc294cbe414b770166d9574f53812113d9821
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-02 09:43:35 +00:00
hjk
8c9856d3d1 Debugger: Make rvalue dumper pass
Depending on whether DWARF-2 or DWARF-4 is used, compilers encode
rvalue references as lvalue reference or rvalue references.

GDB doesn't understand rvalues, and there's no workaround, so restrict
the test to compiler version that use DWARF-2 by default.
(see https://sourceware.org/bugzilla/show_bug.cgi?id=14441)

Change-Id: I98ed73844571a07e81003cf99c6d7e0be37722b5
Reviewed-by: hjk <hjk@qt.io>
2016-11-01 15:12:35 +00:00
David Schulz
69db1653c2 Debugger: Adjust dumper test to cdb python dumper
Change-Id: Ide744edad545f0eeb2152f0d47bd8bace26d698d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-01 14:26:49 +00:00
hjk
4452e85710 Debugger: Split error messages in debugger output tests
Having one per line makes them easier to read.

Change-Id: I4f4288ac26415cf9930c8b377972c391bd223ee4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-01 11:27:40 +00:00
hjk
4f7821a71f Debugger: Disable Nim dumper auto test
Needs manual testing in the common case that the
intended crash does not occur.

Change-Id: I99de4f466df9e3a470a6bcb98b819d15da3a7067
Reviewed-by: hjk <hjk@qt.io>
2016-11-01 08:14:10 +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
e234bbd88b Debugger: Add dumper for Nim's string and sequence types
... and make the auto test infrastructure able to handle
a test. To pass the test, some Nim compiler must be
accessible.

Change-Id: I707aa72c0f3a2ea35c7131cba490cafb41617f6c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-10-06 13:39:02 +00:00
hjk
d4ef385d59 Debugger: Improve QJSValue dumper on 32 bit
Change-Id: I18937a92d5202a58d9f3d786c6cc37f8176b2692
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-10-06 09:18:10 +00:00
hjk
da00b0202e Debugger: Use types instead of type names in dumper array handling
Change-Id: I5c4b6e0e0de077fbead467dd1b042c379c9a0dd3
Reviewed-by: hjk <hjk@qt.io>
2016-09-30 15:06:37 +00:00
hjk
fad7be6caa Debugger: Make QLocale dumper test pass on Qt 5.6 again
QLocale::DefaultNumberOptions is new in 5.7

Change-Id: Iaf55dcacd8ca5a0bbb92f25df4983aed276cda7f
Reviewed-by: hjk <hjk@qt.io>
2016-09-30 14:30:50 +00:00
hjk
ffe85ff5a2 Debugger: Adjust StdList dumper test expectation to reality
Change-Id: I366bba71ae122635d8159085396df80a2ae301db
Reviewed-by: hjk <hjk@qt.io>
2016-09-30 13:56:21 +00:00
hjk
a71fb44404 Debugger: Re-enable two std::map test cases
Whatever the problem was seems to be fixed by now.

Change-Id: I0990614f5ed5b4f61f0e7d1017603fc317ada6d1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-28 13:26:34 +00:00
hjk
856c347300 Debugger: Use now-standard mechanism for std::unordered_map dumper
Change-Id: Iceea7d369e53220622edb6272e72750b6512148f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-28 12:49:25 +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
e08b1a070b Debugger: Add a dumper of QStaticStringData
Change-Id: I5e4ebc31eaf7cce76b8cfd1a5c9635441eccc797
Reviewed-by: hjk <hjk@qt.io>
2016-09-22 13:39:12 +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
845feec543 Debugger: Fix QFixed dumper and add an auto test
Change-Id: I9895d1dec4a6db9fa93e6ca0d6d30bdd92a4c3c6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-15 06:33:32 +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
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
aa1eab65f0 Debugger: Also check value in SSE dumper autotest
This works nowadays.

Change-Id: I7ee85d125308bba7772a55e42ee0e983c300980c
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-08-23 05:44:41 +00:00
hjk
bbede15fe0 Debugger: Use shorter QList in automatic dumper test
Easier to handle when reproducing issues manually.

Change-Id: Ide48475fe2c488aabb939564b8e516be58a6fdc3
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-08-23 05:44:22 +00:00
hjk
def8ca8ba1 TreeModel: Move some base TreeItem code out-of-line
Avoid code explosion.

Change-Id: I7d239a4560e90b68cc4991341adf940a98776254
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-03 09:23:46 +00:00
hjk
726b907cc3 Debugger: Remove debuggerstringutils.h
With QT_RESTRICTED_CAST_FROM_ASCII making GdbMi etc operate on
QString is feasible again. Take this as opportunity to move
debugger encoding handling closer to a 'conversion on input and
output if needed, storage in QString only' scheme.

Change-Id: I2f10c9fa8a6c62c44f4e6682efe3769e9fba30f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-09 08:09:46 +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
7a80f2f01e TreeModel: Take responsibility for some of the casting
This adds a templated layer on top of TreeModel that can specify
item types for the top three layers in the model, relieving user
code from some of the previously necessary type casting.

Two common setups get an extra layer with convenience functions
on top: TwoLevelTreeModel for two-level model with a first level
of static headers and a uniform second level, and UniformTreeModel
where all non-root nodes are the same.

"Untyped" plain TreeModels are still possible.

The walkTree() feature and untyped iteration in the base
TreeItem and TreeModel is retained for now to ease transition
in downstream modules, but is planned to be removed soon.

Change-Id: I67d75a1a4e18e8f254dbfb458db03510d8990d8b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-05-30 06:25:48 +00:00
hjk
fbc82d3f88 Debugger: Fix dumping of numeric QJsonValue inside arrays
Task-number: QTCREATORBUG-16313
Change-Id: I544e89fc964cd404652d8ea0c8df127e51235292
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-24 13:09:19 +00:00
hjk
482bbec175 Debugger: Fix QUuid dumper with large numbers and LLDB
Change-Id: I357063022435d461d0b52c14541a4dfae69a1cdb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-04 10:32:20 +00:00
hjk
c0c5aad8e6 Debugger: Adapt dumper test to base class sorting
Fallout from e73a9c1b0d.

Change-Id: If06ba8424bd264137dcdcdd721317ce6785a91b0
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-12 14:05:38 +00:00
David Schulz
54a51979c0 Fix std::list dumper test for cdb.
Change-Id: I071b4c918cf6d236110c48085af607f8ff578e30
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-12 13:55:36 +00:00