Debugger: Call qVersion() for pre qtHookData Qt versions

Change-Id: Id37f4c31b776ea5af960011e7485b11c1a51c8d3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2017-01-11 13:28:51 +01:00
parent 0ab95e207b
commit cb2021d630

View File

@@ -264,6 +264,14 @@ class Dumper(DumperBase):
def qtVersion(self):
qtVersion = self.findValueByExpression('((void**)&%s)[2]' % self.qtHookDataSymbolName())
if qtVersion is None and self.qtCoreModuleName() is not None:
try:
versionValue = cdbext.call(self.qtCoreModuleName() + '!qVersion()')
version = self.extractCString(self.fromNativeValue(versionValue).address())
(major, minor, patch) = version.decode('latin1').split('.')
qtVersion = 0x10000 * int(major) + 0x100 * int(minor) + int(patch)
except:
pass
if qtVersion is None:
qtVersion = self.fallbackQtVersion
self.qtVersion = lambda: qtVersion