forked from qt-creator/qt-creator
Dumper: Fix offsets for QFile members
Change-Id: I890b3f387505cf5acc8783e3dc7088515d6934cc Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -656,17 +656,25 @@ def qdump__QFile(d, value):
|
|||||||
# 9fc0965 and a373ffcd change the layout of the private structure
|
# 9fc0965 and a373ffcd change the layout of the private structure
|
||||||
qtVersion = d.qtVersion()
|
qtVersion = d.qtVersion()
|
||||||
is32bit = d.ptrSize() == 4
|
is32bit = d.ptrSize() == 4
|
||||||
if qtVersion >= 0x060000:
|
|
||||||
# FIXME: values 0 are wrong. As the file name is the
|
# FIXME: values 0 are wrong. As the file name is the
|
||||||
# only direct member of QFilePrivate, the offsets are
|
# only direct member of QFilePrivate, the offsets are
|
||||||
# equal to sizeof(QFileDevicePrivate), the base class.
|
# 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.isWindowsTarget():
|
||||||
if d.isMsvcTarget():
|
if d.isMsvcTarget():
|
||||||
offset = 0 if is32bit else 304
|
offset = 0 if is32bit else 304
|
||||||
else:
|
else:
|
||||||
offset = 0 if is32bit else 304
|
offset = 0 if is32bit else 304
|
||||||
else:
|
else:
|
||||||
offset = 0 if is32bit else 304
|
offset = 196 if is32bit else 304
|
||||||
elif qtVersion >= 0x050600 and d.qtTypeInfoVersion() >= 17:
|
elif qtVersion >= 0x050600 and d.qtTypeInfoVersion() >= 17:
|
||||||
# Some QRingBuffer member got removed in 8f92baf5c9
|
# Some QRingBuffer member got removed in 8f92baf5c9
|
||||||
if d.isWindowsTarget():
|
if d.isWindowsTarget():
|
||||||
|
@@ -157,7 +157,17 @@ void tst_offsets::offsets_data()
|
|||||||
const int qtVersion = QT_VERSION;
|
const int qtVersion = QT_VERSION;
|
||||||
const quintptr qtTypeVersion = qtHookData[6];
|
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_OS_WIN
|
||||||
# ifdef Q_CC_MSVC
|
# ifdef Q_CC_MSVC
|
||||||
OFFSET_TEST(QFilePrivate, fileName) << 0 << 304;
|
OFFSET_TEST(QFilePrivate, fileName) << 0 << 304;
|
||||||
@@ -165,7 +175,7 @@ void tst_offsets::offsets_data()
|
|||||||
OFFSET_TEST(QFilePrivate, fileName) << 0 << 304;
|
OFFSET_TEST(QFilePrivate, fileName) << 0 << 304;
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
OFFSET_TEST(QFilePrivate, fileName) << 0 << 304;
|
OFFSET_TEST(QFilePrivate, fileName) << 196 << 304;
|
||||||
#endif
|
#endif
|
||||||
else if (qtVersion > 0x50600 && qtTypeVersion >= 17)
|
else if (qtVersion > 0x50600 && qtTypeVersion >= 17)
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
Reference in New Issue
Block a user