summaryrefslogtreecommitdiffstats
path: root/.gdbinit
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2020-06-30 22:14:36 +0200
committerRuediger Pluem <rpluem@apache.org>2020-06-30 22:14:36 +0200
commitce5c1daf2fb69dfb018667bb08b2d6ce311fdd0c (patch)
treecef9caef2b9bd227a9f218bf821230bbc4d95e8a /.gdbinit
parent* Let dump_brigade print the length of the brigade (diff)
downloadapache2-ce5c1daf2fb69dfb018667bb08b2d6ce311fdd0c.tar.xz
apache2-ce5c1daf2fb69dfb018667bb08b2d6ce311fdd0c.zip
* 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
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit21
1 files changed, 21 insertions, 0 deletions
diff --git a/.gdbinit b/.gdbinit
index 21a0a13596..92146b70fe 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -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