Commit Graph

509 Commits

Author SHA1 Message Date
hjk
cd7886a7b3 Debugger: Remove string freeze workaround
Change-Id: Ifd9f89c0d3b5c060af28bdb29e93a5b95f6dc9cd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-06-28 06:16:12 +00:00
hjk
4a74b6184f Debugger: Don't interpret rich text in Separate Window
Task-number: QTCREATORBUG-16444
Change-Id: I5c7a0c307d485575e4c180fad026150417481c24
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-16 08:13:37 +00:00
hjk
6e3fc27fd8 Debugger: Fix display in separate Window
TreeModel::forAllChildren and TreeModel::walkTree differ
in the handling of the topmost item.

Change-Id: Id2032f69bb47218292507d33ed00935874afa73f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-16 07:34:27 +00:00
hjk
d88e75ea9a Debugger: Fix thinko to avoid accumulating outdated items
Only first level items (.local, .watch, ...) are meant to stay,
so all items below the first level needs to get the outdated
marker, not items below the second level.

Change-Id: I78097905fce1898e16f297982eec5974b2465b0c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-10 07:37:03 +00:00
hjk
e2ba0aca9b Utils: Introduce a class template TypedTreeItem
For better typesafety on the user side (and optional) for items with uniformly
typed children.  Use it for UniformTreeModels, and consequently WatchModel
to get rid of some of the static_casts there.

Change-Id: Ic20e507036e180c24997b236230f0f71b285202c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-06-10 06:56:55 +00:00
hjk
57042da683 Utils: Introduce a UniformTreeModel::itemForIndex function
In uniform trees the type of the items is fixed and known,
no need for user code to cast around.

Change-Id: Id20e507036e180c24997b236230f0f71b285202c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-06-09 13:37:59 +00:00
hjk
726b907cc3 Debugger: Remove debuggerstringutils.h
With QT_RESTRICTED_CAST_FROM_ASCII making GdbMi etc operate on
QString is feasible again. Take this as opportunity to move
debugger encoding handling closer to a 'conversion on input and
output if needed, storage in QString only' scheme.

Change-Id: I2f10c9fa8a6c62c44f4e6682efe3769e9fba30f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-09 08:09:46 +00:00
hjk
6df0a34e99 Debugger: Add a way to copy selected values from Locals and Expressions
Task-number: QTCREATORBUG-14956
Change-Id: I2700820adf716afb784ec686297c15c48f3592f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-06 06:54:59 +00:00
hjk
cbbdc64e8a Debugger: Make watch model root a WatchItem
QmlEngine::pdateCurrentContext() currently relies on being able to
access the 'name' member.

Change-Id: I75675681407402667da1cb82d3589980d92554a2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-31 11:07:13 +00:00
hjk
7a80f2f01e TreeModel: Take responsibility for some of the casting
This adds a templated layer on top of TreeModel that can specify
item types for the top three layers in the model, relieving user
code from some of the previously necessary type casting.

Two common setups get an extra layer with convenience functions
on top: TwoLevelTreeModel for two-level model with a first level
of static headers and a uniform second level, and UniformTreeModel
where all non-root nodes are the same.

"Untyped" plain TreeModels are still possible.

The walkTree() feature and untyped iteration in the base
TreeItem and TreeModel is retained for now to ease transition
in downstream modules, but is planned to be removed soon.

Change-Id: I67d75a1a4e18e8f254dbfb458db03510d8990d8b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-05-30 06:25:48 +00:00
Eike Ziller
ec231b5910 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/valgrind/valgrindruncontrolfactory.cpp

Change-Id: I96c0f8cc3b49f8f55f45ef1f839857f878f532f4
2016-05-18 12:12:46 +02:00
hjk
e9e47ab452 Debugger: Allow re-evaluation of certain expressions without stepping
There are cases like changing an Evaluated Expression that make
re-evaluation necessary.

Change-Id: I51fe46b67399a59aebbdeb9c3e778795b1c52cf1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-17 16:01:52 +00:00
hjk
dee7ad3806 TreeModel: Rework tree iteration
Use function objects to apply directly during a depth-first
walk of the tree instead of faking a flat container of tree
nodes. Less code, and allows even some non-const operations.

