Debugger: Add fallback when gdb.Value.cast() fails for typedefs

Fixes: QTCREATORBUG-18450
Change-Id: I9239beb7e1879a284e28a30579129fe487eb2dd2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2018-12-17 12:27:02 +01:00
parent 40f2f99714
commit 2a67a86c2f
2 changed files with 25 additions and 2 deletions
+8 -2
View File
@@ -247,8 +247,14 @@ class Dumper(DumperBase):
if targetType.code == gdb.TYPE_CODE_ARRAY:
val = self.Value(self)
else:
# Cast may fail (e.g for arrays, see test for Bug5799)
val = self.fromNativeValue(nativeValue.cast(targetType))
try:
# Cast may fail for arrays, for typedefs to __uint128_t with
# gdb.error: That operation is not available on integers
# of more than 8 bytes.
# See test for Bug5799, QTCREATORBUG-18450.
val = self.fromNativeValue(nativeValue.cast(targetType))
except:
val = self.Value(self)
#warn('CREATED TYPEDEF: %s' % val)
else:
val = self.Value(self)