Commit 2800583e authored by hjk's avatar hjk Committed by hjk

debugger: fix breakage with gdb 7.1

Officially we support only 7.2+ nowadays, but 7.1 used to work. This was
broken recently by the "dynamic type" work. With this patch the debugger
behaves as before with 7.1, and shows dynamic types with 7.2+.

Change-Id: Id9e775d19712ea40d7c2a7aa8f9f734174d2446e
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent f62d6430
......@@ -91,14 +91,18 @@ def hasInferiorThreadList():
def dynamicTypeName(value):
#vtbl = str(parseAndEvaluate("{int(*)(int)}%s" % long(value.address)))
vtbl = gdb.execute("info symbol {int*}%s" % long(value.address),
to_string = True)
pos1 = vtbl.find("vtable ")
if pos1 != -1:
pos1 += 11
pos2 = vtbl.find(" +", pos1)
if pos2 != -1:
return vtbl[pos1 : pos2]
try:
# Fails on 7.1 due to the missing to_string.
vtbl = gdb.execute("info symbol {int*}%s" % long(value.address),
to_string = True)
pos1 = vtbl.find("vtable ")
if pos1 != -1:
pos1 += 11
pos2 = vtbl.find(" +", pos1)
if pos2 != -1:
return vtbl[pos1 : pos2]
except:
pass
return str(value.type)
def upcast(value):
......
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