debugger: str(p) is unsafe to use for invalid char *

This commit is contained in:
hjk
2010-01-04 16:15:32 +01:00
parent 960f8dc03d
commit 2a28741f90

View File

@@ -177,8 +177,11 @@ def checkPointer(p, align = 1):
def isNull(p): def isNull(p):
s = str(p) # The following can cause evaluation to abort with "UnicodeEncodeError"
return s == "0x0" or s.startswith("0x0 ") # for invalid char *, as their "contents" is being examined
#s = str(p)
#return s == "0x0" or s.startswith("0x0 ")
return p.cast(gdb.lookup_type("unsigned long long")) == 0
movableTypes = set([ movableTypes = set([
"QBrush", "QBitArray", "QByteArray", "QBrush", "QBitArray", "QByteArray",