Commit Graph

571 Commits

Author SHA1 Message Date
hjk
33c79a4440 Debugger: Simplify BinEditor usage
Change-Id: I77a226cce97a85471fbe3d57a09d5b8318c7cce7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-22 10:29:07 +00:00
Orgad Shaneh
670e54345c Remove use of deprecated Qt algorithms
Change-Id: Ib35cffa2d5762874feea9b1d4df7f569c0e5f496
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-08-09 13:41:25 +00:00
Orgad Shaneh
1853f01a5b Merge remote-tracking branch 'origin/4.1'
Change-Id: Ia442f30f387fe9292217582260bbe79e54608810
2016-08-05 11:40:07 +02:00
hjk
00cd726608 Debugger: Add more safety net for failing dumper
In case a dumper explicitly reports the presence of children
but fails to extract them, remove the model's desire to
see them by re-setting the 'wantsChildren' hint explicitly
after a full update.

Change-Id: I09d3d3dd67067d22d39f7685b57570ecb42984d2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-04 09:04:04 +00:00
hjk
7e73e9c48f Debugger: Remove unused WatchItem::state flag
Lately it was only set and read for debugging purposes. A mechanism
similar to the ChildrenNeeded state is still needed and available
through WatchItem::wantsChildren.

Change-Id: I78c85d65bc35810be420bd0418db9675473697cd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-08-03 11:29:23 +00:00
Ulf Hermann
68f904fb55 Debugger: Remove unused variable
Change-Id: I14058602e0220295ad0e7e91d38d0b6ca83d7e22
Reviewed-by: hjk <hjk@qt.io>
2016-08-02 13:54:54 +00:00
hjk
53415cece1 Utils: Streamline TreeModel API
The LeveledTreeModel case is general enough to cover
the UniformTreeModel case, so merge them and rename to
TreeModel. The former TreeModel is now BaseTreeModel.

BaseTreeModels should not be instantiated directly,
a tree model with non-uniform basic items is available
as TreeModel<>.

Done-with: Eike Ziller <eike.ziller@qt.io>
Change-Id: I64a65617ab68c0cde39cf65f4bc092ef808ee6fb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-27 08:00:40 +00:00
hjk
6e925910b4 Debugger/BinEditor: Standardize interface
Change-Id: I4acf6bc7648e57c564e86023176ae3905a293a99
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-07-21 06:20:52 +00:00
hjk
eece696da3 Debugger: Remove multiple definitions of WatchWindow
Change-Id: If8241717f195ff31c9d6124285f77fca969056c4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-07-18 13:07:35 +00:00
hjk
2d79bdc29c Debugger: Remove some uses of semi-global currentEngine()
Make use of recent TreeModel improvements in various
tool views, push more operations into the engine-
owned data models, specifically context menu creation.

Change-Id: I479c97102b9fb81611c6461c6df1cec59295179a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-07-18 11:17:53 +00:00
hjk
e48451b0a3 TreeModel: Consolidate child()/childAt() and rowCount()/childCount()
We never used the possibility to overload the virtual child() and
rowCount() functions, it's unlikely to be needed in future.

Change-Id: I7ebdf4dfc70bb0bcadea9ef3fb88f16632a95696
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-07 13:39:15 +00:00
hjk
7b4c7d49a9 TreeModel: Introduce a destroyItem() convenience function
Shorthand for delete takeItem(...).

Change-Id: Icb7b60e5c19aa0d21650eefff65f7eb55e9f90b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-06 11:41:55 +00:00
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