Commit Graph

653 Commits

Author SHA1 Message Date
hjk
efae651924 Utils: Introduce a convenience function creatorColor()
... forwarding to creatorTheme()->color(...)

Change-Id: Iefaa043495127b3e500ed225584481d3ec0f8c1f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-29 13:49:25 +00:00
hjk
f30d369b99 Fix QMetaType::type() related deprecation warnings
Not in sdktool, which still builds with Qt 5.15

Change-Id: I6e6f4331127b821e471e2840e7959cd65e6419e9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-05-23 13:04:22 +00:00
David Schulz
15e56078b6 Debugger: Improve keyboard navigation in locals view
Expanding items in the locals view results in replacing the original
tree item with a newly created one. This ultimately resets the selection
and the current item of the view, which in turn makes it cumbersome to
navigate by keyboard.

Save a list of selected inames and the iname of the current index when
requesting the update and try to reselect them after the update
finished.

Fixes: QTCREATORBUG-27569
Change-Id: I9d8f51631e4ee490e19307877cbef44798506016
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-04-30 10:56:02 +00:00
Eike Ziller
720ab253b1 German translation: Debugger
Change-Id: Ib650492a2a1c5cc1e8e1dcf5fd87e0b638239a9d
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-03-18 08:36:05 +00:00
Christian Stenger
27c02d94af Debugger: Fix persisting of debugger settings
When triggering them from the context menu while debugging.
Fix used settings group when triggering writeSettings() on
the aspect instead of the AspectContainer.
Explicitly persist respective settings when triggering them
on the context menu.

Fixes: QTCREATORBUG-30491
Change-Id: I6f429bb54630cbe61c8b2ee063028f323a2d08f6
Reviewed-by: hjk <hjk@qt.io>
2024-03-11 10:46:22 +00:00
hjk
8ab6b94c48 Debugger: Move string length annotation to type column
... and make it clear what it is.

Fixes: QTCREATORBUG-30065
Change-Id: Iccbe0f069569ef2682363eb889f34081e2c2b4d7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-02-16 07:32:39 +00:00
hjk
a26aff7afd Debugger: Report full sizes instead of the elide setup
More direct communication of the meaning. Use 'length' when talking
about things like string lengths, and 'size' for sizes in bytes.

Task-number:  QTCREATORBUG-30065
Change-Id: Ifed84a5dab4ed890973c1abf4d427655eb50a61a
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-02-13 17:01:23 +00:00
hjk
02d930b210 Debugger: Improve display of elided string data
This was not adding the length before.

The problem that the size is suddenly off by a factor of two for
QString as elision counts bytes is still present.

Change-Id: Ibcb595dc2d9aaa73b3feec955b4d14613307797f
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-02-13 17:00:23 +00:00
Christian Stenger
2bc0572553 Debugger: Display length of quoted values
Reverts 6515f935d6 as this breaks
the dumper tests and moves the handling from the protocol to
the item, so this now only happens for the gui.

Change-Id: Ia15d5ead5c549585f4e90cc46d629961ea7d5974
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-01-30 07:03:07 +00:00
Marcus Tillmanns
4593089bdc Debugger: Check return value
Coverity complains about not checking the return value of f.open()

Coverity-Id: 1359453
Change-Id: I9e6b7f5d3ab6ec58e99131e8a0d84d8f17863fed
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-02 14:42:52 +00:00
Artem Sokolovskii
6d92639a2d DAP: Update expanded variables over debugging process
Update and save expanded variables over debugging process

Change-Id: Iff35389fb5e56c0cde549565e88288e4bc9b52e7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-09-28 12:43:02 +00:00
hjk
342e066886 Utils, all: Standardize on QtcSettings
Change-Id: Id222016f15b1c3bfe6710fe5d0297666d4565ef1
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-27 13:25:31 +00:00
hjk
a5e773aeee Debugger: Adapt to latest settings access style
Change-Id: I14f737612b4fe6a37e650190b587ef0b04e559ea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-14 08:39:08 +00:00
Eike Ziller
dff9e1463b Reduce usage of app_version header
Most information is available via Q(Core|Gui)Application.
Add an AppInfo structure for the things that are not.

This avoids that the information ends up duplicated and
hardcoded in the plugins, which is not needed or desired.

Change-Id: I4d565e75c42a7b8facafa90c27096ea49359215d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-26 06:57:46 +00:00
hjk
d0cf49db47 Debugger: Handle some Qt deprecation warnings
Change-Id: I93c9f91642bc5f5bd43ebb80cb489782978db327
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-12 13:16:07 +00:00
Eike Ziller
edd1a89807 Move SessionManager to Core plugin
Sessions are independent from projects, and this allows for removal of
e.g. the dependency from Bookmarks to ProjectExplorer.

