Commit 7eedfb72 authored by hjk's avatar hjk

debugger: improve robustness in the presence of outdated debug information

parent e077d260
......@@ -600,7 +600,11 @@ def isNull(p):
# for invalid char *, as their "contents" is being examined
#s = str(p)
#return s == "0x0" or s.startswith("0x0 ")
return p.cast(lookupType("void").pointer()) == 0
try:
# Can fail with: "RuntimeError: Cannot access memory at address 0x5"
return p.cast(lookupType("void").pointer()) == 0
except:
return False
movableTypes = set([
"QBrush", "QBitArray", "QByteArray",
......@@ -981,11 +985,14 @@ class FrameCommand(gdb.Command):
# Special handling for char** argv.
n = 0
p = item.value
# p is 0 for "optimized out" cases.
if not isNull(p):
while not isNull(p.dereference()) and n <= 100:
p += 1
n += 1
# p is 0 for "optimized out" cases. Or contains rubbish.
try:
if not isNull(p):
while not isNull(p.dereference()) and n <= 100:
p += 1
n += 1
except:
pass
with SubItem(d):
d.put('iname="%s",' % item.iname)
......
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