Commit Graph

656 Commits

Author SHA1 Message Date
Andre Hartmann
a659f445c7 Debugger: Escape special chars in line annotation
By re-using the existing function quoteUnprintable()
and moving their code as escapeUnprintable() to
watchutils.

In contrast to the watches window, where the escaping
can be disabled by the context menu, the line annotations
are always escaped for simplicity.

Change-Id: I76adfd7cd70ec92ff0d7f7ea41fc30ae0057cad0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-29 11:09:04 +00:00
Miklós Márton
48383c16cb Add context menu to the separate debugger variable view window
Added a right click context menu to the tab bar of the separate
variable viewer window to being able to change the
variable display mode right there (without navigating
to the variable tree view in the main window).

Fixes: QTCREATORBUG-25762
Change-Id: Ida35f4f6d23f07e5ed45a9f2d51a5af970a95375
Reviewed-by: hjk <hjk@qt.io>
2021-05-26 06:57:54 +00:00
hjk
93a5803956 Debugger: Aspectify settings
Change-Id: I527be79965250b82a0928171b17aa93bac9fa2a0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-03 07:39:17 +00:00
Michael Weghorn
f4dc3fd5c5 Debugger: Prepend '*'s for autodereferenced pointers
If automatic dereferencing of pointers is enabled, the
"Value" and "Type" columns for pointers hold the values for
the dereferenced pointers.

In order to have a consistent behavior for the "Name" column
as well, prepend '*'s to indicate that the variable/expression
has actually been dereferenced.
Add parantheses around the original expression if it doesn't
match a simple regex for variable names, to avoid that the
leading '*' changes the meaning of the expression
(so e.g. a dereferenced 'somepointer + 1' is displayed
as  '*(somepointer + 1)' rather than '*somepointer + 1').

This introduces a new 'autoderefcount' field to propagate the
information how many levels of dereferencing have taken
place from the Python to the C++ side, which is then
used to add the leading '*'s for the display name.

Fixes: QTCREATORBUG-20907
Change-Id: Ia9a41cb42e25ba72a6d980a765dbe2b454deb8c8
Reviewed-by: hjk <hjk@qt.io>
2021-02-22 09:36:45 +00:00
Alessandro Portale
b3686d410d Debugger: Use qAsConst with non-const Qt containers in range-loops
Change-Id: I7bd27f8317b62fe448e037d5a25e78b4c88c648d
Reviewed-by: hjk <hjk@qt.io>
2021-02-17 08:03:09 +00:00
hjk
79ade10c4a Debugger: Add an option to show simple values as text annotations
Change-Id: I726d8559d7e28abd776ce483d5f670be5af09412
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-20 09:45:03 +00:00
Alessandro Portale
b2a766a79a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-19 08:42:14 +00:00
hjk
2bfd515b03 Utils: Allow BaseTreeView users to hide columns manually
... using a context menu on the header views.

Use the feature in the debugger views where it was previously
un-intuitively available as part of the main context menu of
the view, but not in the header.

Task-number: QTCREATORBUG-24384
Change-Id: I3f030c3dd8ce35dc91bad921e37d2273bfe548b5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-10 14:28:39 +00:00
hjk
fcaa6801cf Utils: Start replacing SavedActions by QAction or Utils::Aspect
First mechanical step here is to derive SavedActions from BaseAspect
instead of QAction.

Change-Id: I2ec95883b825462c1d867f83cc2b3bd2c2732055
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-05 08:46:27 +00:00
Eike Ziller
2a70bc1d09 Debugger: Fix build with Qt6
QStringRef gone.
ViewOptions changed.
MetaType register stream operators automatically.

Task-number: QTCREATORBUG-24098
Change-Id: Ibf98561af951aa5fc4ec483d18dafeaad02e07c3
Reviewed-by: hjk <hjk@qt.io>
2020-09-18 14:41:20 +00:00
Christian Stenger
e9c27cca34 Utils: Fix persisting of QRect
And pass explicitly a QVariant to the writer to avoid
unexpected behavior when trying to store the geometry
of a widget.
This resulted in a warning for any session where the
user had used the debugger at least once.

Change-Id: I5cb2352ab29ff7d2a64c84ffcdf040efe6d04b94
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-08-19 07:39:43 +00:00
Eike Ziller
d1a2de747e Debugger: Use dialogParent instead of mainWindow
Slipped through in 5b364de168

Change-Id: If316f7310b3861630b58ef9f8fb152cc30de8ef1
Reviewed-by: hjk <hjk@qt.io>
2020-06-03 11:45:48 +00:00
Christian Stenger
5104798b8c Check for selection support of clipboard
Setting the data on a non-supported MIME data will fail
and get deleted.
Checking beforehand gets rid of a warning printed by
QClipboard.

Change-Id: I5b5a371ce5b904f61a1aed5ea21a98908155357b
Reviewed-by: hjk <hjk@qt.io>
2020-05-14 13:19:18 +00:00
David Schulz
45e7b78dc3 Debugger: Add action to reset individual/type formats
Task-number: QTCREATORBUG-22922
Change-Id: Ic8d0dd1214c208869bebdd69feb2cca1213d30cd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-04-07 07:26:39 +00:00
Eike Ziller
ed5e6a4999 Add some additional shortcuts for actions
Add Cmd+Shift+- for decreasing font size on macOS.
Do not add Cmd+= for increasing size, because it conflicts with the
existing shortcut for "Replace and Find Next".

Sprinkle some Backspace shortcuts in addition to Delete for removing
items. There are (laptop) keyboards that either do not have a designated
Delete key (requiring Fn+Backspace) or where the Delete key is not
conveniently located/sized, and there is no benefit in making the
distinction in that case anyhow.

