aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2022-05-05 09:04:18 +0200
committerChristian Stenger <christian.stenger@qt.io>2022-05-05 07:42:09 +0000
commit1346ffc15906b11aa74dc59e37893c813d18a8d4 (patch)
treea27dc4d0a227ac841700a04a539ffd7ea2065223
parent59161e22f224754323dfaea053b1dcdaaaf7d4ac (diff)
Dumper: Fix offsets for QFile members
Change-Id: I890b3f387505cf5acc8783e3dc7088515d6934cc Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--share/qtcreator/debugger/qttypes.py18
-rw-r--r--tests/auto/debugger/tst_offsets.cpp14
2 files changed, 25 insertions, 7 deletions
diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py
index d940341e20..2c7725260d 100644
--- a/share/qtcreator/debugger/qttypes.py
+++ b/share/qtcreator/debugger/qttypes.py
@@ -656,17 +656,25 @@ def qdump__QFile(d, value):
# 9fc0965 and a373ffcd change the layout of the private structure
qtVersion = d.qtVersion()
is32bit = d.ptrSize() == 4
- if qtVersion >= 0x060000:
- # FIXME: values 0 are wrong. As the file name is the
- # only direct member of QFilePrivate, the offsets are
- # equal to sizeof(QFileDevicePrivate), the base class.
+ # FIXME: values 0 are wrong. As the file name is the
+ # only direct member of QFilePrivate, the offsets are
+ # equal to sizeof(QFileDevicePrivate), the base class.
+ if qtVersion >= 0x060300 and d.qtTypeInfoVersion() >= 22:
+ if d.isWindowsTarget():
+ if d.isMsvcTarget():
+ offset = 0 if is32bit else 424
+ else:
+ offset = 0 if is32bit else 424
+ else:
+ offset = 300 if is32bit else 424
+ elif qtVersion >= 0x060000 and d.qtTypeInfoVersion() >= 20:
if d.isWindowsTarget():
if d.isMsvcTarget():
offset = 0 if is32bit else 304
else:
offset = 0 if is32bit else 304
else:
- offset = 0 if is32bit else 304
+ offset = 196 if is32bit else 304
elif qtVersion >= 0x050600 and d.qtTypeInfoVersion() >= 17:
# Some QRingBuffer member got removed in 8f92baf5c9
if d.isWindowsTarget():
diff --git a/tests/auto/debugger/tst_offsets.cpp b/tests/auto/debugger/tst_offsets.cpp
index 36beacd8e6..8490e90b2a 100644
--- a/tests/auto/debugger/tst_offsets.cpp
+++ b/tests/auto/debugger/tst_offsets.cpp
@@ -157,7 +157,17 @@ void tst_offsets::offsets_data()
const int qtVersion = QT_VERSION;
const quintptr qtTypeVersion = qtHookData[6];
- if (qtTypeVersion >= 20)
+ if (qtTypeVersion >= 22)
+#ifdef Q_OS_WIN
+# ifdef Q_CC_MSVC
+ OFFSET_TEST(QFilePrivate, fileName) << 0 << 424;
+# else // MinGW
+ OFFSET_TEST(QFilePrivate, fileName) << 0 << 424;
+# endif
+#else
+ OFFSET_TEST(QFilePrivate, fileName) << 300 << 424;
+#endif
+ else if (qtTypeVersion >= 20)
#ifdef Q_OS_WIN
# ifdef Q_CC_MSVC
OFFSET_TEST(QFilePrivate, fileName) << 0 << 304;
@@ -165,7 +175,7 @@ void tst_offsets::offsets_data()
OFFSET_TEST(QFilePrivate, fileName) << 0 << 304;
# endif
#else
- OFFSET_TEST(QFilePrivate, fileName) << 0 << 304;
+ OFFSET_TEST(QFilePrivate, fileName) << 196 << 304;
#endif
else if (qtVersion > 0x50600 && qtTypeVersion >= 17)
#ifdef Q_OS_WIN