Commit Graph

571 Commits

Author SHA1 Message Date
Orgad Shaneh
147a3c27c4 Debugger: Strip QLatin1* where possible
Change-Id: Idcab23875b5dc2ecf55e3303f417b995e2252720
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:32:31 +00:00
hjk
4b42789bda Debugger: Privatize GdbMi::m_children
Change-Id: I6e51290c4521be40f516a452f32bdc82a4c051e6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-26 06:15:41 +00:00
Orgad Shaneh
d9275913d3 Debugger: Fix crash when starting with expressions
Task-number: QTCREATORBUG-21087
Change-Id: I9d98bb045504d91964f4dd33ad042adba6a128ba
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2018-09-17 13:40:09 +00:00
hjk
a68e8c5b69 Debugger: Move session load/restore handling
... to breakpoint and watchhandler.

More modular this way.

Change-Id: I4a45481fcc2bfde67b164bd7274fb7b2a12cb7ac
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-29 09:38:38 +00:00
hjk
893146b8b6 Debugger: Split ToolTipManager into per-engine parts
Change-Id: If2e601a91ad2a0e5ba30916a5d1f2312ecff944f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-28 14:14:21 +00:00
hjk
4b7a9ae5db Debugger: Replace Internal::mainWindow
... by DebuggerMainWindow::instance() and clean up a few uses.

Change-Id: I7ae4073aa97fc2f00108533bed91db330b07880f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-23 13:55:56 +00:00
hjk
3b5ecac238 Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.

The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.

Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.

Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.

The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.

There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.

The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.

There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.

Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-08-17 12:35:15 +00:00
Alessandro Portale
0558db7b54 Debugger: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default

Change-Id: I91a6874f0d7b94e9079ab4ef07c23c60c80be9c0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-25 12:52:43 +00:00
hjk
e8ce8e3e5f Debugger: Allow stack layout to be shown in a memory view
... as opposed to an editor (only)

Change-Id: Ideb176b961afef8674a7597f1b18a90c48e5e9f8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-06-25 13:44:40 +00:00
hjk
b0e31ddf43 Debugger: Make "Memory Editor Showing Stack Layout" easier accessible
The restriction to a local active item is not needed, as the whole
submenu will be deactivated when the debugger is not debugging.

Change-Id: I36f5098d549dcb72f474caad8cfd13a6aa961212
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-06-25 09:33:35 +00:00
hjk
a2798bc2fc Debugger: Add a menu separator between memory views and editors
Change-Id: Ie642bab6fb8a34f6f9d071a22a264641601ca08c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-06-25 09:16:12 +00:00
Eike Ziller
3bbe535b95 Merge remote-tracking branch 'origin/4.7'
Change-Id: I3c5d7e9e8c589ad4425cd89d61e1f572f5cb7997
2018-06-19 10:03:28 +02:00
Eike Ziller
cd7aafef50 Do not leak menus in watch model / debugger
QMenu::addMenu does not take ownership, and QMenu::popup doesn't delete
the menu either.

Change-Id: Ia11170db6538c1019d06b3fd84bb79b1241b0b9d
Reviewed-by: hjk <hjk@qt.io>
2018-06-14 13:05:19 +00:00
hjk
4feb2259d9 Debugger: Code cosmetics
Sprinkling in const and ranged for.

Change-Id: I5d11d57f64140021397c23734c7373544ebebb6f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-31 07:10:47 +00:00
Orgad Shaneh
68e3da84f3 Debugger: Fix brace indentation
Change-Id: I2a09543a47af48af3ed8bf20c75eedfd0aa1a5ed
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-05 08:13:08 +00:00
Orgad Shaneh
7a4499d889 Debugger: Add missing breaks
Detected by GCC8.

Change-Id: I2bb6b20e5d2b8a930ef3e935e40a66a24cd1fd8e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-05 08:13:04 +00:00
hjk
c050d916ce Debugger: Use TypedTreeItem's typed parent ability for WatchItems
Less "user code".

Change-Id: Idf4e0a950761bd0184f2844c45415d5bdb8cd51a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-03-08 14:45:01 +00:00
hjk
1b87d19a64 Debugger: Modernize
Mostly nullptr instead of 0, but also a few bits of collateral damage.

Change-Id: I921991272aca921dcdecf302dfff3716e79dfc24
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-01 10:28:54 +00:00
hjk
78513ecd8f Debugger: Split Expressions view into dock of its own
Change-Id: Ie86a5bd72c3140219f925835a065d9f6a3ae0ea4
Task-number: QTCREATORBUG-19167
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-06 11:53:57 +00:00
Ulf Hermann
47886969cc Drop unused variables and lambda captures
Also, add context to connect() expressions where we are or were
capturing "this".

Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 09:06:53 +00:00
Christian Stenger
cd51ff7c0f Utils: Fix typo in function name
Change-Id: Ibd973f68d291731dab06ef1b7eee902be19601a5
Reviewed-by: hjk <hjk@qt.io>
2017-09-05 13:49:23 +00:00
Tobias Hunger
4ef01c961e app_version.h: Make IDE name configurable
Change-Id: I993f452c8d09cf89e9a2958fc8e36b7d2c17ee6f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-05 10:19:48 +00:00
Orgad Shaneh
6b0e1bc5f8 Merge remote-tracking branch 'origin/4.3' into master
Change-Id: I83af635dcac98e4fd78b21d8dd9dc3a27a4fdf94
2017-06-12 10:01:16 +03:00
Robert Loehning
d75bf0098b Debugger: Fix C&P mistake
Task-number: QTCREATORBUG-18331
Change-Id: I2d9ac0f8add3beaa6b6c4afe70113645121cb5f6
Reviewed-by: hjk <hjk@qt.io>
2017-06-02 12:08:15 +00:00
Alessandro Portale
3624a663d8 Reduce usage of qApp in favor of static function calls
Q*Application classes have unusually many static functions. In many
cases in our code, these functions are unnecessarily called as instance
functions, using the qApp helper.

This patch replaces many occurencies of qApp with the according
Q*Application classname.

Change-Id: I6099a419fa7bf969891269c37ed7a9e817ef5124
Reviewed-by: hjk <hjk@qt.io>
2017-04-24 18:36:28 +00:00
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