Debugger: Remove workaround for GDB < 7.2 missing frame.block

This practically means that the >= 7.2 requirement is now a hard
requirement.

Change-Id: I6c3abbc625443ded182d2da101e04d96e3bed26d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
hjk
2013-04-05 13:47:36 +02:00
parent ecbdc68c96
commit 1d580bcf9f

View File

@@ -154,13 +154,6 @@ try:
warn("FRAME NOT ACCESSIBLE FOR UNKNOWN REASONS")
return []
# New in 7.2
hasBlock = 'block' in __builtin__.dir(frame)
items = []
#warn("HAS BLOCK: %s" % hasBlock)
if hasBlock:
#warn("IS GOOD: %s " % varList)
try:
block = frame.block()
#warn("BLOCK: %s " % block)
@@ -171,6 +164,7 @@ try:
warn("BLOCK NOT ACCESSIBLE FOR UNKNOWN REASONS")
return items
items = []
shadowed = {}
while True:
if block is None:
@@ -238,70 +232,6 @@ try:
break
block = block.superblock
else:
# Assuming gdb 7.0 release or 6.8-symbianelf.
filename = createTempFile()
#warn("VARLIST: %s " % varList)
#warn("FILENAME: %s " % filename)
gdb.execute("set logging off")
# gdb.execute("set logging redirect off")
gdb.execute("set logging file %s" % filename)
# gdb.execute("set logging redirect on")
gdb.execute("set logging on")
try:
gdb.execute("info args")
# We cannot use "info locals" as at least 6.8-symbianelf
# aborts as soon as we hit unreadable memory.
# gdb.execute("interpreter mi '-stack-list-locals 0'")
# results in &"Recursive internal problem.\n", so we have
# the frontend pass us the list of locals.
# There are two cases, either varList is empty, so we have
# to fetch the list here, or it is not empty with the
# first entry being a dummy.
if len(varList) == 0:
gdb.execute("info locals")
else:
varList = varList[1:]
except:
pass
gdb.execute("set logging off")
# gdb.execute("set logging redirect off")
try:
temp = open(filename, "r")
for line in temp:
if len(line) == 0 or line.startswith(" "):
continue
# The function parameters
pos = line.find(" = ")
if pos < 0:
continue
varList.append(line[0:pos])
temp.close()
except:
pass
removeTempFile(filename)
#warn("VARLIST: %s " % varList)
for name in varList:
#warn("NAME %s " % name)
item = LocalItem()
item.iname = "local." + name
item.name = name
try:
item.value = frame.read_var(name) # this is a gdb value
except RuntimeError:
pass
#continue
except:
# Something breaking the list, like intermediate gdb warnings
# like 'Warning: can't find linker symbol for virtual table for
# `std::less<char const*>' value\n\nwarning: found
# `myns::QHashData::shared_null' instead [...]
# that break subsequent parsing. Chicken out and take the
# next "usable" line.
continue
items.append(item)
return items