Includes moving the command line arguments (-lastsession, <session>) to
Core plugin.

Change-Id: I6c578fd15c4990902e7196501de20f39376e90e8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-05-25 11:15:41 +00:00
hjk
d740a355bb Utils: Rework CheckableMessageBox
Remove function overloads, thes are hard to read, to use and to extend.
I'd even argue this should be a plain default ctor and a few setters +
exec(), pretty much like Process::start() nowadays.

Move "decider" magic into a structure that can be filled ad-hoc outside
checkablemessagebox.cpp paving the ground for:

...removing  aspect dependency from CheckableMessageBox, Instead, add a
convenience function to BoolAspect.  Arguably, the latter is not needed
and could be done on the user side.

Use pointers instead of mutable references for in-out parameter.
Makes the "specialness" visible on the user side.

Pass ICore::settings() centrally as done elsewhere to reduce line noise
on the user side.

Change-Id: Ibb366353d1ea35401723fd05ce05672617a0a8fd
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-22 06:40:13 +00:00
Marcus Tillmanns
1fc2459b62 Utils: Unify CheckableMessageBox and make it look more native
Change-Id: I5690c16f38cfd2058e01441283bec28d44cadf75
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-17 08:01:13 +00:00
hjk
c85b72000f All: Use the shorter access to aspect values in a few places
Change-Id: Ie0ff0e4e1cf4c2750897ea733dfccb743f44fa93
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-12 16:04:38 +00:00
David Schulz
ae2690e4b1 Debugger: make default number of array elements configurable
Change-Id: Iad7b653d66f9f87d818f8cce612a82a5fc391b23
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-03-07 11:14:54 +00:00
Eike Ziller
36d9341397 Merge remote-tracking branch 'origin/10.0'
Change-Id: Idf151b6cfe87957cf905e67aab6b1275b9f0506a
2023-03-06 08:24:18 +01:00
David Schulz
1124a75948 Debugger: Fix highlighting values and members in memory view
Fixes: QTCREATORBUG-23681
Change-Id: I1420385d0c923be0ae4dd7ef2662263b88623333
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-03 07:04:18 +00:00
Eike Ziller
380f7622de Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/debugger/watchhandler.cpp

Change-Id: If759b6260dfa008738d3a0ce543eb0eead8a8bba
2023-02-27 09:48:12 +01:00
David Schulz
5169469911 Debugger: add <load more> functionality to array dumper
Change-Id: Ib44748fa3218788ca20a99b0a0f4cd85716dde06
Reviewed-by: hjk <hjk@qt.io>
2023-02-27 08:35:32 +00:00
hjk
ca8d4082ec Debugger: Compress consecutive calls to updateLocalsWindow()
When expanding all children of a long array, this is called
once per item. If we have one update in the end that's enough.

Change-Id: Ibb63a9aef752418a1dcafb6190edf5a8005a855f
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-02-27 07:44:43 +00:00
hjk
7f04a66546 Debugger: Introduce a cache for pre-rendered value columne entries
Change-Id: Ibdcac8a5ccaa3eab0723205b913056530c510280
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-02-24 15:08:20 +00:00
hjk
040ebf8171 Debugger: Suppress a message clogging the log view
Eats time and won't be handled soon.

Change-Id: I777bef10397d0d67daf576862975c4d4f1184504
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-02-24 12:45:47 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Marcus Tillmanns
e31d7b227e Debugger: Fix crash when showing characters > 0x7FFFFFFF
Change-Id: If9e1e235ea7b5288a29ca8f3a17e75dea3c57978
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-11 13:52:29 +00:00
Marcus Tillmanns
3af72077a0 Debugger: Fix crash when showing characters > 0xffff
Change-Id: I8eb1492f7ba9fbe846e18e7e93bd8ca57edf177d
Reviewed-by: hjk <hjk@qt.io>
2022-08-11 07:57:37 +00:00
Jarek Kobus
1b070bcb11 Drop Qt5: Debugger: Get rid of QOverload
Change-Id: Ic62a3173adeffdfa78a47849cf1ceaa4f59b8091
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-20 13:13:21 +00:00
Thiago Macieira
d4ed6d6129 Debugger: force qfloat16 to float to print
It'll get a _Float16 cast operator, which will cause ambiguous overloads:

watchhandler.cpp:782:24: error: ambiguous overload for ‘operator<<’ (operand types are ‘std::ostringstream’ {aka ‘std::__cxx11::basic_ostringstream<char>’} and ‘qfloat16’)

