summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2007-05-20 21:46:17 +0000
committerMarcus Boerger <helly@php.net>2007-05-20 21:46:17 +0000
commita4e3f29771a9e7ed26a6ff18782c3146b931427b (patch)
treedd9c77d9e34f16e699fc4fb3b578b793dec5b7da /.gdbinit
parent30dd6a45d31cab020dad553bb7b6d4c499b01441 (diff)
downloadphp-git-a4e3f29771a9e7ed26a6ff18782c3146b931427b.tar.gz
- MFH Add print_htptr, print_htstr
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit54
1 files changed, 44 insertions, 10 deletions
diff --git a/.gdbinit b/.gdbinit
index 067613fba9..596f32e3ef 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -8,7 +8,7 @@ define ____executor_globals
end
document ____executor_globals
- portable way of accessing executor_globals
+ portable way of accessing executor_globals, set $eg
ZTS detection is automatically based on ext/standard module struct
end
@@ -39,14 +39,18 @@ define printzv
end
document printzv
- prints content of zval
+ prints zval contents
end
define ____printzv_contents
set $zvalue = $arg0
set $type = $zvalue->type
- printf "(refcount=%d) ", $zvalue->refcount
+ printf "(refcount=%d", $zvalue->refcount
+ if $zvalue->is_ref
+ printf ",is_ref"
+ end
+ printf ") "
if $type == 0
printf "NULL"
end
@@ -69,7 +73,7 @@ define ____printzv_contents
if ! $arg1
printf "{\n"
set $ind = $ind + 1
- ____print_ht $zvalue->value.ht
+ ____print_ht $zvalue->value.ht 1
set $ind = $ind - 1
set $i = $ind
while $i > 0
@@ -103,7 +107,7 @@ define ____printzv_contents
printf "(%d): ", $ht->nNumOfElements
printf "{\n"
set $ind = $ind + 1
- ____print_ht $ht
+ ____print_ht $ht 1
set $ind = $ind - 1
set $i = $ind
while $i > 0
@@ -188,12 +192,10 @@ define print_const_table
end
define ____print_ht
- set $ht = $arg0
+ set $ht = (HashTable*)$arg0
set $p = $ht->pListHead
while $p != 0
- set $zval = *(zval **)$p->pData
-
set $i = $ind
while $i > 0
printf " "
@@ -206,8 +208,18 @@ define ____print_ht
else
printf "%d => ", $p->h
end
+
+ if $arg1 == 0
+ printf "%p\n", (void*)$p->pData
+ end
+ if $arg1 == 1
+ set $zval = *(zval **)$p->pData
+ ____printzv $zval 1
+ end
+ if $arg1 == 2
+ printf "%s\n", (char*)$p->pData
+ end
- ____printzv $zval 1
set $p = $p->pListNext
end
end
@@ -215,7 +227,7 @@ end
define print_ht
set $ind = 1
printf "[0x%08x] {\n", $arg0
- ____print_ht $arg0
+ ____print_ht $arg0 1
printf "}\n"
end
@@ -223,6 +235,28 @@ document print_ht
dumps elements of HashTable made of zval
end
+define print_htptr
+ set $ind = 1
+ printf "[0x%08x] {\n", $arg0
+ ____print_ht $arg0 0
+ printf "}\n"
+end
+
+document print_htptr
+ dumps elements of HashTable made of pointers
+end
+
+define print_htstr
+ set $ind = 1
+ printf "[0x%08x] {\n", $arg0
+ ____print_ht $arg0 2
+ printf "}\n"
+end
+
+document print_htstr
+ dumps elements of HashTable made of strings
+end
+
define ____print_ft
set $ht = $arg0
set $p = $ht->pListHead