Fixes: QTCREATORBUG-706
Fixes: QTCREATORBUG-13733
Change-Id: I06274a9810b82800ec6158a883c95d2a7ae2465e
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-03-17 09:39:37 +00:00
hjk
811f4a38da Use less nullptr for empty flags
Change-Id: Ic4eafdc8f204a432a752a97593380609a408a7de
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-21 13:28:26 +00:00
Tobias Hunger
5995569063 Debugger: Avoid potential nullptr access
Item may be a nullptr, so do not access it.

Change-Id: I3fdbe30dbbd451027c23c9ed06f08396f0ce215a
Reviewed-by: hjk <hjk@qt.io>
2020-01-20 10:00:36 +00:00
Eike Ziller
e16876df0c Merge remote-tracking branch 'origin/4.11'
Change-Id: Ieb0bb1ebab9a5efb42d15bbeac2cd4c46a6de962
2019-12-18 09:14:14 +01:00
Christian Stenger
e3338f2e8a Debugger: Avoid accessing nullptr
If the context menu is spawned while stepping
the user may be able to trigger some actions
that try to access an item that had been present
before, but after the stepping the items inside
the tree view usually got completely re-created.

Change-Id: I80029bc1272cfc8b78fe0ed5b1e0f36f29920631
Reviewed-by: hjk <hjk@qt.io>
2019-12-17 08:10:03 +00:00
hjk
4bd26c3e4b Debugger: Add ability to hide view columns
Not perfect, e.g. one would probably expect the items to
appear in the context menu of the header views, too, not
just on the main background of the view, but better than
nothing.

Task-number: QTCREATORBUG-23342
Change-Id: Ifdc44dcfd390112faa7b15bb8a51d809e42d7b29
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-13 08:07:31 +00:00
David Schulz
6325590815 Debugger: Use std style iterator
Change-Id: I6f6593aa18ec9da768876413ef2d5169bce635ca
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-11-26 09:45:34 +00:00
zarelaky
7e148d8a07 Debugger: Allow changing item format for all array elements
Change-Id: I05000102d4c6b185340581029006b9254c91fcb1
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-11-25 10:52:33 +00:00
Eike Ziller
a19d905ea5 Merge remote-tracking branch 'origin/4.10' into 4.11
Change-Id: I9b53d00dbc79d52e52f6e18761e6a6c6faec6c84
2019-10-08 15:21:12 +02:00
Antonio Di Monaco
f0bd0a8baf Debugger: Fix missing watch highlight when the value changes
This patch fixes a regression introduced by
e95fd876aa

Change-Id: I8cb277858ef6c63cd26c03417f9dfeb99d96cb45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-08 08:11:20 +00:00
Eike Ziller
ac014e3875 Merge remote-tracking branch 'origin/4.10' into 4.11
Conflicts:
	src/plugins/projectexplorer/projectnodes.h

Change-Id: I10a749cca38c2d0929cf4d2b74ab089e14b6157b
2019-10-02 07:32:57 +02:00
hjk
312ff692b0 Debugger: Do not crash when displaying uninitialized QImages
Fixes: QTCREATORBUG-23031
Change-Id: I074cdaf509edac6e5659d2e976ed7188e8944d81
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-10-01 14:57:14 +00:00
Eike Ziller
21c2bf7e72 Merge remote-tracking branch 'origin/4.10'
Conflicts:
	src/plugins/python/CMakeLists.txt

Change-Id: I18808710dd99b97d4e1e7c3d223b7f814083de31
2019-08-12 17:04:12 +02:00
Eike Ziller
63c9c5124e Use common functions for handling ampersands/accelerators
Change-Id: I4c74a041a656ed547db0a7406f4306008a513879
Reviewed-by: hjk <hjk@qt.io>
2019-08-09 12:45:38 +00:00
hjk
e3b1106afa Compile fix with recent Qt dev
The reasoning in 1b4766e26c did not take into account that the scope
of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with
f70905448f6 in Qt base.

Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-29 08:54:18 +00:00
hjk
32bbf2a3b3 Debugger: Introduce a tree level above stack frames
This level is meant to take the role of current thread handler
in the long run, allowing per-thread stackviews in each engine.

For now, the additional level holds just a single, invisible
dummy item playing the role of a "current thread".

Change-Id: Ief6131500fc1aa8902f2313038a65840b80b495b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-26 06:58:03 +00:00
hjk
e95fd876aa Debugger: Make the time stamp recording option work for single items
Should help to drill down to individual expensive dumpers.

Change-Id: I983ba075231784f71dd9d5c3bda375a3ee508bf6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-12 08:32:52 +00:00
hjk
f7c350d782 TreeView: Fix mapping to source models in case ProxyModels are involved
Visible e.g. in context menu handling of the debugger's module view.

Change-Id: I342ed262c9e3dcdf98590003a7930cb8ef4ca0d2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-04-02 12:53:29 +00:00
Eike Ziller
0345bcb7cc Help: Rename handleHelpRequest to showHelpUrl
Since that is what it does.

Change-Id: I13ffe21cdb625a0df1313f2ff09bf84196f08768
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-01-25 08:23:18 +00:00
Alessandro Portale
616e19ff9e Fix warning: "Missing emit keyword on signal call"
[-Wclazy-incorrect-emit]

Change-Id: I93bdc6e23cdaccf35c9899ae16870ccc65a54f80
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-01-17 15:54:56 +00:00
Alessandro Portale
128a33548b Fix warning: "Missing reference in range-for with non trivial type"
[-Wclazy-range-loop]

Change-Id: I5dcb263c754d423740e7bce3dcb948d52f2dec67
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-16 20:22:56 +00:00
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