com php-src: it's good for gc debuging: .gdbinit

From: Date: Tue, 16 Sep 2014 06:15:01 +0000
Subject: com php-src: it's good for gc debuging: .gdbinit
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-81672@lists.php.net to get a copy of this message
Commit: 6d2ca4b50892f318f46cf0f0084a4abc132708b2 Author: Xinchen Hui <laruence@php.net> Tue, 16 Sep 2014 14:15:01 +0800 Parents: d17487f827732633335a5b0784187d16cf35e031 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6d2ca4b50892f318f46cf0f0084a4abc132708b2 Log: it's good for gc debuging Changed paths: M .gdbinit Diff: diff --git a/.gdbinit b/.gdbinit index c1ef530..98bb173 100644 --- a/.gdbinit +++ b/.gdbinit @@ -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

« previous php.cvs (#81672) next »