summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2013-10-26 19:56:50 +0200
committerEike Ziller <eike.ziller@digia.com>2013-10-28 08:32:26 +0100
commit903b06ec0e88957a04f5f453fa0e75bbbf2740ef (patch)
tree5cce30b21db24ca401cb43f5083dd7e066a60547 /share
parent4b8a1bc7e0370a19385c9542b2982d00a2a3fa68 (diff)
downloadqt-creator-903b06ec0e88957a04f5f453fa0e75bbbf2740ef.tar.gz
debugger: Fix QDir dumper for Qt4/64bit
Also make the structure more self-explained Change-Id: Ia5080f4e07e2a8b7c6b18e1353a4cf1cf3488361
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/debugger/qttypes.py51
1 files changed, 32 insertions, 19 deletions
diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py
index f961fe4af5..fd5d3b9b5c 100644
--- a/share/qtcreator/debugger/qttypes.py
+++ b/share/qtcreator/debugger/qttypes.py
@@ -289,36 +289,49 @@ def qdump__QDir(d, value):
privAddress = d.dereferenceValue(value)
bit32 = d.is32bit()
qt5 = d.qtVersion() >= 0x050000
- # value.d_ptr.d.dirEntry.m_filePath - value.d_ptr.d
- offset = (32 if bit32 else 56) if qt5 else 36
- filePathAddress = privAddress + offset
- #try:
- # # Up to Qt 4.7
- # d.putStringValue(data["path"])
- #except:
- # # Qt 4.8 and later.
- # d.putStringValue(data["dirEntry"]["m_filePath"])
- d.putStringValueByAddress(filePathAddress)
+ # QDirPrivate:
+ # QAtomicInt ref
+ # QStringList nameFilters;
+ # QDir::SortFlags sort;
+ # QDir::Filters filters;
+ # // qt3support:
+ # QChar filterSepChar;
+ # bool matchAllDirs;
+ # // end qt3support
+ # QScopedPointer<QAbstractFileEngine> fileEngine;
+ # bool fileListsInitialized;
+ # QStringList files;
+ # QFileInfoList fileInfos;
+ # QFileSystemEntry dirEntry;
+ # QFileSystemEntry absoluteDirEntry;
+ qt3SupportAddition = 0 if qt5 else d.ptrSize() # qt5 doesn't have qt3support
+ filesOffset = (24 if bit32 else 40) + qt3SupportAddition
+ fileInfosOffset = filesOffset + d.ptrSize()
+ dirEntryOffset = fileInfosOffset + d.ptrSize()
+ # QFileSystemEntry:
+ # QString m_filePath
+ # QByteArray m_nativeFilePath
+ # qint16 m_lastSeparator
+ # qint16 m_firstDotInFileName
+ # qint16 m_lastDotInFileName
+ # + 2 byte padding
+ fileSystemEntrySize = 2 * d.ptrSize() + 8
+ absoluteDirEntryOffset = dirEntryOffset + fileSystemEntrySize
+ d.putStringValueByAddress(privAddress + dirEntryOffset)
if d.isExpanded():
with Children(d):
d.call(value, "count") # Fill cache.
#d.putCallItem("absolutePath", value, "absolutePath")
#d.putCallItem("canonicalPath", value, "canonicalPath")
with SubItem(d, "absolutePath"):
- # value.d_ptr.d.absoluteDirEntry.m_filePath - value.d_ptr.d
- offset = (48 if bit32 else 80) if qt5 else 36
typ = d.lookupType(d.ns + "QString")
- d.putItem(d.createValue(privAddress + offset, typ))
+ d.putItem(d.createValue(privAddress + absoluteDirEntryOffset, typ))
with SubItem(d, "entryInfoList"):
- # value.d_ptr.d.fileInfos - value.d_ptr.d
- offset = (28 if bit32 else 48) if qt5 else 32
typ = d.lookupType(d.ns + "QList<" + d.ns + "QFileInfo>")
- d.putItem(d.createValue(privAddress + offset, typ))
+ d.putItem(d.createValue(privAddress + fileInfosOffset, typ))
with SubItem(d, "entryList"):
- # d.ptr.d.files - value.d_ptr.d
- offset = (24 if bit32 else 40) if qt5 else 28
typ = d.lookupType(d.ns + "QStringList")
- d.putItem(d.createValue(privAddress + offset, typ))
+ d.putItem(d.createValue(privAddress + filesOffset, typ))
def qdump__QFile(d, value):