summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2014-06-18 14:20:58 +0200
committerEike Ziller <eike.ziller@digia.com>2014-06-18 14:20:58 +0200
commitcbf4de03153a6729db6edcf244a282d901dd1c03 (patch)
tree81792056743630c19b384fd28f4ab9b1c665d970 /share
parent6cee8a42ff1b56f35143e6011d70747913710091 (diff)
parente3979fe09d7dd3ef1546e97d22d76178c8e38303 (diff)
downloadqt-creator-cbf4de03153a6729db6edcf244a282d901dd1c03.tar.gz
Merge remote-tracking branch 'origin/3.1'
Conflicts: tests/auto/debugger/tst_dumpers.cpp Change-Id: I1bad0c1477d7fd6996c0f8ca82e76ba521bc0dcc
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/debugger/gdbbridge.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py
index fc735cf870..655a3c99b5 100644
--- a/share/qtcreator/debugger/gdbbridge.py
+++ b/share/qtcreator/debugger/gdbbridge.py
@@ -634,7 +634,8 @@ class Dumper(DumperBase):
def childAt(self, value, index):
field = value.type.fields()[index]
- if len(field.name):
+ # GDB 7.7 commit b5b08fb4 started to report None as field names.
+ if field.name:
try:
return value[field.name]
except:
@@ -1242,7 +1243,7 @@ class Dumper(DumperBase):
def putFields(self, value, dumpBase = True):
fields = value.type.fields()
- #warn("TYPE: %s" % type)
+ #warn("TYPE: %s" % value.type)
#warn("FIELDS: %s" % fields)
baseNumber = 0
for field in fields:
@@ -1250,14 +1251,23 @@ class Dumper(DumperBase):
#warn(" BITSIZE: %s" % field.bitsize)
#warn(" ARTIFICIAL: %s" % field.artificial)
+ # Since GDB commit b5b08fb4 anonymous structs get also reported
+ # with a 'None' name.
if field.name is None:
- type = stripTypedefs(value.type)
- innerType = type.target()
- p = value.cast(innerType.pointer())
- for i in xrange(int(type.sizeof / innerType.sizeof)):
- with SubItem(self, i):
- self.putItem(p.dereference())
- p = p + 1
+ if value.type.code == ArrayCode:
+ # An array.
+ type = stripTypedefs(value.type)
+ innerType = type.target()
+ p = value.cast(innerType.pointer())
+ for i in xrange(int(type.sizeof / innerType.sizeof)):
+ with SubItem(self, i):
+ self.putItem(p.dereference())
+ p = p + 1
+ else:
+ # Something without a name.
+ self.anonNumber += 1
+ with SubItem(self, str(self.anonNumber)):
+ self.putItem(value[field])
continue
# Ignore vtable pointers for virtual inheritance.
@@ -1313,7 +1323,7 @@ class Dumper(DumperBase):
def listAnonymous(self, value, name, type):
for field in type.fields():
#warn("FIELD NAME: %s" % field.name)
- if len(field.name) > 0:
+ if field.name:
with SubItem(self, field.name):
self.putItem(value[field.name])
else: