Commit 0697fc5e authored by hjk's avatar hjk Committed by hjk
Browse files

debugger: use faster symbol lookup to discover dynamic type



Change-Id: I09d2deedf9288cf930a38179e7ff6e4f8e242efc
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 24c7edb8
...@@ -1524,22 +1524,15 @@ class Dumper: ...@@ -1524,22 +1524,15 @@ class Dumper:
warn("WRONG ASSUMPTION HERE: %s " % type.code) warn("WRONG ASSUMPTION HERE: %s " % type.code)
check(False) check(False)
fields = extractFields(type) #vtbl = str(parseAndEvaluate("{int(*)(int)}%s" % long(value.address)))
#fields = type.fields() vtbl = gdb.execute("info symbol {int*}%s" % long(value.address),
to_string = True)
# The dynamic type is a better type. pos1 = vtbl.find("vtable ")
if len(fields): if pos1 != -1:
field = fields[0] pos1 += 11
#warn("FIELD: %s" % field.name) pos2 = vtbl.find(" +", pos1)
if field.name.startswith("_vptr."): if pos2 != -1:
p = value[field.name] self.putType(vtbl[pos1 : pos2], 1)
if long(p.dereference()) != 0:
func = str(p.dereference())
pos1 = func.find('<')
if pos1 != -1:
pos2 = func.find('::~')
if pos2 != -1:
self.putBetterType(func[pos1 + 1 : pos2])
if self.useFancy and (format is None or format >= 1): if self.useFancy and (format is None or format >= 1):
self.putAddress(value.address) self.putAddress(value.address)
...@@ -1566,6 +1559,8 @@ class Dumper: ...@@ -1566,6 +1559,8 @@ class Dumper:
#warn("INAME: %s " % self.currentIName) #warn("INAME: %s " % self.currentIName)
#warn("INAMES: %s " % self.expandedINames) #warn("INAMES: %s " % self.expandedINames)
#warn("EXPANDED: %s " % (self.currentIName in self.expandedINames)) #warn("EXPANDED: %s " % (self.currentIName in self.expandedINames))
fields = extractFields(type)
#fields = type.fields()
self.putType(typeName) self.putType(typeName)
self.putAddress(value.address) self.putAddress(value.address)
......
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