Change-Id: Ic44396b31ba04712aab3fffd16ff43d6616878f9
Reviewed-by: hjk <hjk@qt.io>
2022-07-09 05:44:00 +00:00
hjk
9894c6eaf0 Debugger: Convert to Tr::tr
Change-Id: I5d2475c790851c68f9997ac6af72b5eaca58482d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-08 12:32:38 +00:00
hjk
d3786a895b Debugger: Use some Tr::tr in WatchModel related classes
Change-Id: I1fcd0c5f342da4fd5ff52c19eb9f3f20a9bdcc5b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-07 08:52:11 +00:00
hjk
d1b7e90b7d Use Utils::setClipboardAndSelection() more often
Change-Id: I094f07cdb1e5e8c8026bb36d0a486719567641b9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-20 13:41:12 +00:00
Evgeny Shtanov
3b373eecd4 reformatCharacter: int to QChar conversion segfault
Debugger, watchhandler: incorrect type conversion:
Converting from `int` to `unsigned int` can lead to a situation where
the result is too large to be represented as a `QChar`.

Task-number: QTCREATORBUG-27107
Change-Id: I7873635f7a1ef29f62339ffe23b4dd84cb089e2b
Reviewed-by: hjk <hjk@qt.io>
2022-06-08 09:56:12 +00:00
Artem Sokolovskii
27fddc8dc7 Debugger: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: Ib49afb4d0283aeeffead6b31e1a3d0bcb9a7ae14
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-05-03 09:32:04 +00:00
Aaron Barany
03a0ed0786 Debugger: Use queued connection for menu actions
Pass the parent calling object to the addAction() functions and use a
queued connection. This prevents the following sequence of events:

1. The menu is dismissed when selecting a menu item.
2. The deletion gets queued via deleteLater().
2. The onTriggered action gets invoked and opens a dialog box.
3. The dialog box triggers the events to be processed.
4. The menu is deleted when processing the events, while still in the
   event function to handle the dismissal.

This only affected the watch menu since the others were leaked. Added
cleanup handlers for the other debugger menus to avoid leaking them.

Task-number: QTCREATORBUG-26989
Change-Id: Ifa2c52d7bea884c55d43fa545e3e2870301e4052
Reviewed-by: hjk <hjk@qt.io>
2022-02-07 20:20:58 +00:00
hjk
1abe76549e Debugger: Add support for two more floating point display formats
1. The `std::hexfloat` representation produced by `std::sstream`.
2. Breaking the number into a normalized value and a integral power of 2,
   as does the `std::frexp()` function.

M_PI looks like "0x1.921fb54442d18p+1" and "0.785398163397 * 2^2"
respectively.

Fixes: QTCREATORBUG-26793
Change-Id: Ib08ea9408f79201434eb75ec328b94ab933259a4
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-14 12:45:42 +00:00
Orgad Shaneh
28334638ab Debugger: Fix MSVC warning
warning: C4305: '/=': truncation from 'int' to 'IntType'

with q[u]int8 template argument.

Change-Id: I0f0063191b0e51ab79f94073ead65da86ea82440
Reviewed-by: hjk <hjk@qt.io>
2022-01-04 12:46:49 +00:00
hjk
e8ae475fcf Debugger: Add a "Char Code Integer"
Fixes: QTCREATORBUG-22849
Change-Id: Id601eb5cbe1211cff595f04b5910a21f1ba33128
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-03 12:45:39 +00:00
Andre Hartmann
f9f26570c9 Debugger: Add even more std and Qt char and int types
Make more stdint, quint and char types known to the debugger.

Task-number: QTCREATORBUG-26501
Change-Id: I1e757af2a495142fa37fe2b7cefec56690adbf08
Reviewed-by: hjk <hjk@qt.io>
2021-11-09 13:30:37 +00:00
Jarek Kobus
3562c5e96e Remove unneeded includes of QProcess from cpp files
QProcess wasn't used in these files.

Change-Id: I24900bcf312eb6ea1ca3bc0c753cebb505ec552b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-11-01 12:04:41 +00:00
Andre Hartmann
78a1beb06e Debugger: Improve handling of stdint types
* Make (u)intX_t known as integral type
* Handle uint8_t[] the same way as char[] and unsigned char[]

Task-number: QTCREATORBUG-26501
Change-Id: I1eac21be198f8107f088e56daf435b5bb3217120
Reviewed-by: hjk <hjk@qt.io>
2021-10-29 13:12:02 +00:00
Orgad Shaneh
5365dd531b Fix some MSVC warnings
* Implicit conversion of size_t to int
* Comparing bool with operator >

Change-Id: I4bc5bef57bfa0125b1c82953a7a2cfc24066bc8c
Reviewed-by: hjk <hjk@qt.io>
2021-10-15 06:22:23 +00:00
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