Commit Graph

289 Commits

Author SHA1 Message Date
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
hjk
c0fabbe169 Debugger: Add breakpoint commands for LLDB backend
Commands needs to be given in Python, i.e. something like

    import time
    print time.asctime()
    for i in range(1, 10):
         print(i)

works.

Task-number: QTCREATORBUG-15585
Change-Id: I7724617e4bbe85a717ae78b21014e2b55c4089c8
Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-15 10:50:45 +00:00
hjk
9425f28865 Debugger: Hex-Encode LLDB disassembler comment fields
They may contain quotes and possibly other data breaking the transport
protocol.

Change-Id: I53795bd1de54385e8d9c50088368fdc768db217b
Task-number: QTCREATORBUG-15635
Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-14 12:49:59 +00:00
Christian Stenger
406c395a42 Debugger: Fix LLDB operations with XCode 7.3's lldb-350-0.21.3
Task-number: QTCREATORBUG-15965
Task-number: QTCREATORBUG-15945
Task-number: QTCREATORBUG-15949
Change-Id: If68cb17f6c627ede2d7f5381dbb4188f27fc66d5
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-08 14:44:15 +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
9e16554e25 Debugger: Be a bit more robust with LLDB disassembler
LLDB 3.8 on Linux claims non-existent files to be the source of
disassembly.

Change-Id: I45a47cf5e7faad7ccd6dbb9879c8328fc2496b95
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-19 14:22:39 +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
ad6c0f9bc6 Merge remote-tracking branch 'origin/3.6'
Change-Id: I8f034f91de04e319dd5ba24b8837f1daca54d918
2016-01-07 11:01:14 +01:00
hjk
31abbba961 Debugger: Make Watchpoint setting more robust with LLDB
At least on Linux/LLDB 3.8 trying to set watchpoints at fixed address
produces breakpoints with .IsValid() == False that choke on accessing
certain functions like .IsOneShot() used e.g. in breakpoint data
reporting.

Now report the .IsValid() state and skip the reporting of the "bad"
fields.

Change-Id: I742ed171f37763f3dbbd896173c527817edf3a6e
Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-06 13:30:43 +00:00
hjk
e22f8e37e4 Debugger: Fix transfer of object address with LLDB
For opening memory editor etc. This was a regression after protocol
changes in 525c33f99.

Change-Id: I519ab744122547bd5d0094675dbd471d8e77e98c
Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-06 12:09:42 +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
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
58bec40246 Debugger: Force passing DYLD_.... environment variables to inferior
Apple's LLDB has changed behavior between 330.x and 340.x.

Newer versions seem to actively delete the DYLD_IMAGE_SUFFIX,
DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH environment variables
from the scripting environment.

Change-Id: I0b7bbdce0975e969b1dae5770fd9a99328f241be
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-12-08 16:29:17 +00:00
hjk
7c08f5a9b0 Debugger: Further improve base class dumping with LLDB
... in the presence of empty base classes. This now actually makes
the Inheritance dumper test pass.

Change-Id: I92ada5da46accb6e7eaff58ce5dc329484ef0909
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-12-07 12:38:50 +00:00
hjk
aa221121b6 Debugger: Pass down expanded inames in LLDB tests
... as well as the 'autoderef' flag. A lot of dumper tests were
failing even though the dumpers themselves were ok.

Change-Id: I198784d95eb0004e81bfab995121e048b1722c66
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-11 13:16:17 +00:00
hjk
aed9c46ea6 Debugger: Try to handle empty base classes more gracefully with LLDB
Empty base classes are counted towards GetNumberOfDirectBaseClasses()
but do not get reported in GetChildCount(). Fix the difference by
manually creating empty base class entries in the report.

Change-Id: I2650d9f5234302c5bf2fa0e62a886d3a39fc11db
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-11 13:11:32 +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
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
dd7eff0371 Debugger: Add more roundtrip markers to LLDB protocol output
Change-Id: If2e3fc51dab800a9e347da7975eb89547acfb945
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-09-07 10:43:48 +00:00
hjk
5829b22b03 Debugger: Also show instruction bytes in LLDB disassembler
Change-Id: I9676e458153b745fc75a5da271524e73959fba03
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-31 11:51:19 +00:00
hjk
d16aed4304 Debugger: Add display of mixed disassembler output for LLDB
Change-Id: I4997ce4fb4ce6a61cca67e36abb84c61a1c120f5
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-28 13:44:49 +00:00
hjk
47c79a102f Debugger: Fix handling of large registers with LLDB
Change-Id: I12a7a9e43922291c6bff77be5fefea4db6cb5482
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-28 11:11:22 +00:00
hjk
afa6bb9dd8 Debugger: Make (sub-)registers editable
Change-Id: Ibca2808513b6784b65d5c7223717a8b1d930c381
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-08-28 11:04:12 +00:00
hjk
427c32ccb0 Debugger: Fix Jump To Address in LLDB disassembler on Linux
lldb.thread.RunToAddress does not seem to hit anything on Linux.
Fake it by setting a temporary breakpoint + continue.

Change-Id: I533c8fb42c9a3d1ac1e5cc23eae8162a3455fb9a
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-10 14:04:48 +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
e2b0641f28 Debugger: Adjust tests after change to member sort order
Change-Id: Iff3b9781ad9842b325d346a77514aa7a935d4570
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-07 14:12:28 +00:00
hjk
84d06d0ec6 Debugger: Remove LLDB's Dumper.defaultValue
This was needed with earlier, now unsupported versions of LLDB to
provide a target context for evaluation of expressions.

Not needed anymore since SBTarget.EvaluateExpression() exists now.

Change-Id: I31871937832439dbd98b763ac77eab4db56ef2ee
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-06 06:04:27 +00:00
hjk
565df2cb06 Debugger: Remove warning on variables without names
They can appear for unnamed function parameters with default values,
e.g. void foo(int = 0).

Change-Id: I02cad093247f4508e7d4c4fd3f143c9ad8d5ebd1
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-06 06:04:17 +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
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
hjk
5309e217e4 Debugger: Consolidate GDB and LLDB "updateLocals" code paths
This splits the bool setToolTipExpression() operation into
a bool canHandleToolTip(), and the actual processing of
the request, which is mostly identical to the handling of
a watcher.

Handling a watcher is now mostly the same as a full Locals
update, except for the 'partial' flag. Pushing the handling
of that down to the bridges gives identical code paths
in the gdb and lldbengine. Move that to the
DebuggerEngine base class.

Change-Id: I3861b43e8630c7e7bd57fcd549b2a2387e3d4869
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-10 07:40:27 +00:00
Jack Andersen
39df03aba7 Debugger: LLDB strictly requires bool values for breakpoint API
Change-Id: Ia4b3cfb2ef41df8c76800eb4da597f7cb5f770c4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-05-27 09:04:50 +00:00
hjk
c5ac8fc21b Debugger: Use simpler construction of basic types in LLDB dumper
Cheaper, more robust.

Change-Id: I989853dc288864f4088f09f60c8c5b717e4faef0
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-05-08 10:35:08 +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
fc23148202 Debugger: Make access to non-existing member throw with LLDB
This mimics GDB behavior.

Change-Id: I929a87ff227e4af7cfbfbbcd2a8e72c9999e9338
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-14 12:39:20 +00:00
hjk
dcf3ba5009 Debugger: Explicitly report chars as integer values with LLDB
This brings it into line with GDB output and is needed in
the frontend to provide normal integral value base changes.

Change-Id: I17adc7730419648d45c0d5866311de33bf01a7f0
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-14 11:09:06 +00:00