Commit Graph

162 Commits

Author SHA1 Message Date
hjk
f229f0dbe5 Debugger: Disable CLI use of gdbbridge.py
The detection seems to go wrong in some cases on RHEL which
are not reproducible locally.

Since the feature is not important for Qt Creator's own use,
disabling is safer than attempting to guess better.

Change-Id: I95fd56985d61b604a285e7573f8775b902bcc68c
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-09-25 07:12:30 +00:00
hjk
1b417fd78c Debugger: Use qtHookData to extract Qt version when possible
This avoids inferior calls, i.e. is faster and more robust.

Task-number: QTCREATORBUG-14350
Change-Id: I9f21eda6e2e3950eaaca90a35afb885e76e789d8
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-13 14:03:00 +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
Orgad Shaneh
221ab36025 Debugger: Fix expansion of anon nested types
AttributeError: 'NoneType' object has no attribute 'startswith'

Change-Id: Ieb08c33cce06ad484de856b249ab4723b01d520e
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-28 04:58:55 +00:00
hjk
d327a11030 Debugger: Sort vtable before data members
... when listing members of a struct in the Locals and
Expressions view.

Task-number: QTCREATORBUG-14767
Change-Id: I5089dd3bcba40ab335be164c5de2f2d70c3ed4f4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-07-21 14:59:44 +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
6d8dfe03de Debugger: Move typeCache from DumperBase to (Gdb)Dumper
It's an implementation detail of the gdb side (and would not
be there if gdb.lookup_type were faster)

Change-Id: I135c32a1c9132ab771c8fab5abfd04fbb308891e
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-10 10:45:33 +00:00
hjk
c691cca48d Debugger: Always sort base classes first when showing a structure
Simply relying on '[' < any_letter is not good enough in the
presence of uppercase identifiers.

Task-number: QTCREATORBUG-14637
Change-Id: Ib0e305c0b86f3b117c07de18cde00b14f424a7c4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-07-06 08:56:11 +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
f886c70199 Debugger: Be more robust in case of unexpected non-ASCII output
Also correct typo in function name.

