aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-01-31 18:39:58 +0100
committerhjk <hjk121@nokiamail.com>2014-02-03 07:56:57 +0100
commit871a4bcad375542f4d8e60cdc2361b5c91054641 (patch)
tree44673442826ff5ccd912367d4f2a61c17bfe558b /share
parent5ea71557be1cad2a41480ee4886ff6c89d8cdf96 (diff)
Debugger: Re-structure version check in QDir dumper
Change-Id: Ic14155688e0e9bbe0d45cde20563929b7370695d Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/debugger/qttypes.py40
1 files changed, 22 insertions, 18 deletions
diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py
index 010736ae64..fe7888b64b 100644
--- a/share/qtcreator/debugger/qttypes.py
+++ b/share/qtcreator/debugger/qttypes.py
@@ -350,25 +350,29 @@ def qdump__QDir(d, value):
# + 2 byte padding
fileSystemEntrySize = 2 * d.ptrSize() + 8
- done = False
- if d.qtVersion() >= 0x050200:
+ if d.qtVersion() < 0x050200:
+ case = 0
+ elif d.qtVersion() >= 0x050300:
+ case = 1
+ else:
# Try to distinguish bool vs QStringList at the first item
- # after the refcount:
- firstValue = d.extractInt(privAddress + 4)
- if firstValue == 0 or firstValue == 1 or d.qtVersion() >= 0x050300:
- # Looks like a bool. Assume this is after 9fc0965.
- done = True
- if bit32:
- filesOffset = 4
- fileInfosOffset = 8
- dirEntryOffset = 0x20
- absoluteDirEntryOffset = 0x30
- else:
- filesOffset = 0x08
- fileInfosOffset = 0x10
- dirEntryOffset = 0x30
- absoluteDirEntryOffset = 0x48
- if not done:
+ # after the (padded) refcount. If it looks like a bool assume
+ # this is after 9fc0965. This is not safe.
+ firstValue = d.extractInt(privAddress + d.ptrSize())
+ case = 1 if firstValue == 0 or firstValue == 1 else 0
+
+ if case == 1:
+ if bit32:
+ filesOffset = 4
+ fileInfosOffset = 8
+ dirEntryOffset = 0x20
+ absoluteDirEntryOffset = 0x30
+ else:
+ filesOffset = 0x08
+ fileInfosOffset = 0x10
+ dirEntryOffset = 0x30
+ absoluteDirEntryOffset = 0x48
+ else:
# Assume this is before 9fc0965.
qt3support = d.isQt3Support()
qt3SupportAddition = d.ptrSize() if qt3support else 0