summaryrefslogtreecommitdiffstats
path: root/.gdbinit
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2017-10-09 15:50:15 +0200
committerRuediger Pluem <rpluem@apache.org>2017-10-09 15:50:15 +0200
commitc968b5dea2448ebb6104eda5712f5064bebf800d (patch)
treee39f2e3242afe6147e316f700ae318c6274a802f /.gdbinit
parent* The calculation of the sizes was flawed: (diff)
downloadapache2-c968b5dea2448ebb6104eda5712f5064bebf800d.tar.xz
apache2-c968b5dea2448ebb6104eda5712f5064bebf800d.zip
* Make it compatible with Python 3
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1811570 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit11
1 files changed, 7 insertions, 4 deletions
diff --git a/.gdbinit b/.gdbinit
index 74b179f003..7b3b9a7967 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -425,6 +425,9 @@ document dump_all_pools
end
python
+
+from __future__ import print_function
+
class DumpPoolAndChilds (gdb.Command):
"""Dump the whole pool hierarchy starting from the given pool."""
@@ -471,14 +474,14 @@ class DumpPoolAndChilds (gdb.Command):
tag = darg['tag'].string()
else:
tag = "No tag"
- print "Pool '%s' [%s]: %d/%d free (%d blocks) allocator: %s free blocks in allocator: %i kiB" % (tag, arg, free, size, nodes, darg['allocator'], self._allocator_free_blocks(darg['allocator']))
+ print("Pool '%s' [%s]: %d/%d free (%d blocks) allocator: %s free blocks in allocator: %i kiB" % (tag, arg, free, size, nodes, darg['allocator'], self._allocator_free_blocks(darg['allocator'])))
self.free = self.free + free
self.size = self.size + size
self.nodes = self.nodes + nodes
def _dump(self, arg, depth):
pool = arg
- print "%*c" % (depth * 4 + 1, " "),
+ print("%*c" % (depth * 4 + 1, " "), end="")
self._dump_one_pool(pool)
if pool['child'] != 0:
self._dump(pool['child'], depth + 1)
@@ -493,11 +496,11 @@ class DumpPoolAndChilds (gdb.Command):
self.nodes = 0
self.total_free_blocks = {}
self._dump(pool, 0)
- print "Total %d/%d free (%d blocks)" % (self.free, self.size, self.nodes)
+ print("Total %d/%d free (%d blocks)" % (self.free, self.size, self.nodes))
sum = 0
for key in self.total_free_blocks:
sum = sum + self.total_free_blocks[key]
- print "Total free allocator blocks: %i kiB" % (sum)
+ print("Total free allocator blocks: %i kiB" % (sum))
DumpPoolAndChilds ()
end