Commit Graph

316 Commits

Author SHA1 Message Date
hjk
5b33660a57 Debugger: Allow spaces in arguments with LLDB
Change-Id: Iebc6f7975e9a306805911ed18eb4689074abd891
Task-number: QTCREATORBUG-22811
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-06 08:07:25 +00:00
Christian Stenger
32ce4d5071 Lldb: Fix event handling for newer Xcode and faster machines
If the system or the running inferior produces output while
fetching data the output did interfere with the state handling
of the debugger engine which in turn lead to a complete
inconsistent state of the debugger where the states of the
debugger bridge and the debugger engine (QC internal) assumed
complete different states.
Circumvent by explicitly ignoring the state for inferior output
on stdout or stderr.

Change-Id: I81aa0bacd41de4266a9278c66fed908dd72c9d44
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-08-02 12:29:35 +00:00
Alessandro Portale
5311708845 python scripts: Use "not in" operator to test membership
As per suggestion from Pyls, this changes
  if not needle in haystack:
to
  if needle not in haystack:

Change-Id: I4a482604e13e61ecee9e02935479632419710ff7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-05-10 05:53:39 +00:00
Christian Stenger
31e549a7dc Debugger: Improve lldb breakpoint handling
Inform QC about changed breakpoints on the LLDB side.

Fixes: QTCREATORBUG-21997
Change-Id: Icec25725f92d8a0b47f7dab2971c0c5eb5b23757
Reviewed-by: hjk <hjk@qt.io>
2019-03-06 05:43:12 +00:00
Eike Ziller
868160f215 Merge remote-tracking branch 'origin/4.8'
Change-Id: Ia8fed69168d87afafdb5acf4de4d5d30f9b4ebf5
2019-01-31 08:38:13 +01:00
hjk
ac1d6d0bc8 Debugger: Fix Attach to process and Run in Terminal
LLDB 6.x and 7.x

Change-Id: I127ed1e14ccdd239646673f2460be46da22d4965
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-23 14:24:57 +00:00
hjk
587bd782aa Debugger: Reduce the amount of ignored stop messages with LLDB
This is a workaround for excess messages from the early LLDB 3.x times.
LLDB 6.0 is ok with and without this workaround, LLDB 7.0 does not
produce the excess messages anymore and the workaround leads to
real stop messages e.g. after a breakpoint hit being ignores.

Change-Id: I2fad014eb92e066b00dbfe590fe62c543e5343f4
Task-number: QTCREATORBUG-21615
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-23 12:56:12 +00:00
hjk
d22a6d29e8 Debugger: Make *__int128_t also available with LLDB
Change-Id: I114458e18e461596966d5ef1b8f38f3c5d8d5ee5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-21 11:43:56 +00:00
hjk
d4e79230d8 Debugger: Make LLDB startup failures more verbose
Fixes: QTCREATORBUG-19612
Change-Id: I7c8ebe3ec734265c8df8a684ccd6bb8991ea8390
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-12-11 12:08:06 +00:00
Alexandru Croitor
18c6048099 Debugger: Fix thread switching when using lldb on macOS
The SetSelectedThreadByID method expects an integer, and not
a string.

Fixes: QTCREATORBUG-21563
Change-Id: Ibd5538a3214b73d7e87e66b59d6b9af0b93effeb
Reviewed-by: hjk <hjk@qt.io>
2018-11-27 11:00:40 +00:00
hjk
afe5699f8d Debugger: Show module in stack frames also for LLDB
Change-Id: I2b20b83bedf98a1b0eb17519fb4bec536e48dbaf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-22 13:25:24 +00:00
Christian Stenger
84576d3098 Dumper: Fix displaying enums with LLDB
Prioritize displaying as enum if a type is known
to be an enum. Otherwise this would just end up
get displayed as string representation of its value.
Enable respective dumper tests.

Change-Id: I3e5406e14a68f02741b6144bb54528b72cc8192d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2018-11-19 14:22:45 +00:00
Christian Stenger
deef478b38 Dumper: Fix activating frame for lldb
...when being attached to core file.

