From 5ea655cabdb9bb883636d4946e238ab78f909fa3 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 2 Mar 2023 15:12:36 +0100 Subject: [PATCH] Dumper: Fix dumping QDir with Qt6.6 Change-Id: I7ef37026c638f7e77e4e34af40c3ecff1e40e8b3 Reviewed-by: David Schulz Reviewed-by: --- share/qtcreator/debugger/qttypes.py | 39 ++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index 2cdf900d78e..5a406c03190 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -418,7 +418,24 @@ def qdump__QDir(d, value): d.putExpandable() privAddress = d.extractPointer(value) bit32 = d.ptrSize() == 4 - qt5 = d.qtVersion() >= 0x050000 + + # change fc3942114da adds FileCache + # QStringList nameFilters; + # QDir::SortFlags sort; + # QDir::Filters filters; + # std::unique_ptr fileEngine; + # QFileSystemEntry dirEntry; + # struct FileCache + # { + # QMutex mutex; + # QStringList files; + # QFileInfoList fileInfos; + # std::atomic fileListsInitialized = false; + # QFileSystemEntry absoluteDirEntry; + # QFileSystemMetaData metaData; + # }; + # mutable FileCache fileCache; + # Change 9fc0965 reorders members again. # bool fileListsInitialized @@ -454,7 +471,9 @@ def qdump__QDir(d, value): # + 2 byte padding fileSystemEntrySize = 2 * d.ptrSize() + 8 - if d.qtVersion() >= 0x060000: + if d.qtVersion() >= 0x060600: + case = 3 + elif d.qtVersion() >= 0x060000: case = 2 elif d.qtVersion() >= 0x050300: case = 1 @@ -467,7 +486,20 @@ def qdump__QDir(d, value): firstValue = d.extractInt(privAddress + d.ptrSize()) case = 1 if firstValue == 0 or firstValue == 1 else 0 - if case == 2: + if case == 3: + if bit32: + dirEntryOffset = 24 + fileCacheOffset = 52 + filesOffset = fileCacheOffset + 4 + fileInfosOffset = fileCacheOffset + 16 + absoluteDirEntryOffset = fileCacheOffset + 32 + else: + dirEntryOffset = 48 + fileCacheOffset = 104 + filesOffset = fileCacheOffset + 8 + fileInfosOffset = fileCacheOffset + 32 + absoluteDirEntryOffset = fileCacheOffset + 64 + elif case == 2: if bit32: filesOffset = 4 fileInfosOffset = 16 @@ -507,6 +539,7 @@ def qdump__QDir(d, value): d.call('int', value, 'count') # Fill cache. except: pass + #d.putCallItem('absolutePath', '@QString', value, 'absolutePath') #d.putCallItem('canonicalPath', '@QString', value, 'canonicalPath') with SubItem(d, 'absolutePath'):