summaryrefslogtreecommitdiff
path: root/ext/phar
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2007-08-15 03:49:44 +0000
committerGreg Beaver <cellog@php.net>2007-08-15 03:49:44 +0000
commit46db4d3f65e0f487523cf233d21b941b4111aaaa (patch)
treee424e796415fd273d9aa1a0ab79d3fecb1f7a179 /ext/phar
parent41677633cb2382044c45d65d2e1d76febb2536da (diff)
downloadphp-git-46db4d3f65e0f487523cf233d21b941b4111aaaa.tar.gz
add helper functions for gdb debugging phar reference counting (needs more work, but a good start)
Diffstat (limited to 'ext/phar')
-rw-r--r--ext/phar/gdbhelp42
1 files changed, 42 insertions, 0 deletions
diff --git a/ext/phar/gdbhelp b/ext/phar/gdbhelp
new file mode 100644
index 0000000000..b8240312f3
--- /dev/null
+++ b/ext/phar/gdbhelp
@@ -0,0 +1,42 @@
+define pharglobals
+ if basic_functions_module.zts
+ set $tsrm_ls = ts_resource_ex(0, 0)
+ set $pharglobals = ((zend_executor_globals) (*((void ***) $tsrm_ls))[phar_globals_id-1])
+ else
+ set $pharglobals = phar_globals
+ end
+end
+
+define ____print_pharht
+ set $ht = $arg0
+ set $p = $ht.pListHead
+
+ while $p != 0
+ set $i = $ind
+ while $i > 0
+ printf " "
+ set $i = $i - 1
+ end
+
+ set $temp = *(phar_archive_data*)$p->pDataPtr
+ ____print_str $temp.fname $temp.fname_len
+ printf " => "
+
+ if $arg1 == 0
+
+ printf "%i (alias ", $temp.refcount
+ ____print_str $temp.alias $temp.alias_len
+ printf ")\n"
+ end
+
+ set $p = $p->pListNext
+ end
+end
+
+define print_phar
+ set $ind = 1
+ pharglobals
+ printf "{"
+ ____print_pharht $pharglobals.phar_fname_map 0
+ printf "}\n"
+end