Commit Graph

546 Commits

Author SHA1 Message Date
Orgad Shaneh
8457949dbc Debugger: Fix MSVC warning
Implicit cast from size_t to int.

Change-Id: I8e53a6511afa4a3435f571217d736725771fef9c
Reviewed-by: hjk <hjk@qt.io>
2017-03-15 12:18:36 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
hjk
7f73f3950e BaseTreeView: Make resizeColumns() publicly accessible
Simplifies the only used code path through the model and a custom
signal.

Change-Id: I9bbab725cdd122b7261a8f14b101786e38e61e57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-21 09:16:51 +00:00
David Schulz
df9377ecb6 Debugger: Fix setting display format based on type
Change-Id: I5d2b1016d0ad24237abc24233b580049d1c6add0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-17 11:47:23 +00:00
hjk
75194a06e6 Debugger: Add {Expand,Collapse} Children item
To the Locals and Expressions context menu. This is useful
to have when expanding larger containers of structs where
the struct has no particular dumper and the address alone
is not really useful.

Change-Id: I2ddb4ca0ae32afb7efe63aee08551314db7a3b59
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-15 09:44:33 +00:00
hjk
196dbbe0e7 Utils: Introduce TreeItem::{begin,end}
... and use this to reduce the number of explicit uses of m_children.

Despite of being shorter code by itself it is a step towards having
an explicit LeafItem object that doesn't explicitly store a(n empty)
vector of child nodes.

Change-Id: If8db85e2f1134dd1578a78d31235bf57a28f863a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-02-08 16:08:42 +00:00
hjk
4ab6d1fa9d Debugger: Fix spurious cppcheck warning in reformatCharacter
The code path is never taken, size == 4 only happens in conjunction
with isSigned == false.

Task-number: QTCREATORBUG-17632
Change-Id: I3fd5a08fd5e414690bccf487f9d3cfb704ab5e47
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-01-25 12:08:58 +00:00
hjk
c2eada278e Debugger: Fix Window grabbing on GDB
Needs to make namespace detection work without valid frame

Task-number: QTCREATORBUG-17326
Change-Id: Ia7c7017db4ef384d4f246e11a5601d01f4f366f1
Reviewed-by: hjk <hjk@qt.io>
2016-12-15 17:22:18 +00:00
Orgad Shaneh
ad04908a52 Debugger: Remove shadow variable
Change-Id: Ia2e8ad88429a682f8569070eb8c12544f929d2a2
Reviewed-by: hjk <hjk@qt.io>
2016-12-07 09:02:07 +00:00
hjk
f85c6efcd1 Debugger: Consolidate watcher insertion code paths
All were targeting the same running engine, doing the same thing.

Change-Id: If1186f6467cde6b44a051ea5845d4528917ca8f9
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-11-30 12:55:29 +00:00
hjk
d583469249 Debugger: Keep watchers alphabetically ordered
Task-number: QTCREATORBUG-12308
Change-Id: Ifdffa20f3ccec6aa2c086ce83db3b4a8817e08ab
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-11-30 07:24:04 +00:00
hjk
cffe189dd2 Debugger: Use better approximation for sizeof(double)
Change-Id: Iec35e285384b6b4a7b184383f56a0772348f4f7d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-29 14:55:56 +00:00
hjk
b84bf4946f Debugger: Allow repeated editing of watchers
Task-number: QTCREATORBUG-17332
Change-Id: Ie647b956426c81a8f448dfde14b77798b5b73788
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-29 11:20:21 +00:00
Friedemann Kleint
840e787175 Use QString::splitRef() instead of QString::split()
Avoid string allocation where it seems feasible.

Change-Id: I61b23d4ef8a459f5aa77727a75f4e1d2b140da3b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-25 11:32:47 +00:00
hjk
89262f64a9 Debugger: Disable "Select Widget to Add into Expression Evaluator"
Doesn't work anywhere right now.

Change-Id: I094f0591a8f33a3d07065089ca4f70e4a2b6f145
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-25 10:36:52 +00:00
hjk
6190801bf0 Debugger: Show position in separately displayed text in tooltip
Task-number: QTCREATORBUG-17324
Change-Id: Ic9571a91e5f414abd10b18698a0e0ae9bb0f1f46
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-23 11:17:27 +00:00
hjk
a8697e4716 Debugger: Don't accumulate return value displays
This fixes a regression introduced with d771ba89.

Change-Id: Icc44ef9ad41f9e5cdb3848fae7a1ba8af2626344
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-11-18 11:14:49 +00:00
hjk
5992c74488 Debugger: Robustify L&E context menu handling
Keep strings in lambdas instead of WatchItem pointers that
might get deleted while the menu is open.

Change-Id: Iec65924696da9754ffbbbb833ae0db990598c8e3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-14 07:42:02 +00:00
Ulf Hermann
d771ba8921 Debugger: Don't clear unrelated views when updating locals
If the list of partial expressions is empty we need to tell the watch
handler that we are only updating the locals view, not e.g. the
inspector view.

Change-Id: Iedc74ffc66a8435faa272d053849b831f6b8cbbe
Task-number: QTCREATORBUG-16692
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-11-04 09:35:10 +00:00
Leena Miettinen
d550cbdd40 Debugger: Fix UI text grammar and capitalization
Make some tooltips shorter.

Change-Id: Iff61402e3059360417ca0d763dbcae0ed3841e1c
Reviewed-by: hjk <hjk@qt.io>
2016-11-01 14:40:51 +00:00
hjk
cc8414ff1f Debugger: Add a few dumpers for OpenCV related structures
Mainly as test ground to show of matrix display later.

Change-Id: I49e6d06bf7203532e384cc3215483512089bfcf5
Reviewed-by: hjk <hjk@qt.io>
2016-09-23 10:20:42 +00:00
Christian Stenger
ae3483da27 Debugger: Avoid null pointer access
Change-Id: I85cc637d60797bfa182c045b81d3520919bbfde9
Reviewed-by: hjk <hjk@qt.io>
2016-09-21 13:06:29 +00:00
Christian Stenger
a8493ae987 Debugger: Fix double clicking watch handler
Double clicking watch handler window without hitting an item
used to trigger 'Add New Expression Evaluator...'.

Change-Id: I452eb56476f7186ac36f7a9f1e9d2a43c109a9b1
Reviewed-by: hjk <hjk@qt.io>
2016-09-21 12:49:23 +00:00
Christian Stenger
62b2c85806 Debugger: Fix triggering 'Add New Expression Evaluator...'
Change-Id: I961e4afb17b14210474fa69138c4671aaaca5b7d
Reviewed-by: hjk <hjk@qt.io>
2016-09-21 12:23:52 +00:00
hjk
c71c00cf48 Debugger: Re-enable editing through Locals&Expressions view
Fix recent regression in double-click event propagation.

Change-Id: Ic69d0d95701c8168331b1627fbd9334b8f5dc0d4
Reviewed-by: hjk <hjk@qt.io>
2016-09-20 12:13:52 +00:00
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