Qt VS Code Extensions Manual Tests Debugger: Difference between revisions
No edit summary |
No edit summary |
||
(18 intermediate revisions by the same user not shown) | |||
Line 21: | Line 21: | ||
| | | | ||
|+ | |+ | ||
|Have the Qt C++ Extension Pack installed | |Have the Qt C++ Extension Pack installed and a Qt installation registered | ||
| | | | ||
|} | |} | ||
Line 28: | Line 28: | ||
This is the debugging_helpers vscodeext submodule. | This is the debugging_helpers vscodeext submodule. | ||
To use the latest vs-debugtools, use a local vscodeext. | To use the latest vs-debugtools, use a local [https://github.com/qt-labs/vscodeext/ vscodeext]. | ||
To set up everything, run: | To set up everything, run: | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
Line 62: | Line 62: | ||
|QByteArray | |QByteArray | ||
|qByteArray | |qByteArray | ||
| | |[[File:Expectation.png|100px|thumb|left]] | ||
| | | | ||
|+ | |+ | ||
Line 68: | Line 68: | ||
|qChar | |qChar | ||
| | | | ||
| | |ok | ||
|+ | |+ | ||
|QDate | |QDate | ||
|qDate | |qDate | ||
| | |qDate: QDate = {julian day = [http://www.chemie.fu-berlin.de/cgi-bin/jdate?heute/ today]} | ||
| | |||
jd: qint64 = [http://www.chemie.fu-berlin.de/cgi-bin/jdate?heute/ today] | |||
|ok | |||
|+ | |+ | ||
|QDate with currentDateTime() | |QDate with currentDateTime() | ||
|qDateTimeLocal | |qDateTimeLocal | ||
| | | | ||
| | |QDateTime missing from natvis | ||
|+ | |+ | ||
|QDate with currentDateTimeUtc() | |QDate with currentDateTimeUtc() | ||
Line 92: | Line 94: | ||
|QDate with currentDateTimeUtc() South Pole | |QDate with currentDateTimeUtc() South Pole | ||
|qDateTimeSouthPole | |qDateTimeSouthPole | ||
| | | | ||
| | | | ||
Line 124: | Line 125: | ||
|qDir | |qDir | ||
| | | | ||
| | |missing from natvis | ||
|+ | |+ | ||
|QFile | |QFile | ||
|qFile | |qFile | ||
| | | | ||
| | |missing from natvis | ||
|+ | |+ | ||
|QFileInfo | |QFileInfo | ||
|qFileInfo | |qFileInfo | ||
| | | | ||
| | |missing from natvis | ||
|+ | |+ | ||
|enum SelectionFlags | |enum SelectionFlags | ||
|qFlags | |qFlags | ||
| | | | ||
| | |QFlagStorageHelper missing from natvis | ||
|+ | |+ | ||
|QJsonDocument | |QJsonDocument | ||
|qJsonDocument | |qJsonDocument | ||
| | | | ||
| | |missing from natvis | ||
|+ | |+ | ||
|QLine | |QLine | ||
|qLine | |qLine | ||
| | |qline: QLine = { start point = { x = 0, y = 0 }, end point = { x = 42, y = 42 } } | ||
| | |||
[Raw View] = {...} | |||
pt1: QPoint = { x = 0, y = 0 } | |||
pt2: QPoint = { x = 42, y = 42 } | |||
|ok | |||
|+ | |+ | ||
|QPoint | |QPoint | ||
|qPoint | |qPoint | ||
| | |qPoint: QPoint = { x = 24, y = 48} | ||
| | |||
[x]: int = 24 | |||
[y]: int = 48 | |||
[Raw View] = {...} | |||
xp: int = 24 | |||
yp: int = 48 | |||
|ok | |||
|+ | |+ | ||
|QPointF | |QPointF | ||
|qPointF | |qPointF | ||
| | |qPoint: QPoint = { x = 24.5, y = 48.5} | ||
| | |||
[x]: int = 24.5 | |||
[y]: int = 48.5 | |||
[Raw View] = {...} | |||
xp: int = 24.5 | |||
yp: int = 48.5 | |||
|ok | |||
|+ | |+ | ||
|QRect | |QRect | ||
|qRect | |qRect | ||
| | |qRect: QRect = { x = 5, y = 5, width = 42, height = 42 } | ||
| | |||
[x]: int = 5 | |||
[y]: int = 5 | |||
[width]: int = 42 | |||
[height]: int = 42 | |||
[Raw View] = {...} | |||
x1: int = 5 | |||
y1: int = 5 | |||
x2: int = 46 | |||
y2: int = 46 | |||
|ok | |||
|+ | |+ | ||
|QRectF | |QRectF | ||
|qRectF | |qRectF | ||
| | |qRectF: QRectF = { x = 5.5, y = 5.5, width = 4.20[...], height = 4,20[...] } | ||
| | |||
[x]: int = 5.5 | |||
[y]: int = 5,5 | |||
[width]: int = 4.20[...] | |||
[height]: int = 4.20[...] | |||
[Raw View] = {...} | |||
xp: int = 5.5 | |||
yp: int = 5.5 | |||
w: int = 4.20[...] | |||
h: int = 4.20[...] | |||
|ok | |||
|+ | |+ | ||
|QSize | |QSize | ||
|qSize | |qSize | ||
| | | | ||
| | |ok | ||
|+ | |+ | ||
|QSizeF | |QSizeF | ||
|qSizeF | |qSizeF | ||
| | | | ||
| | |ok | ||
|+ | |+ | ||
|QString | |QString | ||
|qString | |qString | ||
| | | | ||
| | |ok | ||
|+ | |+ | ||
|QStringView | |QStringView | ||
|qStringView | |qStringView | ||
| | | | ||
| | |error | ||
|+ | |+ | ||
|QTime | |QTime | ||
|qTime | |qTime | ||
| | | | ||
|[https://bugreports.qt.io/browse/VSCODEEXT-160?filter=27222/ VSCODEEXT-160] | |error [https://bugreports.qt.io/browse/VSCODEEXT-160?filter=27222/ VSCODEEXT-160] | ||
|+ | |+ | ||
|QUrl | |QUrl | ||
|qUrl | |qUrl | ||
| | | | ||
|[https://bugreports.qt.io/browse/VSCODEEXT-159?filter=27222/ VSCODEEXT-159] | |error [https://bugreports.qt.io/browse/VSCODEEXT-159?filter=27222/ VSCODEEXT-159] | ||
|+ | |+ | ||
|QUuid | |QUuid | ||
| | | | ||
| | | | ||
|[https://bugreports.qt.io/browse/VSCODEEXT-161?filter=27222/ VSCODEEXT-161] | |Error: Unrecognized format of field "value" in result | ||
[https://bugreports.qt.io/browse/VSCODEEXT-161?filter=27222/ VSCODEEXT-161] | |||
|+ | |+ | ||
|'''Container Types''' | |'''Container Types''' | ||
Line 211: | Line 280: | ||
| qByteArrayList | | qByteArrayList | ||
| | | | ||
| | |missing from natvis | ||
|+ | |+ | ||
|QHash | |QHash | ||
|qHash | |qHash | ||
| | | | ||
| | |content not shown | ||
|+ | |+ | ||
|QMap | |QMap | ||
|qMap | |qMap | ||
| | | | ||
| | |error | ||
|+ | |+ | ||
|QMultiHash | |QMultiHash | ||
|qMultiHash | |qMultiHash | ||
| | | | ||
| | |displayed size is 2 instead of 4 | ||
content not shown | |||
|+ | |+ | ||
|QSet | |QSet | ||
|qSet | |qSet | ||
| | | | ||
|content not shown | |||
|+ | |||
|QStringList | |||
|qStringList | |||
| | | | ||
|missing from natvis | |||
|+ | |+ | ||
|QVarLengthArray | |QVarLengthArray | ||
|qVarLengthArray | |qVarLengthArray | ||
| | | | ||
| | |error | ||
|+ | |+ | ||
|std::map<int, QString> | |std::map<int, QString> | ||
|stdMap | |stdMap | ||
| | | | ||
| | |error with QString | ||
|+ | |+ | ||
|std::unordered_map<int, QString> | |std::unordered_map<int, QString> | ||
|stdUnorderedMap | |stdUnorderedMap | ||
| | | | ||
| | |error with QString | ||
|+ | |+ | ||
|std::unordered_multimap<int, QString> | |std::unordered_multimap<int, QString> | ||
|stdUnorderedMultimap | |stdUnorderedMultimap | ||
| | | | ||
| | |error with QString | ||
|+ | |+ | ||
|std::unordered_set<std::string> | |std::unordered_set<std::string> | ||
|stdSet | |stdSet | ||
| | | | ||
| | |no Qt type here | ||
|+ | |+ | ||
|'''Variant Types''' | |'''Variant Types''' | ||
Line 629: | Line 705: | ||
| | | | ||
| error | | error | ||
|+ | |||
|'''Network Types''' | |||
|+ | |||
|QHostAddress | |||
|qHostAddress | |||
| | |||
| missing from natvis | |||
|+ | |||
|QHostAddress | |||
|qHostAddressV4 | |||
| | |||
| missing from natvis | |||
|+ | |||
|QHostAddress | |||
|qHostAddressV6 | |||
| | |||
| missing from natvis | |||
|+ | |||
|QHostInfo | |||
|qHostInfo | |||
| | |||
| missing from natvis | |||
|+ | |||
|'''Gui Types''' | |||
|+ | |||
|QBitmap | |||
|qBitmap | |||
| | |||
|missing from natvis | |||
|+ | |||
|QBrush | |||
|qBrush | |||
| | |||
|missing from natvis | |||
|+ | |||
|QCursor | |||
|qCursor | |||
| | |||
|missing from natvis | |||
|+ | |||
|QFont | |||
|qFont | |||
| | |||
|missing from natvis | |||
|+ | |||
|QImage | |||
|qImage | |||
| | |||
|missing from natvis | |||
|+ | |||
|QKeySequence | |||
|qKeySequence | |||
| | |||
|missing from natvis | |||
|+ | |||
|QMatrix4x4 | |||
|qMatrix4x4 | |||
|float with identity matrix | |||
|ok | |||
|+ | |||
|QPalette | |||
|qPalette | |||
| | |||
|missing from natvis | |||
|+ | |||
|QPen | |||
|qPen | |||
| | |||
|missing from natvis | |||
|+ | |||
|QPicture | |||
|qPicture | |||
| | |||
|missing from natvis | |||
|+ | |||
|QPixmap | |||
|qPixmap | |||
| | |||
|missing from natvis | |||
|+ | |||
|QPolygon | |||
|qPolygon | |||
| | |||
|warning | |||
|+ | |||
|QPolygonF | |||
|qPolygonF | |||
| | |||
|warning | |||
|+ | |||
|QQuaternion | |||
|qQuaternion | |||
| | |||
|missing from natvis | |||
|+ | |||
|QRegion | |||
|qRegion | |||
| | |||
|missing from natvis | |||
|+ | |||
|QTransform | |||
|qTransform | |||
| | |||
|missing from natvis | |||
|+ | |||
|QVector2D | |||
|qVector2D | |||
| | |||
|ok | |||
|+ | |||
|QVector3D | |||
|qVector3D | |||
| | |||
|ok | |||
|+ | |||
|QVector4D | |||
|qVector4D | |||
| | |||
|ok | |||
|+ | |||
|Widget Types | |||
|+ | |||
|QSizePolicy | |||
|qSizePolicy | |||
| | |||
|error | |||
|+ | |||
|QWidget | |||
|qWidget | |||
| | |||
|} | |||
{| class="wikitable" | |||
!Pre-requisit | |||
!Result | |||
!Annotation | |||
|+ | |||
|'''From other test files''' [https://codereview.qt-project.org/c/qt/qtbase/+/560899/ here] | |||
|+ | |+ | ||
|QBasicAtomicInteger | |QBasicAtomicInteger | ||
| | | | ||
|Type is QAtomicOps<int> instead of QBasicAtomicInteger<int> | |Type is QAtomicOps<int> instead of QBasicAtomicInteger<int> | ||
In Raw View value type is <int> instead of std::atomic<int> | In Raw View value type is <int> instead of std::atomic<int> | ||
|+ | |+ | ||
|QBasicAtomicPointer | |QBasicAtomicPointer | ||
| | | | ||
|Raw View type is QBasicAtomicPointer<void>::AtomicType instead of QBasicAtomicPointer<void> | |Raw View type is QBasicAtomicPointer<void>::AtomicType instead of QBasicAtomicPointer<void> | ||
|+ | |+ | ||
|QChar QChar_Latin1 | |QChar QChar_Latin1 | ||
| | | | ||
|Raw View is not as expected. No latin 1 nor unicode, only ucs. The type and value of ucs are as expected. Need to check those of latin 1 and unicode though. | |Raw View is not as expected. No latin 1 nor unicode, only ucs. The type and value of ucs are as expected. Need to check those of latin 1 and unicode though. | ||
|+ | |+ | ||
|QChar QChar_non_Latin1 | |QChar QChar_non_Latin1 | ||
| | | | ||
|See QChar_Latin1, values are not as expected | |See QChar_Latin1, values are not as expected | ||
|+ | |+ |
Latest revision as of 14:21, 8 April 2025
This is about catching the Qt types not properly understood by the debugger.
Found problems are to be reported in https://bugreports.qt.io/browse/VSCODEEXT-154?filter=27222
Auto test is meant to replace the manual testing
Pre-requisit | Result | Annotation |
---|---|---|
Have VS code installed (https://code.visualstudio.com/docs/setup/setup-overview) | ||
Have a Qt installation (https://account.qt.io/s/downloads) | ||
Have the Qt C++ Extension Pack installed and a Qt installation registered |
The natvis files and the related test files are located in the qt-labs/vs-debugtools repo. This is the debugging_helpers vscodeext submodule.
To use the latest vs-debugtools, use a local vscodeext. To set up everything, run:
npm ci
git submodule update --init --remote --recursive
npm run prepareNatvisFiles
npm run all_dev
To access the test files, open debugging_helper and make sure .vscode/setting.json has:
"cmake.useCMakePresets": "never"
since CMakePresets are not supported and block Qt kit visibility (ongoing).
Select a Qt kit.
In test-app/main.cpp, place a break point at the return call.
Check that the debugger output is as expected.
This is a work in progress, need to use the latest natvis files from https://github.com/narnaud/natvis4qt (to be moved to qt-labs/vs-debugtools QTVSADDINBUG-1310)
Qt6 Tested type | Variable Name | Expectation | Result |
---|---|---|---|
Core Types | |||
QByteArray | qByteArray | ||
QChar | qChar | ok | |
QDate | qDate | qDate: QDate = {julian day = today}
jd: qint64 = today |
ok |
QDate with currentDateTime() | qDateTimeLocal | QDateTime missing from natvis | |
QDate with currentDateTimeUtc() | qDateTimeUtc | ||
QDate with currentDateTimeUtc() Asia | qDateTimeBrunei | ||
QDate with currentDateTimeUtc() South Pole | qDateTimeSouthPole | ||
QDate with currentDateTimeUtc() Canada | qDateTimeYukon | ||
QDate with currentDateTimeUtc() Pacific | qDateTimeMarquesas | ||
QDate with currentDateTimeUtc() Troll | qDateTimeShouldFail | ||
QDate with currentDateTimeUtc() | qDateTimeSecOffset | ||
QDate default | qDateTimeDefault | ||
QDir | qDir | missing from natvis | |
QFile | qFile | missing from natvis | |
QFileInfo | qFileInfo | missing from natvis | |
enum SelectionFlags | qFlags | QFlagStorageHelper missing from natvis | |
QJsonDocument | qJsonDocument | missing from natvis | |
QLine | qLine | qline: QLine = { start point = { x = 0, y = 0 }, end point = { x = 42, y = 42 } }
[Raw View] = {...} pt1: QPoint = { x = 0, y = 0 } pt2: QPoint = { x = 42, y = 42 } |
ok |
QPoint | qPoint | qPoint: QPoint = { x = 24, y = 48}
[x]: int = 24 [y]: int = 48 [Raw View] = {...} xp: int = 24 yp: int = 48 |
ok |
QPointF | qPointF | qPoint: QPoint = { x = 24.5, y = 48.5}
[x]: int = 24.5 [y]: int = 48.5 [Raw View] = {...} xp: int = 24.5 yp: int = 48.5 |
ok |
QRect | qRect | qRect: QRect = { x = 5, y = 5, width = 42, height = 42 }
[x]: int = 5 [y]: int = 5 [width]: int = 42 [height]: int = 42 [Raw View] = {...} x1: int = 5 y1: int = 5 x2: int = 46 y2: int = 46 |
ok |
QRectF | qRectF | qRectF: QRectF = { x = 5.5, y = 5.5, width = 4.20[...], height = 4,20[...] }
[x]: int = 5.5 [y]: int = 5,5 [width]: int = 4.20[...] [height]: int = 4.20[...] [Raw View] = {...} xp: int = 5.5 yp: int = 5.5 w: int = 4.20[...] h: int = 4.20[...] |
ok |
QSize | qSize | ok | |
QSizeF | qSizeF | ok | |
QString | qString | ok | |
QStringView | qStringView | error | |
QTime | qTime | error VSCODEEXT-160 | |
QUrl | qUrl | error VSCODEEXT-159 | |
QUuid | Error: Unrecognized format of field "value" in result | ||
Container Types | |||
QByteArrayList | qByteArrayList | missing from natvis | |
QHash | qHash | content not shown | |
QMap | qMap | error | |
QMultiHash | qMultiHash | displayed size is 2 instead of 4
content not shown |
|
QSet | qSet | content not shown | |
QStringList | qStringList | missing from natvis | |
QVarLengthArray | qVarLengthArray | error | |
std::map<int, QString> | stdMap | error with QString | |
std::unordered_map<int, QString> | stdUnorderedMap | error with QString | |
std::unordered_multimap<int, QString> | stdUnorderedMultimap | error with QString | |
std::unordered_set<std::string> | stdSet | no Qt type here | |
Variant Types | |||
QVariant | v_null; | ||
QVariant | v_bool | error | |
QVariant | v_int | error | |
QVariant | v_uint | error | |
QVariant | v_double | error | |
QVariant | v_qChar | error | |
QVariant | v_qString | error | |
QVariant | v_qByteArray | error | |
QVariant | v_nullPtr | error | |
QVariant | v_voidStar | error | |
QVariant | v_long | error | |
QVariant | v_longLong | error | |
QVariant | v_short | error | |
QVariant | v_char | error | |
QVariant | v_char16 | error | |
QVariant | v_char32 | error | |
QVariant | v_ulong | error | |
QVariant | v_ulongLong | error | |
QVariant | v_ushort | error | |
QVariant | v_schar | error | |
QVariant | v_uchar | error | |
QVariant | v_float | error | |
QVariant | v_qfloat16 | error | |
QVariant | v_qObjectStar | error | |
QVariant | v_qCursor | error | |
QVariant | v_qDate | error | |
QVariant | v_qSize | error | |
QVariant | v_qTime | error | |
QVariant | v_qVariantList | error | |
QVariant | v_qPolygon | error | |
QVariant | v_qPolygonF | error | |
QVariant | v_qColor | error | |
QVariant | v_qColorSpace | error | |
QVariant | v_qSizeF | error | |
QVariant | v_qRectF | error | |
QVariant | v_qLine | error | |
QVariant | v_qStringList | error | |
QVariant | v_qVariantMap | error | |
QVariant | v_qVariantHash | error | |
QVariant | v_qVariantPair | error | |
QVariant | v_qIcon | error | |
QVariant | v_qPen | error | |
QVariant | v_qLineF | error | |
QVariant | v_qTextFormat | error | |
QVariant | v_qRect | error | |
QVariant | v_qPoint | error | |
QVariant | v_qUrl | error | |
QVariant | v_qRegularExpression | error | |
QVariant | v_qDateTime | error | |
QVariant | v_qPointF | error | |
QVariant | v_qPalette | error | |
QVariant | v_qFont | error | |
QVariant | v_qBrush | error | |
QVariant | v_qRegion | error | |
QVariant | v_qBitArray | error | |
QVariant | v_qImage | error | |
QVariant | v_qKeySequence | error | |
QVariant | v_qSizePolicy | error | |
QVariant | v_qPixmap | error | |
QVariant | v_qLocale | error | |
QVariant | v_qBitmap | error | |
QVariant | v_qTransform | error | |
QVariant | v_qMatrix4x4 | error | |
QVariant | v_qVector2D | error | |
QVariant | v_qVector3D | error | |
QVariant | v_qVector4D | error | |
QVariant | v_qQuaternion | error | |
QVariant | v_qEasingCurve | error | |
QVariant | v_qModelIndex | error | |
QVariant | v_qPersistentModelIndex | error | |
QVariant | v_qUuid | error | |
QVariant | v_qByteArrayList | error | |
QVariant | v_qVariant | error | |
QVariant | v_userType | error | |
Network Types | |||
QHostAddress | qHostAddress | missing from natvis | |
QHostAddress | qHostAddressV4 | missing from natvis | |
QHostAddress | qHostAddressV6 | missing from natvis | |
QHostInfo | qHostInfo | missing from natvis | |
Gui Types | |||
QBitmap | qBitmap | missing from natvis | |
QBrush | qBrush | missing from natvis | |
QCursor | qCursor | missing from natvis | |
QFont | qFont | missing from natvis | |
QImage | qImage | missing from natvis | |
QKeySequence | qKeySequence | missing from natvis | |
QMatrix4x4 | qMatrix4x4 | float with identity matrix | ok |
QPalette | qPalette | missing from natvis | |
QPen | qPen | missing from natvis | |
QPicture | qPicture | missing from natvis | |
QPixmap | qPixmap | missing from natvis | |
QPolygon | qPolygon | warning | |
QPolygonF | qPolygonF | warning | |
QQuaternion | qQuaternion | missing from natvis | |
QRegion | qRegion | missing from natvis | |
QTransform | qTransform | missing from natvis | |
QVector2D | qVector2D | ok | |
QVector3D | qVector3D | ok | |
QVector4D | qVector4D | ok | |
Widget Types | |||
QSizePolicy | qSizePolicy | error | |
QWidget | qWidget |
Pre-requisit | Result | Annotation |
---|---|---|
From other test files here | ||
QBasicAtomicInteger | Type is QAtomicOps<int> instead of QBasicAtomicInteger<int>
In Raw View value type is <int> instead of std::atomic<int> |
|
QBasicAtomicPointer | Raw View type is QBasicAtomicPointer<void>::AtomicType instead of QBasicAtomicPointer<void> | |
QChar QChar_Latin1 | Raw View is not as expected. No latin 1 nor unicode, only ucs. The type and value of ucs are as expected. Need to check those of latin 1 and unicode though. | |
QChar QChar_non_Latin1 | See QChar_Latin1, values are not as expected | |
QPair<int, int> | type show is QPair<int, int> instead of expected std::pair<int,int> |