Commit aeb6479d authored by hjk's avatar hjk

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

parent 67f7caa1
......@@ -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",
......
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