Task-number: QTCREATORBUG-14629
Change-Id: I193efc3a002f83b0091f93e087f2feb19dc4f5c1
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-25 11:37:18 +00:00
hjk
60eacb7790 Debugger: Allow hex values to be passed for qmlcontext addresses
Change-Id: I327f40f872a2399befdbccf78e5b364ecaf86aee
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-15 06:38:01 +00:00
Orgad Shaneh
5fe0682fa6 Dumper: Fix exception with Python3
Occurred when I tried to expand an object that contains 2
unnamed unions (CPlusPlus::Token)

	File "gdbbridge.py", line 1113, in putItem\n    self.putFields(value)\n'
	File "gdbbridge.py", line 1150, in putFields\n    fields.sort(key = lambda field:\n'
	'TypeError: unorderable types: str() < NoneType()\n'

Change-Id: Ica38750435ae851b52d87dc6fcc59118d3f1d8ee
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-12 04:42:59 +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
Ray Donnelly
f5dcc93b7e Debugger: Handle case of os.path.sep being '/'
On MSYS2, if QtCreator is launched from one of the msys2 shells
then the MSYSTEM env. var is set and our Pythons set os.sep and
os.path.sep to '/' so that it aligns with the default separator
of those shells.

fromNativePath(str) then fails to convert '\' seprators embedded
in binaries since str.replace('/', '/') is a noop. The operation
we want here is to convert all '\' to '/' anyway so this is more
explicit regardless of any opinions on our choice to dynamically
vary os.sep and os.path.sep

Change-Id: I76c05b188abca41c6a1b516c68b584e0c06e7235
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-05-11 11:23:11 +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
89661af04e Debugger: Fix one call to check(False)
Not much harm done, the code was meant to raise an exception anyway...

Change-Id: I81db4081b4ca583e46a826aaee2fc8fa3f186a11
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-15 11:37:35 +00:00
hjk
6965fc30b1 Debugger: Disable parts of QDate* dumper for GDB on 32 bit
Older versions of GDB (~GDB 7.4 on 32 bit) will cause segmentation
faults in inferior calls due to misaligned %ebx values in an SSE
call in qstring.cpp:findChar.

Change-Id: I44492106080f12e645f9d57828438ec70fd66ca6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-15 11:07:30 +00:00
hjk
315585056b Debugger: Properly retrieve signed internal values with LLDB
Fixes the QLinkedList dumper.

Change-Id: I1be509c16ed96edb02c540d9c87b9506e496ed2c
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-14 05:59:55 +00:00
hjk
3658bdac89 Debugger: Use primitive internal widget instead of matplotview
This practically removes any functionality beyond plain plot display,
but does that at least reliably, cross-platform, without dependency
on 3rd party python packages.

Change-Id: Iaff2f78595394522f32264c642df20dd48b83f8b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-02 12:25:04 +00:00
hjk
00199039e7 Debugger: Fix display of expandable items in GDB and LLDB
Move common code to dumper.py and debuggerengine.cpp and
fix it there.

Change-Id: I20d91d1aa7400fbdb27938c10cf40c8f6019df0a
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-03-26 15:00:23 +00:00
hjk
55712e3ca9 Debugger: Fix retrieval of single expanded items
It was falling into the full update branch as the passed
parameter was not a list anymore.

Change-Id: I314beb3a68f8791483a599c7d5782fd454983840
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-03-26 12:30:53 +00:00
hjk
48ac7c186b Debugger: Re-organize passing of display formats
The current setup (dumper->gui: list of descriptions,
gui->dumper: index in list) is fragile and not easily
i18n'able. Go with an enum based approach now.

Change-Id: Ie78c596065a8b2ba87ad725274da29d4be3a6da4
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-03-23 14:12:43 +00:00
hjk
e8f8aaa263 Debugger: Fix dumper format choosing with GDB
... and further unify GDB and LLDB code paths.

Change-Id: Id89f3804c53190c4888082891fd3c3c55eceac84
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-03-19 06:59:01 +00:00
Christian Stenger
77be0cb57e Dumper: Fix accessing None type - again
Change-Id: I265e316a1168310f220aa449528790c4bfec41d8
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-03-12 13:03:44 +00:00
Christian Stenger
cce834aebc Dumper: Avoid accessing None type
Change-Id: I627f9ec1d2f67c2a870f9cebca89f5f7b8d67020
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-03-11 12:23:47 +00:00
Orgad Shaneh
44797cdb52 Debugger: Fix stack filename resolving on Windows
Task-number: QTCREATORBUG-13999
Change-Id: Ifc04a5592b8a07c95f152e73e802b7b686119d88
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-03-02 07:06:12 +00:00
hjk
f91cc66f9a Debugger: Combine some watch related GDB and LLDB code paths
Change-Id: I20e5f6f04418c931354a07bc3597f6982fcaf942
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-02-12 12:49:21 +00:00
hjk
9df463da84 Debugger: Convert bb extension to use runCommand
Change-Id: I528c51d2b02dccd91429778ef8c940fe5565345f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-02-12 10:27:33 +00:00
hjk
875d889082 Debugger: Move bbsetup over to runCommand()
Change-Id: I0a19b28d24cb570651ea84bf7cdbc9a761f85a0b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-02-12 07:19:48 +00:00
hjk
f65cb6ae4d Debugger: Complete switch to Python for GDB stack generation
The iteration in Python was only used for the 'native mixed'
case before. Seems reasonably fast and robust now to always
enable it. Also, make the calling code use 'runCommand'.

Change-Id: I10565a725dfaa9bf46c28739c69e9f2546498929
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-02-11 16:34:51 +00:00
hjk
e76c4839bb Debugger: Consolidate some GDB-through-Python interaction
Instead of calling a GDB extension command invoking a function
on the well-known Dumper instance, call the Dumper function
directly. This also makes the code more similar to the LLDB side.

Change-Id: I4b23177eb72a904721b63c578ce7fbfe204f02a2
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-02-11 15:00:35 +00:00
hjk
547855bf02 Debugger: Using DebuggerCommand instead of bbedit call
Mid-term goal is to reduce the amount of similar code
at least in GDB and LLDB engines.

Change-Id: I4883686a102246be3135ddc694b837b1187ac9e9
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-11 08:06:39 +00:00
hjk
4c63855f88 Debugger: Remove unused UpdateData::tooltipOnly member
Change-Id: I15c6f16a258c0d664d2378150c4b3277a29c4b5c
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-02-06 12:06:28 +00:00
hjk
fee7cbe55b Debugger: Move 'mixed native' variables extraction to DumperBase
In preparation for re-use through LLDB. Not yet functional there.

Change-Id: Ia924f1499a1bbaebf3dccbe15152f324058b1677
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-05 12:00:57 +00:00
hjk
a20a7d099b Debugger: Move QML stack access to DumperBase
... and make it work with LLDB.

Change-Id: Idaec029942dbcc726931781caff830173f7b126a
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-05 10:55:55 +00:00
hjk
96a0f48093 Debugger: Pass all breakpoint properties to *brigde.py
Change-Id: I58ee1b106e1cd6e8ad5ce99b226860c528698520
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-04 15:32:20 +00:00
hjk
ca1f743463 Debugger: Native mixed fixes
Change-Id: I1b10b2f6a241c6061ac5ee77825aa8500cb7097f
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-04 15:30:59 +00:00
hjk
d4a32fd6b3 Debugger: Implement native mixed breakpoints with LLDB
Breakpoints are hit, stack frames are identified as JS or native.
No further data yet.

Change-Id: I84a02422fd36dc7645003114dd8519bedd913c06
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-04 12:46:02 +00:00
hjk
7d4b9c4ba0 Debugger: Move some 'mixed native' code to DumperBase
Prepares reuse in LLDB.

Change-Id: I2238a94937411b80a9ec84ab738aba2146bba50e
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-04 11:30:27 +00:00
hjk
24afad2c32 Debugger: Adjust Native Mixed to new JSON based protocol
Change-Id: I4a9b9b31bba24a81824303f343115ba7c3709107
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-02-03 14:00:47 +00:00
hjk
f479c1979e Debugger: Move common dumper module code to DumperBase
Change-Id: Id411edcefbb56c480b87829062395dcb5244d2a5
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-30 08:49:19 +00:00
hjk
eafde22e16 Debugger: Handle extra dumpers with LLDB
This generalizes part of the previously GDB-only code paths

Change-Id: Id32798073e3c8bcb23bfedf463bebc866c8275e2
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-29 15:42:31 +00:00
hjk
4ea0138423 Debugger: Replace gnuplot by python-matplotlib for graph dumper
Better functionality and availability than the gnuplot version.
The feature ("Show array-like data in external plot window")
will be automatically enabled if 'from matplotlib import pyplot'
succeeds.

Change-Id: I1799534ac5f878d3e43e47289d1b563b52bb4378
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-26 09:14:08 +01:00
hjk
4c928f6099 Debugger: Disable GDB's own pretty printers when use is not wanted
Saves up to 20% on large uniform structures.

Change-Id: I98c8c942f0accac7e2db1d8b06bf7ed156967306
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-26 09:13:53 +01:00
hjk
d4bdae9a3d Debugger: Make dumper reload with Python 2.x
Change-Id: If23573fab0f951bed0f86b70500dd7e9862df887
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-01-22 12:57:15 +01:00
hjk
61c49a122f Debugger: Initial shot at native Qml-and-C++ debugging
Only for GDB now, requires a debug build of Qt, not feature complete.
To enable it, run with QTC_DEBUGGER_NATIVE_MIXED=1 and press
the 'oo' button in the debugger toolbar.

Change-Id: I28aac9db13f7067e03cc364b89cc8046fa213dae
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-22 12:39:02 +01:00
hjk
cca1030432 Debugger: Add python command to add dumpers
More flexible than hacking on the C++ side. Also registers
the custom dumper path to make it reloadable like the
"built-in" dumpers.

Change-Id: I0405f7278e28eb75d83fdd4a861f5a5c32d97a0e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-01-22 10:55:36 +01:00
hjk
d573195b67 Debugger: Improve handling of imported system dumpers
At least for a few cases (std::string, vector, ...) this can succeed.

Change-Id: Idfa4ced4cb20295472d001181a83373acd89883a
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-15 11:13:22 +01:00
hjk
20396d7809 Debugger: Use Python for GDB stack extraction in native mixed mode
Change-Id: I7ca4a080c9b5e5992f44e5f3d8aa5af7296abe99
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2014-12-12 12:36:41 +01:00
hjk
62d21d123c Debugger: Remove traces of outdated attempt at combined stepping
Has not been usable for a while and will be superseded by
"native" mixed stepping.

Change-Id: I2902a98b7ad4e4b29e389e54fb6488bf711840dd
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2014-12-12 10:53:43 +01:00