Commit Graph

278 Commits

Author SHA1 Message Date
hjk
873559b9c9 Debugger: Check presence of current working directory explicitly
Change-Id: Iba6037907761702fa825764757dd00fce4a91082
Reviewed-by: Vadim Evard
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-04-10 10:25:10 +00:00
hjk
fb213b5826 Debugger: Use a named tuple for Dumper.Field
Makes it clear that this is meant to be immutable and is supposedly
faster.

Task-number: QTCREATORBUG-17823
Change-Id: Ie5d67b793e0bc4f704981d5161efc12bcc22100a
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-09 08:20:46 +00:00
David Schulz
530f7972eb Debugger: Optimize QObject::staticMetaObject lookup
Change-Id: I8c06472ce4e33b7c4203934d93b9cc8c8ae95ce2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-07 09:46:23 +00:00
David Schulz
aafb17ae83 Debugger: Add enum value dumper to cdbbridge
Change-Id: I40f1556599be7581eeab0c75b034696ac22a7131
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-01 10:07:49 +00:00
Alexandru Croitor
079a5c3cc3 Debugger: Fix type lookup for lldb
In certain cases FindFirstType can fail to find a type due to bugs
in lldb. The workaround consists in using FindTypes, and iterating
over the results to find the searched for type.

Change-Id: I1fee3f774d0cf02842f6b55419142af5e9780992
Reviewed-by: hjk <hjk@qt.io>
2017-01-12 12:48:54 +00:00
hjk
fb57391767 Debugger: Make gdbbridge fetchVariable output similar to lldbbridge's
Change-Id: I11fc7d163dbd6b7deb5e88cac65dc61df3352411
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-19 10:37:16 +00:00
hjk
c2eada278e Debugger: Fix Window grabbing on GDB
Needs to make namespace detection work without valid frame

Task-number: QTCREATORBUG-17326
Change-Id: Ia7c7017db4ef384d4f246e11a5601d01f4f366f1
Reviewed-by: hjk <hjk@qt.io>
2016-12-15 17:22:18 +00:00
hjk
d98d9025b8 Debugger: Fix environment passing with LLDB
Change-Id: Ic51a5ee1b9ef69b60279f045175be6d59b53582b
Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-12-07 07:39:44 +00:00
hjk
dc2724a3f7 Debugger: Allow QObject property extraction without debug info
Task-number: QTCREATORBUG-16908
Change-Id: I1e1e9d91a6317808610f39868383b67e5c80a9a4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-02 13:26:00 +00:00
hjk
2275d68373 Debugger: Switch on QObject name display by default
... and use the option to govern general QObject guts display.

This allows people to completely avoid the performance impact
of attempted QObject display and still makes the feature
more prominent for our favorite use case.

Change-Id: I1e53b6448f646ab7eea9168a3cd24c77769e6328
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-02 11:23: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
286f089e55 Debugger: Fake contents of empty base classes with LLDB
A truly empty base wouldn't need content, but LLDB 3.8 reports declared
but not defined undistinguishable from empty bases. At least for the
common case of a single inheritance class we can continue dumping by
fake base class contents by fake the contents by using the whole derived
object's data.

Change-Id: I82d595b985ec1289d8abce5fccd217057d2d2d44
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-21 13:34:03 +00:00
hjk
572ba812d2 Debugger: Fix over-quoting in LLDB breakpoint reporting
The 'output' bit is inserted at report time, not at callback
script generation time.

Change-Id: Ibb5c9b09d8391d1be86b8f110e32ab1c90f6bab2
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-11-17 14:47:16 +00:00
hjk
88ff6cd5ae Debugger: Use a more direct way to detect LLDB bitfields
It has a function directly doing that, use it instead of
guessing (badly, in some cases)

Change-Id: I1ce317c28d60f820f8e868e3c0c5a665f8de6cb7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-16 08:38:35 +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
6f1bd8bbdb Debugger: Consolidate name handling of anonymous structs
Change-Id: I44acfdccb5cad02c95270490e319caca334c8a4b
Reviewed-by: hjk <hjk@qt.io>
2016-11-04 21:21:26 +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
3be260ecc5 Debugger: Replace 'first base' guessing logic
Use the fact that the order of the first three vtable entries of a
QObject is fixed and the size of their implementations is roughly
known.

Change-Id: I3d13f594cb1c1f162a520da18b2bc2aaba852092
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-02 15:11:32 +00:00
hjk
77db31db3b Debugger: Use native field accessors again
This is a partial revert of the type id change (bd2653fb) to get
the case of virtual bases work again, as it falls back to native
field accesses everywhere we have native types.