Change-Id: I4f8364285d756bae53b4a14ca8feb74f7fdaacfb
Reviewed-by: hjk <hjk@qt.io>
2018-11-14 10:09:05 +00:00
hjk
402991498f Debugger: Fix assignment to QString etc with LLDB
Task-number: QTCREATORBUG-21353
Change-Id: Ie3655738c249240d9fbf17e054fc8f79a284efd4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-12 12:31:46 +00:00
hjk
3ca343dd90 Debugger: Remove some dead code in lldbbridge.py
Change-Id: I368252f7ca83f66962f9c1d0e1726a77320fc886
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2018-11-09 12:30:53 +00:00
Alexandru Croitor
de32a631c3 [Debugger] Fix bitfield values to show up correctly using lldbengine
The bitpos value returned by lldb is the bit offset relative to the
beginning of the type, there is no need to do an extra modulus
operation.

Adjust dumper test to add the previously failing case.

The failing case happens when the class containing the bitfield has
more members in front of the bitfield.

Change-Id: I93678f78e6799843558ec53342a0ed49cac74f48
Reviewed-by: hjk <hjk@qt.io>
2018-11-08 15:12:10 +00:00
hjk
c016c6737b Debugger: Fix LLDB start with complex command lines
Fixes: QTCREATORBUG-21433
Change-Id: I1a248272566eac7f5fd07a8346500d245b62fbfa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-08 14:21:21 +00:00
hjk
2556d4b44b Debugger: Implement disabling/enabling subbreakpoints with LLDB
Change-Id: Iaad8716b98d632e5a933b7f5b26549c7cb885ea7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-11-06 07:37:15 +00:00
Alexandru Croitor
89fe2681f7 [Debugger] Add dumpers for Python "PyObject"s
The dumper calls PyObject_Repr and shows the result of that as the
value of a PyObject.

It also adds three new sub fields to show the object class (type),
super class (base class), and the meta type (the type of the class
object).

Change-Id: I0612833321f6d2b50826588e775cfa12e1db28e4
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-19 11:17:36 +00:00
Alexandru Croitor
f612833d83 Debugger: Pretty print the name of a function when using lldb
This is achieved by calling "po" on an address value casted to a
simple function pointer type, regardless of the actual type of
the function pointer. lldb does not complain, and reports the
library where the function is defined, its name, and location
in the source code if available.

Change-Id: I23ccce62e33bcf213ccdcb55c9836d54333f3c86
Reviewed-by: hjk <hjk@qt.io>
2018-10-15 15:39:16 +00:00
hjk
27cd7162e1 Debugger: Make LLDB instruction-wise stepping work with 3.8.1
Judging from the code it either never worked, or LLDB changed
syntax at some time. In either case, having it in a usable
state with current version is an improvement.

Change-Id: I88b15969bf28b92735d860544dedcbd1d9689765
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-07-24 12:45:01 +00:00
hjk
a8a23110bf Debugger: Fix enum dumper
Make the hex display work with LLDB, fix GDB and LLDB test.

Change-Id: I529b5cdc908dbcba7270bc4574fa59a012fcacad
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-22 08:45:57 +00:00
Christian Stenger
42e224eb4b Debugger: Fix attaching to core for LLDB
Task-number: QTCREATORBUG-18722
Change-Id: I4579fff9725f4a7578642080a010ca54b221969b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-02-08 06:05:16 +00:00
Oswald Buddenhagen
777ca8e655 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp

Change-Id: I94647f59d7a9df48168ac066555afe80f5f9b91f
2017-12-21 13:20:24 +01:00
hjk
79ba461a46 Debugger: Suppress variables from unrelated scopes
Change-Id: Ib7ae6c2af37a2cdb7dfd63d0622e68b55f7a778d
Task-number: QTCREATORBUG-19445
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-14 13:40:08 +00:00
hjk
83c13ff191 Debugger: Combine the InferiorShutdown{Ok,Failed} states
... into a InferiorShutdownFinished.

