summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2013-07-05 09:22:55 +0200
committerhjk <hjk121@nokiamail.com>2013-07-05 17:55:19 +0200
commit6aea42251bc14ad0ae8364d1c885e81b56ae2868 (patch)
tree1a103d5ea01ad58045ccc53523fc520240a7233c /share
parent8312ce27611fe62f581c73f450504dd1a2e14d50 (diff)
downloadqt-creator-6aea42251bc14ad0ae8364d1c885e81b56ae2868.tar.gz
Debugger: Make LLDB dumpers more robust
Take care of older versions without SBValue.GetCanonicalType() Change-Id: I10c1330633e5568b7c94059d4286c93adfecb1a2 Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/dumper/lbridge.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/share/qtcreator/dumper/lbridge.py b/share/qtcreator/dumper/lbridge.py
index 069a5d9509..283ed7c5d1 100644
--- a/share/qtcreator/dumper/lbridge.py
+++ b/share/qtcreator/dumper/lbridge.py
@@ -303,12 +303,13 @@ lldb.SBValue.cast = lambda self, typeObj: self.Cast(typeObj)
lldb.SBValue.dereference = lambda self: self.Dereference()
lldb.SBValue.address = property(lambda self: self.GetAddress())
-lldb.SBType.unqualified = lambda self: self.GetUnqualifiedType()
lldb.SBType.pointer = lambda self: self.GetPointerType()
lldb.SBType.code = lambda self: self.GetTypeClass()
lldb.SBType.sizeof = property(lambda self: self.GetByteSize())
+lldb.SBType.unqualified = \
+ lambda self: self.GetUnqualifiedType() if hasattr(self, 'GetUnqualifiedType') else self
lldb.SBType.strip_typedefs = \
lambda self: self.GetCanonicalType() if hasattr(self, 'GetCanonicalType') else self
@@ -1026,10 +1027,13 @@ class Dumper:
self.context = value
qqDumpers[typeName](self, value)
return
- value = value.Cast(value.GetType().GetCanonicalType().GetUnqualifiedType())
- self.putItem(value)
- self.putBetterType(typeName)
- return
+ realType = value.GetType()
+ if hasattr(realType, 'GetCanonicalType'):
+ realType = realType.GetCanonicalType()
+ value = value.Cast(realType.unqualified())
+ self.putItem(value)
+ self.putBetterType(typeName)
+ return
# Our turf now.
value.SetPreferSyntheticValue(False)
@@ -1042,7 +1046,7 @@ class Dumper:
# References
if value.GetType().IsReferenceType():
origType = value.GetTypeName();
- type = value.GetType().GetDereferencedType().GetUnqualifiedType()
+ type = value.GetType().GetDereferencedType().unqualified()
addr = int(value) & 0xFFFFFFFFFFFFFFFF
self.putItem(value.CreateValueFromAddress(None, addr, type))
#self.putItem(value.CreateValueFromData(None, value.GetData(), type))
@@ -1058,7 +1062,7 @@ class Dumper:
return
if self.autoDerefPointers:
- innerType = value.GetType().GetPointeeType().GetUnqualifiedType()
+ innerType = value.GetType().GetPointeeType().unqualified()
self.putType(innerType)
savedCurrentChildType = self.currentChildType
self.currentChildType = str(innerType)
@@ -1144,8 +1148,9 @@ class Dumper:
self.putItem(child)
for i in xrange(m, n):
child = value.GetChildAtIndex(i)
- with SubItem(self, child):
- self.putItem(child)
+ if child.IsValid(): # FIXME: Anon members?
+ with SubItem(self, child):
+ self.putItem(child)
def reportVariables(self, _ = None):
frame = self.currentThread().GetSelectedFrame()