This is likely to be a performance regression with CDB/Python,
but since this combination is experimental and not used by
default in 4.2 getting GDB/LLDB right is more important.

Medium term we might want to have a more fine-grained approach
to use of type ids (e.g. use native field accesses on a case-by
-case base only for type with virtual inheritance)

Change-Id: I239111e6ce5f3365b750068bfc4dafb12be1d53c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-02 10:36:06 +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
Eike Ziller
21258bac46 Merge remote-tracking branch 'origin/master' into 4.2
Change-Id: Ibc8b4de34e6790854d23b829c96a1a128ea0e6a4
2016-10-10 09:25:10 +02:00
hjk
e149c0dac9 Debugger: Fix LLDB's field size reporting
Use the field's type size if the reported field size is 0.

Change-Id: I7db49507d0ea7358b6db27dfa206f2b079bbf876
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-10-10 05:19:10 +00:00
hjk
27e03e6fb6 Debugger: Do not run engines twice
There seems to be race in the LLDB setup on Linux. Work around
by not doing serious work twice to be able to use the test at least.

Change-Id: I387a57d3c66e6c4209bd424af9be16f17acb98fa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-10-07 13:06:27 +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
83b14ec359 Debugger: Fix std::map dumper for XCode 8
Change-Id: I7536d65355d69f4b8c31bc5adeb582d9b4eb1b33
Reviewed-by: hjk <hjk@qt.io>
2016-09-30 16:01:41 +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
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
615ace36d5 Debugger: Remove now unused isFunctionType in lldbbridge.py
Change-Id: I687e5f94b7ac4134f070661c428f6d6c6c509c6a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-28 09:23:22 +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
bf5f96e423 Debugger: Fix passing working directory with LLDB
It's not the one of the lldb process anymore, so set it explicitly.

Change-Id: Ibcc2b63631c4096f860996ad6ccfc12415d8aefd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2016-09-26 11:57:36 +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
Orgad Shaneh
c01d7a7540 Merge remote-tracking branch 'origin/4.1'
Change-Id: Ieaddc6093d10c08a54acb9b57cbbfe022bc3c038
2016-09-22 11:01:16 +03: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
Christian Stenger
c022399322 Debugger: Fix support for lldb from Xcode 5
Change-Id: Icb0e0349a0d6d88bb871b538bac858b2b252ef2f
Reviewed-by: hjk <hjk@qt.io>
2016-09-15 08:37:28 +00:00
Vikas Pachdha
1787d00e6e Continue process after lldb attach
lldb stops the process after attaching and the event loop is not yet started.
This makes the debugger wait for events while process is in stopped state

Task-number: QTCREATORBUG-15705
Change-Id: Iae6fe94fc483d963b377582c4cbbb443be5e6cba
Reviewed-by: hjk <hjk@qt.io>
2016-09-14 14:17:40 +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
Alexandru Croitor
3b35d39910 Fix debugger to correctly interpret stdout availability behavior
Previously if program execution was paused, and a c++ command was
executed via executeDebuggerCommand method, which in turn printed
to stdout, Qt Creator would assume that program execution has
been resumed. But in reality the execution was still paused.
Make sure not to report the program execution as being resumed, in
case if something is printed to stdout as a result of a debugger
command.

Change-Id: I8752be00b1bf5bd4767debc2eb26b9a433f251bb
Reviewed-by: hjk <hjk@qt.io>
2016-08-30 08:12:02 +00:00
hjk
7037644252 Debugger: Show object address with LLDB if there is nothing better
Mimic what GDB does.

Change-Id: Ied3fff41339220eacc5c942b3f30e744f9f32a21
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-25 08:56:34 +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
39206931f1 Debugger: Mark out of scope variables as such
At least LLDB reports sometimes out of scope variables as such.
Report them as "out of scope" instead of letting the common
struct dumper fail and report its generic "not available".

Change-Id: Ic9d0d196894ef811fab8e6a586bf55d80cd02e45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-21 13:29:57 +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
David Schulz
3d9ef5c813 Debugger: Collect results of the map object in python 3.
map() directly returned a list in python 2.
Fixes a startup issue on windows.

Change-Id: Ib4b67ca98a74135ff108546f8d089686f7df9493
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-11 11:25:46 +00:00
Alexandru Croitor
7158f37447 Fix reference values to be shown in debugger view.
Change-Id: Ia8e6da004ea22515fccf4292cc3ddd8c530040c2
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-22 06:08:55 +00:00