cvs: php4(PHP_4_3) / .gdbinit

From: Date: Sun, 06 Apr 2003 18:40:46 +0000
Subject: cvs: php4(PHP_4_3) / .gdbinit
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-20143@lists.php.net to get a copy of this message
moriyoshi Sun Apr 6 14:40:46 2003 EDT Modified files: (Branch: PHP_4_3) /php4 .gdbinit Log: MFH(r-1.5): improved zmemcheck macro so it displays the size of each memory block too. Index: php4/.gdbinit diff -u php4/.gdbinit:1.3.2.2 php4/.gdbinit:1.3.2.3 --- php4/.gdbinit:1.3.2.2 Sun Apr 6 14:12:36 2003 +++ php4/.gdbinit Sun Apr 6 14:40:46 2003 @@ -213,12 +213,13 @@ define zmemcheck set $p = alloc_globals.head set $stat = "?" + set $total_size = 0 if $arg0 != 0 set $not_found = 1 else set $not_found = 0 end - printf " block status file:line\n" + printf " block size status file:line\n" printf "-------------------------------------------------------------------------------\n" while $p set $aptr = $p + sizeof(struct _zend_mem_header) + sizeof(align_test) @@ -238,7 +239,14 @@ else set $filename = $filename + 1 end - printf " 0x%08x %-06s %s:%d", $aptr, $stat, $filename, $p->lineno + printf " 0x%08x ", $aptr + if $p->size == sizeof(struct _zval_struct) && ((struct _zval_struct *)$aptr)->type >= 0 && ((struct _zval_struct *)$aptr)->type < 10 + printf "ZVAL?(%-2d) ", $p->size + else + printf "%-9d ", $p->size + end + set $total_size = $total_size + $p->size + printf "%-06s %s:%d", $stat, $filename, $p->lineno if $p->orig_filename set $orig_filename = strrchr($p->orig_filename, '/') if !$orig_filename @@ -262,6 +270,10 @@ end if $not_found printf "no such block that begins at 0x%08x.\n", $aptr + end + if $arg0 == 0 + printf "-------------------------------------------------------------------------------\n" + printf " total: %d bytes\n", $total_size end end

« previous php.cvs (#20143) next »