summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authorSterling Hughes <sterling@php.net>2003-05-02 03:12:05 (GMT)
committerSterling Hughes <sterling@php.net>2003-05-02 03:12:05 (GMT)
commit7177ada1467469e110660f88d3b06d4072633e73 (patch)
tree36da3909d0980bc9e248732536b4722b0d6096d4 /.gdbinit
parentff82ad268fce08e7859ca5bd1d4ef68593c23f0f (diff)
downloadphp-7177ada1467469e110660f88d3b06d4072633e73.tar.gz
some improvements to the debugging macros
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit106
1 files changed, 75 insertions, 31 deletions
diff --git a/.gdbinit b/.gdbinit
index e946d4a..c2d0295 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -35,7 +35,7 @@ document dump_bt
end
define printzv
- set $ind = 0
+ set $ind = 1
____printzv $arg0 0
end
@@ -43,61 +43,56 @@ document printzv
prints content of zval
end
-define ____printzv
+define ____printzv_contents
____executor_globals
set $zvalue = $arg0
- if $zvalue->type == 0
+ if $zvalue.type == 0
set $typename = "NULL"
end
- if $zvalue->type == 1
+ if $zvalue.type == 1
set $typename = "long"
end
- if $zvalue->type == 2
+ if $zvalue.type == 2
set $typename = "double"
end
- if $zvalue->type == 3
+ if $zvalue.type == 3
set $typename = "string"
end
- if $zvalue->type == 4
+ if $zvalue.type == 4
set $typename = "array"
end
- if $zvalue->type == 5
+ if $zvalue.type == 5
set $typename = "object"
end
- if $zvalue->type == 6
+ if $zvalue.type == 6
set $typename = "bool"
end
- if $zvalue->type == 7
+ if $zvalue.type == 7
set $typename = "resource"
end
- if $zvalue->type == 8
+ if $zvalue.type == 8
set $typename = "constant"
end
- if $zvalue->type == 9
+ if $zvalue.type == 9
set $typename = "const_array"
end
- printf "[0x%08x] ", $zvalue
-
- if $zvalue == $eg.uninitialized_zval_ptr
- printf "*uninitialized* "
- end
- printf "(refcount=%d) %s: ", $zvalue->refcount, $typename
- if $zvalue->type == 1
- printf "%ld", $zvalue->value.lval
+ printf "(refcount=%d) %s: ", $zvalue.refcount, $typename
+ if $zvalue.type == 1
+ printf "%ld", $zvalue.value.lval
end
if $zvalue->type == 2
- printf "%lf", $zvalue->value.dval
+ printf "%lf", $zvalue.value.dval
end
- if $zvalue->type == 3
- printf "\"%s\"(%d)", $zvalue->value.str.val, $zvalue->value.str.len
+ if $zvalue.type == 3
+ printf "\"%s\"(%d)", $zvalue.value.str.val, $zvalue.value.str.len
end
- if $zvalue->type == 4
+ if $zvalue.type == 4
if ! $arg1
printf "{\n"
set $ind = $ind + 1
- ____print_ht $zvalue->value.ht
+ ____print_ht $zvalue.value.ht
set $ind = $ind - 1
set $i = $ind
while $i > 0
@@ -107,10 +102,10 @@ define ____printzv
printf "}"
end
end
- if $zvalue->type == 5
+ if $zvalue.type == 5
if ! $arg1
printf "(prop examination disabled due to a gdb bug)"
- if $zvalue->value.obj.handlers->get_properties
+ if $zvalue.value.obj.handlers->get_properties
# set $ht = $zvalue->value.obj.handlers->get_properties($zvalue)
# printf "{\n"
# set $ind = $ind + 1
@@ -125,19 +120,68 @@ define ____printzv
end
end
end
- if $zvalue->type == 6
- if $zvalue->lval
+ if $zvalue.type == 6
+ if $zvalue.value.lval
printf "true"
else
printf "false"
end
end
- if $zvalue->type == 7
- printf "#%d", $zvalue->value.lval
+ if $zvalue.type == 7
+ printf "#%d", $zvalue.value.lval
end
printf "\n"
end
+define ____printzv
+ ____executor_globals
+ set $zvalue = $arg0
+
+ printf "[0x%08x] ", $zvalue
+
+ if $zvalue == $eg.uninitialized_zval_ptr
+ printf "*uninitialized* "
+ end
+
+ set $zcontents = *(zval *) $zcontents
+ if $arg1
+ ____printzv_contents $zcontents $arg1
+ else
+ ____printzv_contents $zcontents
+ end
+end
+
+define ____print_const_table
+ set $ht = $arg0
+ set $p = $ht->pListHead
+
+ while $p != 0
+ set $const = *(zend_constant *) $p->pData
+
+ set $i = $ind
+ while $i > 0
+ printf " "
+ set $i = $i - 1
+ end
+
+ if $p->nKeyLength > 0
+ printf "\"%s\" => ", $p->arKey
+ else
+ printf "%d => ", $p->h
+ end
+
+ ____printzv_contents $const.value 0
+ set $p = $p->pListNext
+ end
+end
+
+define print_const_table
+ set $ind = 1
+ printf "[0x%08x] {\n", $arg0
+ ____print_const_table $arg0
+ printf "}\n"
+end
+
define ____print_ht
set $ht = $arg0
set $p = $ht->pListHead