* Create helper function isValidAddress to determine if an address is valid [skip ci]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879382 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ruediger Pluem
2020-06-30 20:14:36 +00:00
parent ae6c0815fe
commit ce5c1daf2f

View File

@ -592,6 +592,27 @@ document dump_pool_and_children
Dump the whole pool hierarchy starting from the given pool.
end
python
class isValidAddress (gdb.Function):
"""Determines if the argument is a valid address."""
def __init__(self):
super(isValidAddress, self).__init__("isValidAddress")
def invoke(self, address):
inf = gdb.inferiors()[0]
result = 1
try:
inf.read_memory(address, 8)
except:
result = 0
return result
isValidAddress()
end
# Set sane defaults for common signals:
handle SIGPIPE noprint pass nostop
handle SIGUSR1 print pass nostop