Change-Id: I804ab11df358fe937b40809cbcb772e6f3ff8dc5
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-05-12 12:30:36 +00:00
Eike Ziller
4a826ada04 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: I0cbc9d335073e3234f472aa43f462eef9a9178aa
2016-04-22 15:13:58 +02:00
Christian Stenger
d432b14472 Debugger: Avoid crash in plugin unit test
Change-Id: I38d74f4a34e14f646eaf9f24ca9dc2e14ba06050
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-20 14:39:13 +00:00
Eike Ziller
8a77eacf8d Merge remote-tracking branch 'origin/4.0'
Change-Id: Ied609608f6b12aa923c67777bc5a273c4d8fbcbb
2016-04-15 10:07:55 +02:00
hjk
62d4cf0510 Debugger: Fix unintended fall-through in WatchModel::setData()
Change-Id: I82cde7e25c4abebccb5b999a1c4e0e90f3f9712a
Task-number: QTCREATORBUG-15839
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-04-13 13:05:49 +00:00
hjk
be91d50e43 Debugger: Replace DebuggerDisplay enum by strings
Easier to coordinate between dumpers and watchhandler

Change-Id: Ide191a5786dc04ef22c3e9c8b0bec39f8f8c0f1d
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-12 15:37:28 +00:00
Eike Ziller
5c87432260 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp

Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
2016-04-12 11:34:46 +02:00
hjk
e73a9c1b0d Debugger: Always sort local variables alphabetically.
It was there for GDB at a time, but never for the other backends.
Fix the GDB regression and make the sorting consistent across
backends.

Task-number: QTCREATORBUG-15296
Change-Id: If728c65f0c8ca4a8378c7cf5e53f1dadbfb72b29
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-11 09:35:07 +00:00
hjk
c8c6c8ec50 Debugger: Replace cdb output encoding enum by strings
Change-Id: I05225f5be61fdaa448b9991b14056e89228c26a4
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-04-04 13:01:58 +00:00
Orgad Shaneh
658d29335b Debugger: Re-enable item selection in watches for core dump
In 7de7eb6bca the behavior on Unrunnable
state was changed, probably by mistake.

AddWatcherWhileRunningCapability should allow adding watchers while
running, but it should not prevent selection when not supported and
the inferior is not running.

Another missing part was that Unrunnable was considered running,
although it shouldn't.

Change-Id: I7d27b81977a6921919327b3122a865b7ffa2d0bd
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-03-24 15:36:49 +00:00
hjk
af55f36eaf Debugger: Also copy fallback data on Copy View Contents to Editor
Getting e.g. an object's address is better than an empty value.

Change-Id: Ia78335da8b9eadeadc2e6f1757399ae604eb6610
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-03-24 12:55:18 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
hjk
3eaa734cc3 Debugger: Better support for "raw" QByteArrays and char[]
Display 'cooked' character as well as numerical value in both decimal
and hex.

Task-number: QTCREATORBUG-15549
Change-Id: I7f8f9efe07573b452ff44501bfca5e29e9ab437c
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-01-07 07:14:44 +00:00
hjk
7de7eb6bca Debugger: Work on WatchModel performance
Don't instantiate repeating boilerplate item data in some
cases (such as large arrays).

This makes it necessary to access parent WatchItems in
a lot more cases than before and needs another separation of
WatchItem/WatchModel code to keep the dumper autotests
in a functional state.

For a plain std::vector<int> with 1 mio items this reduces
 extraction time from more than 2 minutes to about 3 seconds.

Change-Id: I175c5f6ee90434a6e85342d8bb71bd10a04dd271
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-01-06 09:59:11 +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
beb561b8cc Debugger: Remove unusued WatchData::displayType member
Change-Id: I475c5f6ee90434a6e85342d8bb71bd10a04dd27b
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-12-17 09:14:29 +00:00
hjk
4b93663acd Debugger: Also escape special chars in elided displayed strings
Task-number: QTCREATORBUG-15486
Change-Id: Ie481b9458beb2e5ce1458abbd71d311561f961af
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-12-10 14:49:11 +00:00
Ulf Hermann
d5707e0e32 Debugger: Use Qt's JSON encoder for debugger protocol
The V4 debug service expects correct JSON as input and gdb, lldb, and
pdb expect Python object literals. There is a subset of JSON that is
also valid as Python object literals and we use that for the protocol
spoken with gdb, lldb, and pdb. The strings passed to CDB are tunneled
through JSON strings and converted to byte arrays before sending them.

Change-Id: I87319b5450e5c3c3b29c565b75cddaa612767611
Task-number: QTCREATORBUG-14931
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-09-15 08:28:14 +00:00
hjk
7ac99044e8 Debugger: Merge watcher request creation
... of {Gdb,Lldb,Pdb}Engine. Code is the same nowadays.

Change-Id: I874b1ddfd813c15cc16c9b91bd894c7c42b56e93
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-09-15 06:00:14 +00:00
Orgad Shaneh
91848f4755 Debugger: Make watchers editable in coredump
Task-number: QTCREATORBUG-15001
Change-Id: Icba8175e2f3ca0ed07815fb063dec660c722231d
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-09-03 07:01:11 +00:00
hjk
e6b2426b89 Debugger: Prevent editing of elided items in Locals view
For a long string, only the parts needed to fill the Value column is
retrieved. Trying to edit (double click on Value entry) this resulted
in truncation of the string.

