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>
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>
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>
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>
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>
TreeModel::forAllChildren and TreeModel::walkTree differ
in the handling of the topmost item.
Change-Id: Id2032f69bb47218292507d33ed00935874afa73f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
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>
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>
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>
QmlEngine::pdateCurrentContext() currently relies on being able to
access the 'name' member.
Change-Id: I75675681407402667da1cb82d3589980d92554a2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
There are cases like changing an Evaluated Expression that make
re-evaluation necessary.
Change-Id: I51fe46b67399a59aebbdeb9c3e778795b1c52cf1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
Easier to coordinate between dumpers and watchhandler
Change-Id: Ide191a5786dc04ef22c3e9c8b0bec39f8f8c0f1d
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
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>
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>
Getting e.g. an object's address is better than an empty value.
Change-Id: Ia78335da8b9eadeadc2e6f1757399ae604eb6610
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
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>
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>
... 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>
... 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>
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>
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>
... 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>