summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2007-08-15 23:34:37 +0000
committerGreg Beaver <cellog@php.net>2007-08-15 23:34:37 +0000
commit2211e8e14f656f570d0481c227c60408f2c6897b (patch)
tree8c757c5296b1a932310f5d242a8f884904fb5bec
parent46db4d3f65e0f487523cf233d21b941b4111aaaa (diff)
downloadphp-git-2211e8e14f656f570d0481c227c60408f2c6897b.tar.gz
add fp and refcount display
-rw-r--r--ext/phar/gdbhelp29
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/phar/gdbhelp b/ext/phar/gdbhelp
index b8240312f3..6da5cb218c 100644
--- a/ext/phar/gdbhelp
+++ b/ext/phar/gdbhelp
@@ -40,3 +40,32 @@ define print_phar
____print_pharht $pharglobals.phar_fname_map 0
printf "}\n"
end
+
+define print_pharfp
+ pharglobals
+ set $ht = $pharglobals.phar_fname_map
+ set $p = $ht.pListHead
+ set $fpcount = 0
+
+ while $p != 0
+ set $pharname = (*(phar_archive_data*)$p->pDataPtr).fname
+ set $pharrefcount = (*(phar_archive_data*)$p->pDataPtr).refcount
+ if (*(phar_archive_data*)$p->pDataPtr).fp != 0
+ set $fpcount = $fpcount + 1
+ printf "phar %s is open (%i)\n", $pharname, $pharrefcount
+ end
+ set $manifest = (*(phar_archive_data*)$p->pDataPtr).manifest
+ set $m = $manifest.pListHead
+ while $m != 0
+ if (*(phar_entry_info *)$m->pData).fp
+ set $fpcount = $fpcount + 1
+ set $a = (*(phar_entry_info *)$m->pData).fp_refcount
+ printf "phar %s file %s is open (%i)\n", $pharname, (*(phar_entry_info *)$m->pData).filename, $a
+ end
+ set $m = $m->pListNext
+ end
+
+ set $p = $p->pListNext
+ end
+ printf "Open file pointers: %d\n", $fpcount
+end \ No newline at end of file