debugger: try long(p) == 0 as null-check for pointers as suggested by Tom T.

This commit is contained in:
hjk
2010-08-12 13:19:25 +02:00
parent 67f7caa116
commit aeb6479d73

View File

@@ -622,11 +622,12 @@ def isNull(p):
# for invalid char *, as their "contents" is being examined
#s = str(p)
#return s == "0x0" or s.startswith("0x0 ")
try:
# Can fail with: "RuntimeError: Cannot access memory at address 0x5"
return p.cast(lookupType("void").pointer()) == 0
except:
return False
#try:
# # Can fail with: "RuntimeError: Cannot access memory at address 0x5"
# return p.cast(lookupType("void").pointer()) == 0
#except:
# return False
return long(p) == 0
movableTypes = set([
"QBrush", "QBitArray", "QByteArray",