Change-Id: Icb5394f38f52f7cf300dc83f4eb8f2f0777bbcba
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-14 11:26:52 +00:00
hjk
585b2c62d5 Debugger: Combine the EngineShutdown{Ok,Failed} states
... into a EngineShutdownFinished. They were never handled differently,
and the only option is to proceed to DebuggerFinished anyway. So
simplify the state machine a bit.

Change-Id: Ied3be86fff6750abca578dc6788e4be1d895692b
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-14 09:42:44 +00:00
Tor Arne Vestbø
357caf3b44 Allow LLDB pretty printer to skip resolving type across all modules
The lookup is quite slow, and will hang the lldb debugger,
causing Xcode to hang too.

Change-Id: Ic6579a5de9404c0040d3d304169f18109f61d2ac
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-03 13:40:16 +00:00
Eike Ziller
cfdea6b9c2 Merge remote-tracking branch 'origin/4.4'
Change-Id: I7bf72444b19db20fcc7dc2c9d1f02ec2b30b658f
2017-09-25 11:00:25 +02:00
Filipe Azevedo
846d89811a Fix unstoppable debugger
For some reason sometimes a user stop request with lldb can trigger
a spontaneous stop, avoiding the debugger to stop correctly.
This change fix the issue by emitting the correct states from
lldbbridge.py.

Change-Id: Ib8a2f4875824f4fff426b2d5e0fc4a79ce48c68e
Reviewed-by: hjk <hjk@qt.io>
2017-09-20 09:49:53 +00:00
hjk
8cb944f4ff Debugger: Display summaries for CoreFoundation types
Uses lldb's GetSummary() method to display values for CoreFoundation
string-like variables.

Task-number: QTCREATORBUG-18638
Change-Id: Icca6d9cf7b328c80b44eebe597259f38aba1c3ef
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-08-21 10:35:06 +00:00
hjk
90de4bae40 Debugger: Hex-encode LLDB disassembler source lines for transport
Unescaped quotes break the protocol.

Task-number: QTCREATORBUG-18721
Change-Id: I235c4dc33e599769bc854423ef4a7dc6f46bf58e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2017-08-15 08:44:27 +00:00
hjk
e5631e2ebe Debugger: Fix location marker update for LLDB Jump to Line
Change-Id: I93c46eabb8c91c3e7158454f04cf027d55ece621
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2017-08-14 12:48:32 +00:00
Orgad Shaneh
a9145e67ba Debugger: Prettify values for enum bitfields
Change-Id: I55329bba1864c9ebbbcb3b3bf1b940346507f8cd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-12 10:40:46 +00:00
Orgad Shaneh
adc60b7b17 Dumper: Remove duplicate function in lldbbridge
Change-Id: I0f63ebcc21a5eded26cb01eef8a9c4f2bd96f64c
Reviewed-by: hjk <hjk@qt.io>
2017-05-30 10:51:14 +00:00
Tor Arne Vestbø
9b3ad89dcd Make Qt python pretty printers available inside LLDB/Xcode
The LLBD bridge can be imported from the users's ~/.lldbinit:

    command script import "<path to lldbbridge.py>"

Or by relying on a (future) debug script in the QtCore dSYM bundle.

Change-Id: Ia099dcebc6375d38ae2d75c939bb5669e30e4b2c
Reviewed-by: hjk <hjk@qt.io>
2017-05-19 14:03:46 +00:00
Tor Arne Vestbø
4eac9533e1 Make sure lldbbridge.fromNativeValue always sets value name
Change-Id: I40296843bcbc504d6271a1f30ac4f8c4a1a2fe85
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-18 09:33:54 +00:00
Tor Arne Vestbø
5bc796094a Allow custom handling of python Dumper warnings/exceptions
Change-Id: I04108a09c317675d597bb6d0d58331c70ce02fb9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-16 12:38:16 +00:00
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