summaryrefslogtreecommitdiffstats
path: root/.gdbinit
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2017-10-09 15:30:26 +0200
committerRuediger Pluem <rpluem@apache.org>2017-10-09 15:30:26 +0200
commitb269faedaa4ff88da570880747ccd4860c1eb721 (patch)
treedab1b839152c3235ccf2eb89be4c01f82b329651 /.gdbinit
parent* Convert to int before using (diff)
downloadapache2-b269faedaa4ff88da570880747ccd4860c1eb721.tar.xz
apache2-b269faedaa4ff88da570880747ccd4860c1eb721.zip
* The calculation of the sizes was flawed:
The index tells us the size of the node in 4096 byte pages minus 1. Hence we need to multiply back with 4096 aka << 12 (plus adding the missing page). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1811569 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit10
1 files changed, 5 insertions, 5 deletions
diff --git a/.gdbinit b/.gdbinit
index 7f1a5ba979..74b179f003 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -374,8 +374,8 @@ define dump_allocator
if $node != 0
printf " #%2d: ", $i
while $node != 0
- printf "%d, ", 4096 << $node->index
- set $kb = $kb + (4 << $node->index)
+ printf "%d, ", ($node->index + 1) << 12
+ set $kb = $kb + (($node->index + 1) << 2)
set $node = $node->next
end
printf "ends.\n"
@@ -396,7 +396,7 @@ define dump_one_pool
set $node = $arg0->active
set $done = 0
while $done == 0
- set $size = $size + (4096 << $node->index)
+ set $size = $size + (($node->index + 1) << 12)
set $free = $free + ($node->endp - $node->first_avail)
set $nodes = $nodes + 1
set $node = $node->next
@@ -444,7 +444,7 @@ class DumpPoolAndChilds (gdb.Command):
if node != 0:
while node != 0:
noded = node.dereference()
- kb = kb + (4 << int(noded['index']))
+ kb = kb + ((int(noded['index']) + 1) << 2)
node = noded['next']
i = i + 1
self.total_free_blocks[salloc] = kb
@@ -461,7 +461,7 @@ class DumpPoolAndChilds (gdb.Command):
done = 0
while done == 0:
noded = node.dereference()
- size = size + (4096 << int(noded['index']))
+ size = size + ((int(noded['index']) + 1) << 12)
free = free + (noded['endp'] - noded['first_avail'])
nodes = nodes + 1
node = noded['next']