Change-Id: I1e993bfe52cee933bd32c866448eedc788807bd3
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-08-17 11:15:01 +00:00
hjk
d98325f413 Debugger: Make Locals views entries selectable for core files
Task-number: QTCREATORBUG-14904
Change-Id: I3918979c5f7a5dd3e4fbe9e3c7444f622e26b3f3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-08-13 07:04:27 +00:00
hjk
7a88612a8e Debugger: Don't add a new watcher item when editing one in-place
Task-number: QTCREATORBUG-14775
Task-number: QTCREATORBUG-14851
Change-Id: I06638ffc2d5a1723e87c1c5a651592e7e0bbad22
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-08-11 13:29:29 +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
6c4c8b8a94 Debugger: Remove cache of fetched item names in Locals Views
This was originally present to prevent multiple evaluations of
the same items when using GDB/MI varobjs. This also prevented
a proper update of child item count. Until recently this did
not negatively affect the GUI due to excessive use of reset()
in the view. This has changed, so the missing update was visible now,
solved here by removing the cache, which is not needed anyways,
since we don't use varobjs anymore.

Task-number: QTCREATORBUG-14705
Change-Id: I3bbcd0525f02c10765f20be3a55708835747b307
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-07-17 13:19:30 +00:00
hjk
c1e418c290 Debugger: Don't do unnecessary work
... after the "Sort Members of Classes Alphabetically" option is
toggled. The option only influences the contents of the "Locals
and Expressions" view, so it is sufficient to update only that.

Change-Id: I9eade679eddbfb108c7ed478cce6c13fadcca317
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-07-17 10:42:33 +00:00
hjk
63c5fc034b Debugger: Split updateWatchData() paths
There are two cases that do not coincide in asynchronous
engines such as the QmlEngine: Inserting a new watch item,
and expanding the children of an existing item.

Change-Id: Ic98a5f1e89aca37146039a241de737c407606e83
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-16 08:05:36 +00:00
hjk
69bf5e4319 Debugger: Expand items in QML Inspector on first click
Task-number: QTCREATORBUG-14210
Change-Id: I4c4409476467bb7008cb6806018371e9134437a9
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-10 07:43:29 +00:00
hjk
d48ac14fba Debugger: Simplify removal of outdated L&E items
This removes the need of bookkeeping on the engine side. It's
basically a kind of mark-and-sweep: On update begin mark items
that are expected to change as outdated, while data arrives, undo
that marking, and update end remove all remaining marked items.

Change-Id: I739b84869033d511d5c9a80605c079e87ef4f6a7
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-07-07 08:08:08 +00:00
hjk
24e25e92fa Debugger: Fix crash when trying to insert iname-less WatchItems
The actual problem here was a wrong use of the recursive
findItem() (instead of a check of the direct children).
That went unnoticed, as the recursive search happens
to find the right child *unless* the iname was empty,
which usually should not happen, but did here, since the
LLDB output was not as well-formed as expected.

Task-number: QTCREATORBUG-14660
Change-Id: I368d92c058354d829aab52c6cc37c7f350223dbe
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-03 12:28:37 +00:00
Christian Stenger
90656ea455 Debugger: Delete pointer if no more needed
Introduced with 2b19081cb0

Change-Id: I817ec48b9098f46ca703a6075d4657f0b7eb9948
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-06-16 11:31:45 +00:00
Orgad Shaneh
7a6b1114f2 Debugger: Fix display of fields in returned value
Change-Id: Ic69ea19f4ea5b73f846d02765454f41cd3588133
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-12 07:02:40 +00:00
Eike Ziller
b1393d4778 TreeModel: takeItem should return the item
The usual Qt API for "takeXyz()" methods is to return the item that was
"taken".

Change-Id: Ie144051801487a301b3f13e2857735b65f58150b
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-06-10 08:05:32 +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
hjk
3737986a88 Debugger: Add a comment on what WatchHandler::resetValueCache does
Change-Id: I7bb67fd91fb1338f2d42ceee3e47bad20b36a81b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-09 07:13:50 +00:00
hjk
952a66bf41 Debugger: Remove WatchModel double sorting
Change-Id: Ia26cdcddf086546650525c779c21b0100a616af3
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-06-05 06:18:42 +00:00
Eike Ziller
3858c33d74 Merge remote-tracking branch 'origin/3.4'
Change-Id: I35ba4cc7f7052699c3006545514c866be3cb5fdd
2015-05-26 15:12:42 +02:00