Commit f446beba authored by hjk's avatar hjk Committed by hjk

debugger: with gdb 7.3 we can have proper display of dynamic types.

So use it.

Change-Id: If33d087a9b767f0b2e6b16e57a36e9e7aa6e7c16
Reviewed-on: http://codereview.qt.nokia.com/522Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent c61652d0
......@@ -93,6 +93,13 @@ def hasInferiorThreadList():
except:
return False
def upcast(value):
try:
type = value.dynamic_type
return value.cast(type)
except:
return value
typeCache = {}
class TypeInfo:
......@@ -1287,6 +1294,7 @@ class Dumper:
pass
for item in locals:
item.value = upcast(item.value)
with OutputSafer(self, "", ""):
self.anonNumber = -1
#warn("ITEM NAME %s: " % item.name)
......@@ -1614,10 +1622,7 @@ class Dumper:
# warn("REAL VALUE: <unprintable>")
value = item.value
try:
realtype = value.dynamic_type
except:
realtype = value.type
realtype = value.type
type = realtype;
format = self.itemFormat(item)
......@@ -1886,7 +1891,7 @@ class Dumper:
#warn("EXPANDED: %s " % (item.iname in self.expandedINames))
fields = extractFields(type)
self.putType(item.value.type)
self.putType(type)
try:
self.putAddress(item.value.address)
except:
......@@ -1907,7 +1912,7 @@ class Dumper:
if self.isExpanded(item):
innerType = None
if len(fields) == 1 and fields[0].name is None:
innerType = value.type.target()
innerType = type.target()
with Children(self, 1, innerType):
child = Item(value, item.iname, None, item.name)
self.putFields(child)
......@@ -1923,7 +1928,7 @@ class Dumper:
def putFields(self, item, dumpBase = True):
value = item.value
type = stripTypedefs(value.type)
fields = extractFields(type)
fields = extractFields(value.type)
baseNumber = 0
for field in fields:
#warn("FIELD: %s" % field)
......@@ -1974,7 +1979,7 @@ class Dumper:
else:
# Named field.
with SubItem(self):
child = Item(value[field.name],
child = Item(upcast(value[field.name]),
item.iname, field.name, field.name)
bitsize = getattr(field, "bitsize", None)
if not bitsize is None:
......
......@@ -2733,7 +2733,10 @@ namespace qc42170 {
void test()
{
helper(new Circle(1.5, -2.5, 3.0, 15));
Circle *circle = new Circle(1.5, -2.5, 3.0, 15);
Object *obj = circle;
helper(circle);
helper(obj);
}
} // namespace qc42170
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment