diff options
author | hjk <hjk121@nokiamail.com> | 2013-05-17 09:50:39 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2013-05-17 16:08:11 +0200 |
commit | fcb419c51037e28074edff8a4e41841c71f145e7 (patch) | |
tree | ec3211a870e30cc97325a9bc410d6c71c0a9c402 | |
parent | 85957bc53e0c660af5e2049f3fb04ad4cc3c5b38 (diff) | |
download | qt-creator-fcb419c51037e28074edff8a4e41841c71f145e7.tar.gz |
Debugger: Make reference types visible with LLDB
Change-Id: I0caf56da8bc542f8829f21e703a6f4beb7d0b88d
Reviewed-by: hjk <hjk121@nokiamail.com>
-rw-r--r-- | share/qtcreator/dumper/lbridge.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/share/qtcreator/dumper/lbridge.py b/share/qtcreator/dumper/lbridge.py index eb3955ed49..09a6a4c7dc 100644 --- a/share/qtcreator/dumper/lbridge.py +++ b/share/qtcreator/dumper/lbridge.py @@ -740,8 +740,15 @@ class Debugger: else: self.putValue('<%s items>' % count) - def putType(self, typeName, priority = 0): - self.put('type="%s",' % typeName) + def putType(self, type, priority = 0): + # Higher priority values override lower ones. + if priority >= self.currentTypePriority: + self.currentType = str(type) + self.currentTypePriority = priority + + def putBetterType(self, type, priority = 0): + self.currentType = str(type) + self.currentTypePriority = self.currentTypePriority + 1 def putStringValue(self, value, priority = 0): if not value is None: @@ -841,6 +848,18 @@ class Debugger: return value.SetPreferSyntheticValue(False) + + # References + if value.GetType().IsReferenceType(): + type = value.GetType().GetDereferencedType().GetPointerType() + # FIXME: Find something more direct. + value = value.CreateValueFromAddress(value.GetName(), + value.AddressOf().GetValueAsUnsigned(), type).Dereference() + #value = value.cast(value.dynamic_type) + self.putItem(value) + self.putBetterType("%s &" % value.GetTypeName()) + return + stripped = self.stripNamespaceFromType(typeName).replace("::", "__") #warn("VALUE: %s" % value) if stripped in qqDumpers: |