diff options
author | Xinchen Hui <laruence@php.net> | 2014-09-16 14:15:01 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2014-09-16 14:15:01 +0800 |
commit | 6d2ca4b50892f318f46cf0f0084a4abc132708b2 (patch) | |
tree | c2370a431834a61849e51b53e9a7b682ae2f8475 /.gdbinit | |
parent | d17487f827732633335a5b0784187d16cf35e031 (diff) | |
download | php-git-6d2ca4b50892f318f46cf0f0084a4abc132708b2.tar.gz |
it's good for gc debuging
Diffstat (limited to '.gdbinit')
-rw-r--r-- | .gdbinit | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -638,3 +638,28 @@ document zmemcheck usage: zmemcheck [ptr]. if ptr is 0, all blocks will be listed. end + +define lookup_root + set $found = 0 + if gc_globals->roots + set $current = gc_globals->roots->next + printf "looking ref %p in roots\n", $arg0 + while $current != &gc_globals->roots + if $current->ref == $arg0 + set $found = $current + break + end + set $current = $current->next + end + if $found != 0 + printf "found root %p\n", $found + else + printf "not found\n" + end + end +end + +document lookup_root + lookup a refcounted in root + usage: lookup_root [ptr]. +end |