Commit Graph

168 Commits

Author SHA1 Message Date
hjk
e56e6b0ca9 Debugger: Handle wchar_t* equally special as char*
Task-number: QTCREATORBUG-16034
Change-Id: Ic1aed8cef2d8eea9ceaf4123b0b0b7da08e6c86b
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-11 10:45:39 +00:00
hjk
5daeb5da01 Debugger: Fix LLDB operations with XCode 7.3's lldb-350.0.21.3
The output of lldb changed. Adapt our use.

Task-number: QTCREATORBUG-15965
Task-number: QTCREATORBUG-15945
Task-number: QTCREATORBUG-15949
Change-Id: Ic78593c1a7c4ae69ecf23e381cd2f23441b4829b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-06 06:08:45 +00:00
Orgad Shaneh
05c1d8ef55 Debugger: Provide addresses for formatted pointers
Pointers often don't have an address at all, or have the pointer's
address instaed of the target address.

For example:
int main()
{
  char str[11] = "HelloWorld";
  char *s1 = str; // s1 shows its own address
}

Change-Id: I2436578c073a00a3fec9411ef7ec82ae4e63a8b0
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-03-22 15:56:54 +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
4255493881 Merge remote-tracking branch 'origin/3.6'
Change-Id: Ia5e169a276e21db59b4b26a1ed3f253bff9e2ab9
2016-01-14 09:32:17 +01:00
Orgad Shaneh
8c0f663118 Dumper: Fallback to 100 items when array size cannot be determined
Can happen when an array is declared as `extern Struct arr[];`

Change-Id: I7e9e0a5e73799dc29bfe6a71ad60d3d51a709cef
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-01-11 13:32:48 +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
6dcdba92f3 Debugger: Show a warning if Python < 2.7 is used
Execution will continue for now, but not for long.

Change-Id: I1abc57e6375e5ec4d24c7299f68f59c5bb06f3c9
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-12-16 12:02:26 +00:00
hjk
d01a5ff2aa Debugger: Speed up display of large static arrays with simple data
This addresses QTCREATORBUG-15426 for the case of well-known simple
types (int, float, ...). Retrieving 1 mio ints takes now ~15s instead
of ~140s.

Task-number: QTCREATORBUG-15426
Change-Id: Ifb7c957d60504e23147d499d8bb9bbd41c5a53ba
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-12-10 11:23:24 +00:00
hjk
4099cef35d Debugger: Better fallback for resolving function local struct types
Function-local struct definitions produces types 'names' like
'QList<main(int, char**)::SomeStruct>'. Remove the part up to
the '::' and rely on local lookup.

Task-number: QTCREATORBUG-15400
Change-Id: Ic73005f294c5f62c504b2d7ded4dd2716d88f2e4
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-12-09 07:37:03 +00:00
Orgad Shaneh
01b50d2fc3 Fix invalid long address printing
Task-number: QTCREATORBUG-15326
Change-Id: I90b73e757c0ad3fc16ef587e6b4359e6bcb843ea
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-20 07:51:14 +00:00
hjk
e6454be43f Debugger: Fix QObject dynamic property dumper for Qt 5.7
Property values are stored now using a QVector, not a QList.

Change-Id: Ifc8d6b856d2aff5ce4565c43111132f2a73460df
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-09 13:49:34 +00:00
hjk
f81dca4b38 Debugger: Relax reference counter sanity check
With C++11 we use std::atomic in the ref counter, giving yet
another possibility of structure member names. Instead of
trying to keep up with that, access the binary data directly.

Change-Id: Iabea831689f58f83150287218bb015c824e888ca
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-09 08:44:58 +00:00
hjk
626086e9d1 Debugger: Fix expansion of std::string et al
The objects have been reported as 'having children', but
when asked for them nothing was produced, leading to an
endless loop (until the next 'step' command).

Change-Id: I3bbfe10a7ed980b27a5fca1edfe44dd8983b8f7b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-09 08:02:32 +00:00
hjk
7a618c38cf Debugger: Remove unused dumper.py function polishWatcher()
Change-Id: Ib85ac34b56971b1882d91bddf9abf1af5b0506f4
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-02 10:00:49 +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
a7dd2ed4ce Debugger: Reduce scope of usage of Python's importlib module
The module doesn't exist in Python 2.6, so we can't use it
unconditionally if 2.6 is to be supported again.

Task-number: QTCREATORBUG-15076
Change-Id: Ic91cdf451ce846d892cd914bf850a4fd4b18c488
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-09-24 06:43:01 +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
Eike Ziller
8eaaef96aa Merge remote-tracking branch 'origin/3.5'
Change-Id: I65968dd02ea6bdd15f304ae567dd0c02238e6949
2015-08-20 13:23:13 +02:00
hjk
76b5095687 Debugger: Also display subentries for pretty printed char arrays
While the formatted value is usually all that's wanted,
having access to the individual chars is handy at times.

Change-Id: I53b0d0ccfe4289b9b54a1caced4e0bd5ac66d9fc
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-08-13 14:18:22 +00:00
hjk
ef7a7a445b Debugger: Fix evaluated expressions containing quotes
Task-number: QTCREATORBUG-14364
Change-Id: Ia1fc1f341dad56c495b356464951a771dfccc50b
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-08-13 12:19:17 +00:00
hjk
eca5ccdd3e Debugger: Debugger protocol maintenance
- Move DisplayFormat from watchhandler.h to debuggerprotocol.h
- Add/update a few comments about the use of the protocol enums
- Make decodeData take a DebuggerEncoding instead of an int

Change-Id: I50bed70a5da2e94da46e894bf9136bc14c9a1b23
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-12 12:59:41 +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
hjk
3413130379 Debugger: Fix typo when reporting large containers
Regression since 9130cdfc05, leading to "<unavailable>"
instead of "<at least %1 items>"

Change-Id: I89166e50f27c568009ff7aeabb5adf622e303789
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-08-11 09:31:54 +00:00
hjk
eaec337265 Debugger: Fix display of C-style wchar_t strings
The null delimiter was not reliably found due to iterating over the
wrong positions in the string.

Task-number: QTCREATORBUG-14826
Change-Id: I3a3f2fca84648b54b12fe5fae921ce6311d4f1b2
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-08-10 14:28:44 +00:00
hjk
5f9f95a451 Debugger: Work around wrongly reported array size
GCC 4.9.1 + GDB 7.8 (and likely more combinations) produce
sizeof(QProcess[3]) == 0, making the dumpers report no child
entries for the array.

To work around, try to parse the array size from the type name itself.

Task-number: QTCREATORBUG-14755
Change-Id: I1f17d5d6fde6bc5fe66d2ad4a73f77185503f9ab
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-22 13:27:19 +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
6f58f4ba50 Debugger: Basic type display switching for QVariantMap items
This is not a complete solution (that would need to pass information
on typedefs and artificial types like "QVariant (QVariantMap)"
between dumper and gui, but allows switching to compact display
for individual items.

Change-Id: I47d15356e5decf9411af4acc8fa7a0f0cfbd045f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-10 10:45:27 +00:00
hjk
c4b9af6841 Debugger: Fix typo in comment
Change-Id: I0bea97b8f452c250135a5cf7a364665ddbd24df2
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-08 06:38:38 +00:00
Eike Ziller
4058ff6fe9 Merge remote-tracking branch 'origin/3.4'
Conflicts:
	src/libs/extensionsystem/pluginview.cpp

Change-Id: I410156c1003d5dc81e915110c6d432bcd71da010
2015-05-07 14:42:46 +02: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
Eike Ziller
50fe3585a8 Merge remote-tracking branch 'origin/3.4'
Conflicts:
	src/libs/timeline/qml/MainView.qml
	src/plugins/git/gitclient.cpp

Change-Id: I0b6ec7b9a592014deb0dd2e1145b19dd6753b1c3
2015-04-15 17:45:47 +02: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
f7d794dc9d Debugger: Next attempt at robust array dumping
In the fallback case now really go back to explicit object-at-address
construction. LLDB on Linux doesn't seem to like implicit pointer
arithmetics.

Change-Id: I3be6b0b21b35b9b9141440d4a11e9e889bb2f4bb
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-04-14 09:41:26 +00:00
hjk
e33da6a6b3 Debugger: Remove GDB specific access test in generic pointer code
The field checked for does not even exists in lldb.SBValue.

Change-Id: I062ccf62da2e2ea3f011d0b841cba0e87f7c6fa9
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-14 05:55:15 +00:00
hjk
afcf2afe5a Debugger: Rename local 'bytes' to 'rawBytes' variable in dumper
'bytes' has special meaning in Python.

Change-Id: I9ff7c56488c9d29e42b2c7a12e40b45815be2a76
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-13 12:40:42 +00:00
hjk
d15e4ff2c9 Debugger: Replace block access to array data by plain loop.
This makes the GccExtension dumper test pass with GDB

Change-Id: Ia1319e878416bea8b162a1a9eef1271cb7bebc63
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-08 05:31:27 +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
d66e063165 Debugger: Make C array data plottable
Change-Id: Ib4519f0e64504ec0e3dccd89978acca5134b2932
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-04-01 09:09:43 +00:00
hjk
5dcd9fe694 Debugger: Change plot display of array data to use lines between dots
Change-Id: I6d2cf5ca7d3f4a404a3c112a140aeae067cb3b6d
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-03-30 11:29:02 +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
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
hjk
90c9093a49 Debugger: Make display encoding of std::string selectable
Task-number: QTCREATORBUG-14119
Change-Id: I17434490a1a0a8374ee0c178c45a032af283e7a5
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-03-18 14:03:50 +00:00
hjk
6960da702a Debugger: Fix display of array base address
Change-Id: I858d38a1f52cd7247f1b57d686c3c065e5a0fb61
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-03-18 12:21:21 +00:00
hjk
3e02f8ec2e Debugger: Fix format switching for char[]
Task-number: QTCREATORBUG-14094
Change-Id: Iea1f59d5af2fb453ead7e0cef9e04293a698794e
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-03-09 11:17:25 +00:00